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

ArrayIndexOutOfBoundsException errors #583

Closed
cybersonic opened this issue Jun 26, 2018 · 6 comments
Closed

ArrayIndexOutOfBoundsException errors #583

cybersonic opened this issue Jun 26, 2018 · 6 comments
Assignees
Labels
Milestone

Comments

@cybersonic
Copy link

I am getting loads of the following error (with different indexes of course) in a scan of a client's source code:

Error: "java.lang.ArrayIndexOutOfBoundsException" Location: com.cflint.CFLint.process(CFLint.java:346)
com.cflint.exception.CFLintScanException: java.lang.ArrayIndexOutOfBoundsException
	at com.cflint.CFLint.process(CFLint.java:346)
	at com.cflint.CFLint.scan(CFLint.java:294)
	at com.cflint.CFLint.scan(CFLint.java:280)
	at com.cflint.CFLint.scan(CFLint.java:280)
	at com.cflint.CFLint.scan(CFLint.java:280)
	at com.cflint.CFLint.scan(CFLint.java:205)
	at com.cflint.api.CFLintAPI.scan(CFLintAPI.java:65)
	at com.cflint.cli.CFLintCLI.execute(CFLintCLI.java:371)
	at com.cflint.cli.CFLintCLI.main(CFLintCLI.java:339)
Caused by: java.lang.ArrayIndexOutOfBoundsException

What would be a good way to debug this error to be able to provide better information?

The command I am running is java -jar ~/bin/CFLint-1.4.0-all.jar -folder .

@ryaneberly
Copy link
Contributor

If you want to debug yourself, fire up com.cflint.cli.CFLintCLI in an IDE (Eclipse).

Or if you want help here, could you please give the next couple lines, the real cause at the lines shown after "Caused by: java.lang.ArrayIndexOutOfBoundsException".

@ryaneberly ryaneberly added the bug label Jul 9, 2018
@robertdmunn
Copy link

I am seeing the same issue as Mark:

Error: "java.lang.ArrayIndexOutOfBoundsException: 99" Location: com.cflint.CFLint.process(CFLint.java:346)
com.cflint.exception.CFLintScanException: java.lang.ArrayIndexOutOfBoundsException: 91
at com.cflint.CFLint.process(CFLint.java:346)
at com.cflint.CFLint.scan(CFLint.java:294)
at com.cflint.CFLint.scan(CFLint.java:280)
at com.cflint.CFLint.scan(CFLint.java:280)
at com.cflint.CFLint.scan(CFLint.java:280)
at com.cflint.CFLint.scan(CFLint.java:280)
at com.cflint.CFLint.scan(CFLint.java:205)
at com.cflint.api.CFLintAPI.scan(CFLintAPI.java:65)
at com.cflint.cli.CFLintCLI.execute(CFLintCLI.java:371)
at com.cflint.cli.CFLintCLI.main(CFLintCLI.java:339)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 91
at com.cflint.CFLint.reportRule(CFLint.java:1365)
at com.cflint.CFLint.process(CFLint.java:633)
at com.cflint.CFLint.processStack(CFLint.java:398)
at com.cflint.CFLint.process(CFLint.java:341)
... 9 more

I may debug the problem this weekend.

@robertdmunn
Copy link

Getting a similar error in a differe.nt location. Maybe a separate bug, but noting it here.

Error: "130" Location: com.cflint.CFLint.reportRule(CFLint.java:1378)
java.lang.ArrayIndexOutOfBoundsException: 130
at com.cflint.CFLint.reportRule(CFLint.java:1378)
at com.cflint.CFLint.scanExpression(CFLint.java:1022)
at com.cflint.CFLint.process(CFLint.java:775)
at com.cflint.CFLint.process(CFLint.java:867)
at com.cflint.CFLint.process(CFLint.java:772)
at com.cflint.CFLint.process(CFLint.java:515)
at com.cflint.CFLint.processStack(CFLint.java:416)
at com.cflint.CFLint.process(CFLint.java:476)
at com.cflint.CFLint.processStack(CFLint.java:416)
at com.cflint.CFLint.process(CFLint.java:629)
at com.cflint.CFLint.processStack(CFLint.java:398)
at com.cflint.CFLint.process(CFLint.java:341)
at com.cflint.CFLint.scan(CFLint.java:294)
at com.cflint.CFLint.scan(CFLint.java:280)
at com.cflint.CFLint.scan(CFLint.java:280)
at com.cflint.CFLint.scan(CFLint.java:280)
at com.cflint.CFLint.scan(CFLint.java:280)
at com.cflint.CFLint.scan(CFLint.java:205)
at com.cflint.api.CFLintAPI.scan(CFLintAPI.java:65)
at com.cflint.cli.CFLintCLI.execute(CFLintCLI.java:371)
at com.cflint.cli.CFLintCLI.main(CFLintCLI.java:339)

@CrazyPyro
Copy link

I get this too on Win10 w/ JRE 8u181. But it still produces a cflint-result.html with plenty of results. I'm guessing there's a file somewhere in there that it doesn't know how to parse. I'll check into it more on Linux tonight.

@ryaneberly
Copy link
Contributor

It looks like sometimes the attempt to determine the column is generating an outofbounds (and not reporting that error). Wrapping the setColumn calculation with a try/catch.

@ryaneberly ryaneberly self-assigned this Sep 15, 2018
@ryaneberly ryaneberly added this to the 1.4.1 milestone Sep 15, 2018
ryaneberly added a commit that referenced this issue Sep 15, 2018
@ryaneberly
Copy link
Contributor

fixed in dev branch.

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

4 participants