Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfBoundsException when launching with several input files of the same type. #63

Closed
opcoach opened this issue Jul 20, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@opcoach
Copy link
Contributor

opcoach commented Jul 20, 2017

I got this exception when I launch the check on several files of the same type (fortran for instance).
Only the results of the first file are displayed.

If I launch the command with a shell and a fortran, there is not exception.

java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at fr.cnes.analysis.tools.analyzer.Analyzer.check(Analyzer.java:130)
at fr.cnes.icode.application.ICodeApplication.start(ICodeApplication.java:181)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.LinkedList.checkElementIndex(LinkedList.java:555)
at java.util.LinkedList.get(LinkedList.java:476)
at fr.cnes.analysis.tools.fortran77.rules.COMPROJECTHeader.raiseErrors(COMPROJECTHeader.java:438)
at fr.cnes.analysis.tools.fortran77.rules.COMPROJECTHeader.run(COMPROJECTHeader.java:842)
at fr.cnes.analysis.tools.analyzer.CallableChecker.call(CallableChecker.java:53)
at fr.cnes.analysis.tools.analyzer.CallableChecker.call(CallableChecker.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

@WaldoFR WaldoFR modified the milestone: Version 3.0 Jul 31, 2017
@WaldoFR
Copy link

WaldoFR commented Aug 2, 2017

Hello Olivier,

Can you reproduce this bug every time you run an analysis with several Fortran files ?

Do you still have an access to the files causing this crash ? It seems that the problem come directly from the rule COM.PROJECT.Header of the language Fortran77. I'd like to determine if this issue is a new one concerning the Analyzer or if it's a duplicate of #47.

If you reach only the result of the first file, it might be due to the fact that it is the second file which is causing the crash of the analysis.

Regards,
Omar

@WaldoFR WaldoFR marked this as a duplicate of #47 Aug 2, 2017
@WaldoFR WaldoFR self-assigned this Aug 2, 2017
@WaldoFR
Copy link

WaldoFR commented Aug 3, 2017

After investigation of this issue, launching analysis on heavy list of fortran files, I've been able to reproduce out of bound exceptions reported.

The problem come from COM.PROJECT.Header rule, it's a duplicate of #47, we'll handle it soon.

Thank you for having reported it.

Regards,
Omar

@WaldoFR
Copy link

WaldoFR commented Aug 21, 2017

This issue was re-opened while solving #82 issue. Exception of type IndexOutOfBound exception raised from the rule COM.PROJECT.Header aren't the cause of the undisplayed elements.

As related in the limitation #24 , it's not possible to reuse the method setInputFile(). That's why the Analyzer is using CallableChecker jobs to run it's analysis that are only intended to :

  • Use only one's rule analyzer.
  • Parse only one file.

However the getChecker() method of the class CheckerContainer that was being called by the Analyzer to instansiate the new CallableChecker was returning the same AbstractChecker and not a cloned one which had for consequence to share the same buffers as the AbstractChecker used to parse older files. This even if the setInputFile() was called in separated clones.

@WaldoFR WaldoFR removed the duplicate label Aug 21, 2017
@WaldoFR WaldoFR closed this as completed Aug 22, 2017
@WaldoFR WaldoFR mentioned this issue Aug 22, 2017
WaldoFR pushed a commit to WaldoFR/i-CodeCNES that referenced this issue Sep 6, 2017
… differ.

View displays informations of violations of the same file, rules, and
same line only in the case the message differs, this happens frequently
when message contains variables names. 
However, violations raised by the analysis on the same file on the same
line with the same message willn't be displayed.
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
… differ.

View displays informations of violations of the same file, rules, and
same line only in the case the message differs, this happens frequently
when message contains variables names. 
However, violations raised by the analysis on the same file on the same
line with the same message willn't be displayed.
begarco pushed a commit that referenced this issue Feb 2, 2020
View displays informations of violations of the same file, rules, and
same line only in the case the message differs, this happens frequently
when message contains variables names. 
However, violations raised by the analysis on the same file on the same
line with the same message willn't be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants