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

GradleReader and GradleReader2 fail if input file contains empty list #87

Closed
ohecker opened this issue Sep 20, 2021 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@ohecker
Copy link
Member

ohecker commented Sep 20, 2021

If the input file to processed by GradleReader or GradleReader2 contains only an empty list ( [] ) the Reader fails and Solicitor terminates:

Exception:
java.lang.IllegalArgumentException: fromIndex(1) > toIndex(0)
        at java.base/java.util.AbstractList.subListRangeCheck(AbstractList.java:509) ~[na:na]
        at java.base/java.util.ArrayList.subList(ArrayList.java:1138) ~[na:na]
        at com.devonfw.tools.solicitor.reader.gradle.GradleReader2.readInventory(GradleReader2.java:62) ~[classes!/:1.2.0]
        at com.devonfw.tools.solicitor.Solicitor.readInventory(Solicitor.java:140) ~[classes!/:1.2.0]
        at com.devonfw.tools.solicitor.Solicitor.mainProcessing(Solicitor.java:116) ~[classes!/:1.2.0]
        at com.devonfw.tools.solicitor.Solicitor.run(Solicitor.java:199) ~[classes!/:1.2.0]
        at com.devonfw.tools.solicitor.SolicitorApplication.main(SolicitorApplication.java:42) ~[classes!/:1.2.0]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[solicitor.jar:1.2.0]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[solicitor.jar:1.2.0]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) ~[solicitor.jar:1.2.0]
        at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:593) ~[solicitor.jar:1.2.0]

Solicitor should not terminate in this case but continue processing - possibly writing a WARN message.

This affects Solicitor version 1.2.0 and earlier.

@ohecker ohecker added the bug Something isn't working label Sep 20, 2021
@ohecker
Copy link
Member Author

ohecker commented Nov 16, 2021

Fixed with commit 8510af6 (v.1.2.3)

@ohecker ohecker closed this as completed Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant