{"action":"created","issue":{"url":"https://api.github.com/repos/jeantessier/dependency-finder/issues/2","repository_url":"https://api.github.com/repos/jeantessier/dependency-finder","labels_url":"https://api.github.com/repos/jeantessier/dependency-finder/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/jeantessier/dependency-finder/issues/2/comments","events_url":"https://api.github.com/repos/jeantessier/dependency-finder/issues/2/events","html_url":"https://github.com/jeantessier/dependency-finder/issues/2","id":170370017,"number":2,"title":"IndexOutOfBoundsException when extracting lucene-core-6.1.0.jar > Lucene54DocValuesConsumer.class","user":{"login":"OlivierJaquemet","id":618861,"avatar_url":"https://avatars.githubusercontent.com/u/618861?v=3","gravatar_id":"","url":"https://api.github.com/users/OlivierJaquemet","html_url":"https://github.com/OlivierJaquemet","followers_url":"https://api.github.com/users/OlivierJaquemet/followers","following_url":"https://api.github.com/users/OlivierJaquemet/following{/other_user}","gists_url":"https://api.github.com/users/OlivierJaquemet/gists{/gist_id}","starred_url":"https://api.github.com/users/OlivierJaquemet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlivierJaquemet/subscriptions","organizations_url":"https://api.github.com/users/OlivierJaquemet/orgs","repos_url":"https://api.github.com/users/OlivierJaquemet/repos","events_url":"https://api.github.com/users/OlivierJaquemet/events{/privacy}","received_events_url":"https://api.github.com/users/OlivierJaquemet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jeantessier","id":122590,"avatar_url":"https://avatars.githubusercontent.com/u/122590?v=3","gravatar_id":"","url":"https://api.github.com/users/jeantessier","html_url":"https://github.com/jeantessier","followers_url":"https://api.github.com/users/jeantessier/followers","following_url":"https://api.github.com/users/jeantessier/following{/other_user}","gists_url":"https://api.github.com/users/jeantessier/gists{/gist_id}","starred_url":"https://api.github.com/users/jeantessier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeantessier/subscriptions","organizations_url":"https://api.github.com/users/jeantessier/orgs","repos_url":"https://api.github.com/users/jeantessier/repos","events_url":"https://api.github.com/users/jeantessier/events{/privacy}","received_events_url":"https://api.github.com/users/jeantessier/received_events","type":"User","site_admin":false},"assignees":[{"login":"jeantessier","id":122590,"avatar_url":"https://avatars.githubusercontent.com/u/122590?v=3","gravatar_id":"","url":"https://api.github.com/users/jeantessier","html_url":"https://github.com/jeantessier","followers_url":"https://api.github.com/users/jeantessier/followers","following_url":"https://api.github.com/users/jeantessier/following{/other_user}","gists_url":"https://api.github.com/users/jeantessier/gists{/gist_id}","starred_url":"https://api.github.com/users/jeantessier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeantessier/subscriptions","organizations_url":"https://api.github.com/users/jeantessier/orgs","repos_url":"https://api.github.com/users/jeantessier/repos","events_url":"https://api.github.com/users/jeantessier/events{/privacy}","received_events_url":"https://api.github.com/users/jeantessier/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-08-10T09:17:56Z","updated_at":"2016-08-10T18:22:47Z","closed_at":null,"body":"The following exceptions occurs when trying to extract `lucene-core-6.1.0.jar` .\r\n\r\nTo reproduce : \r\n- Download `lucene-6.1.0.zip` from http://apache.crihan.fr/dist/lucene/java/6.1.0/ \r\n- Unzip jar `lucene-6.1.0\\core\\lucene-core-6.1.0.jar` in the archive\r\n- Start dependency extraction on this jar\r\n\r\nTested with both DependencyFinder-1.2.1-beta4 build and current master branch as of today.\r\n\r\n```\r\nException in thread \"main\" java.lang.IndexOutOfBoundsException: Index: 2925, Size: 78\r\n        at java.util.ArrayList.rangeCheck(ArrayList.java:635)\r\n        at java.util.ArrayList.get(ArrayList.java:411)\r\n        at com.jeantessier.classreader.impl.Classfile.getRawClass(Classfile.java:200)\r\n        at com.jeantessier.classreader.impl.Classfile.getClassName(Classfile.java:204)\r\n        at com.jeantessier.classreader.impl.Classfile.<init>(Classfile.java:104)\r\n        at com.jeantessier.classreader.impl.Classfile.<init>(Classfile.java:74)\r\n        at com.jeantessier.classreader.impl.DefaultClassfileFactory.create(DefaultClassfileFactory.java:41)\r\n        at com.jeantessier.classreader.impl.DefaultClassfileFactory.create(DefaultClassfileFactory.java:39)\r\n        at com.jeantessier.classreader.TransientClassfileLoader.load(TransientClassfileLoader.java:70)\r\n        at com.jeantessier.classreader.ClassfileLoaderEventSource.load(ClassfileLoaderEventSource.java:133)\r\n        at com.jeantessier.classreader.ZipClassfileLoader.load(ZipClassfileLoader.java:127)\r\n        at com.jeantessier.classreader.JarClassfileLoader.load(JarClassfileLoader.java:53)\r\n        at com.jeantessier.classreader.ClassfileLoaderEventSource.load(ClassfileLoaderEventSource.java:93)\r\n        at com.jeantessier.classreader.ClassfileLoader.load(ClassfileLoader.java:55)\r\n        at com.jeantessier.dependencyfinder.cli.DependencyExtractor.doProcessing(DependencyExtractor.java:74)\r\n        at com.jeantessier.dependencyfinder.cli.Command.process(Command.java:187)\r\n        at com.jeantessier.dependencyfinder.cli.Command.run(Command.java:109)\r\n        at com.jeantessier.dependencyfinder.cli.DependencyExtractor.main(DependencyExtractor.java:101)\r\n```\r\n\r\nThe culprit class appears to be Lucene54DocValuesConsumer.class whose source is here : \r\nhttps://github.com/apache/lucene-solr/blob/releases/lucene-solr/6.1.0/lucene/core/src/java/org/apache/lucene/codecs/lucene54/Lucene54DocValuesConsumer.java\r\n\r\nNot being very familiar with the project, I could not quickly find an explanation nor a fix.  \r\n\r\nI suspect an issue with the lucene jar / class / source because Java Decompiler 1.4 ( https://github.com/java-decompiler/jd-gui) also fails to open the same class with a `// INTERNAL ERROR //` message.\r\nI have also entered an issue on the JD project : \r\nhttps://github.com/java-decompiler/jd-gui/issues/140\r\n\r\nCould it be related to this code and the corresponding byte code ?\r\nhttps://github.com/apache/lucene-solr/blob/releases/lucene-solr/6.1.0/lucene/core/src/java/org/apache/lucene/codecs/lucene54/Lucene54DocValuesConsumer.java#L703\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jeantessier/dependency-finder/issues/comments/238957281","html_url":"https://github.com/jeantessier/dependency-finder/issues/2#issuecomment-238957281","issue_url":"https://api.github.com/repos/jeantessier/dependency-finder/issues/2","id":238957281,"user":{"login":"jeantessier","id":122590,"avatar_url":"https://avatars.githubusercontent.com/u/122590?v=3","gravatar_id":"","url":"https://api.github.com/users/jeantessier","html_url":"https://github.com/jeantessier","followers_url":"https://api.github.com/users/jeantessier/followers","following_url":"https://api.github.com/users/jeantessier/following{/other_user}","gists_url":"https://api.github.com/users/jeantessier/gists{/gist_id}","starred_url":"https://api.github.com/users/jeantessier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeantessier/subscriptions","organizations_url":"https://api.github.com/users/jeantessier/orgs","repos_url":"https://api.github.com/users/jeantessier/repos","events_url":"https://api.github.com/users/jeantessier/events{/privacy}","received_events_url":"https://api.github.com/users/jeantessier/received_events","type":"User","site_admin":false},"created_at":"2016-08-10T18:22:47Z","updated_at":"2016-08-10T18:22:47Z","body":"Here's what I've found so far.  I used `ClassReader` on each `.class` file in `lucene-core-6.1.0.jar` to figure out which ones were giving out parsing errors.  I found three:\r\n\r\n* `org/apache/lucene/codecs/lucene54/Lucene54DocValuesConsumer$1.class`\r\n* `org/apache/lucene/codecs/lucene54/Lucene54DocValuesConsumer$2.class`\r\n* `org/apache/lucene/util/AttributeImpl.class`\r\n\r\nI turned on super-verbose mode by tweaking `log4j.properties` in my Dependency Finder installation to add `log4j.logger.com.jeantessier.classreader=DEBUG` and I ran `ClassReader` on `AttributeImpl.class` again:\r\n\r\n    ClassReader \\\r\n        -verbose AttributeImpl.out.txt \\\r\n        org/apache/lucene/util/AttributeImpl.class\r\n\r\nThe output shows the major version is 52, which means the class was compiled J2SE 8 (see [this stackoverflow](http://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0)).\r\n\r\nI have not looked at changes to the classfile format in Java 8.  After reading the minor and major version numbers from the classfile, the next thing is supposed to be the constant pool.  The verbose output from `ClassReader` shows a number of \"Unknown Tag\" as it's trying to read the constant pool, so I'm thinking there might have been a change in the classfile format that is tripping my parser.\r\n\r\nNext step will be to research changes to the classfile format, but that'll have to wait until tonight.\r\n"}}
{"actor":{"display_login":"jeantessier"}}