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 while analyzing an empty Shell script #197

Closed
begarco opened this issue Mar 5, 2020 · 0 comments · Fixed by #207
Closed

IndexOutOfBoundsException while analyzing an empty Shell script #197

begarco opened this issue Mar 5, 2020 · 0 comments · Fixed by #207
Labels
bug done Used when an issue is implemented but not yet released
Milestone

Comments

@begarco
Copy link
Contributor

begarco commented Mar 5, 2020

Describe the bug
i-Code throws an IndexOutOfBoundsException while analyzing an empty Shell script.

To reproduce
Run i-Code on an empty Shell file.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots & log

ERROR: Internal i-Code error: exception [IndexOutOfBoundsException] thrown while checking [COM.PRES.Header] on file [/home/begarco/workspace/dotvimconfig/internal/colorscheme/colors/bim.sh] - Index: 0, Size: 0
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.icode.shell.rules.COMPRESHeader.raiseErrors(COMPRESHeader.java:330)
        at fr.cnes.icode.shell.rules.COMPRESHeader.run(COMPRESHeader.java:716)
        at fr.cnes.sonar.plugins.icode.check.ICodeSensor.sonarCheck(ICodeSensor.java:273)
        at fr.cnes.sonar.plugins.icode.check.ICodeSensor.executeEmbeddedICode(ICodeSensor.java:193)
        at fr.cnes.sonar.plugins.icode.check.ICodeSensor.execute(ICodeSensor.java:116)

User environment (please complete the following information):

  • OS: Ubuntu
  • Java version: 11
  • i-Code version: 4.0.0

Additional context
Run on plugin for SonarQube.

@begarco begarco added this to the Version 4.1.0 milestone Mar 6, 2020
begarco added a commit that referenced this issue Apr 5, 2020
@begarco begarco added done Used when an issue is implemented but not yet released and removed to analyse labels Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done Used when an issue is implemented but not yet released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant