Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 514175

Summary: Indexing fails with ClassFormatException
Product: [Eclipse Project] JDT Reporter: Gorkem Ercan <gorkem.ercan>
Component: CoreAssignee: Stefan Xenos <sxenos>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: fbricon, jarthana, manoj.palat, sxenos
Version: 4.7   
Target Milestone: 4.7 M7   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Gorkem Ercan CLA 2017-03-24 09:01:23 EDT
Error when application references icu4j-2.6.1.jar. Appears to be attempting to index file named "LocaleElements_zh__PINYIN" which is not a class file. This happens on org.eclipse.jdt.core_3.13.0.v20170125-0115 build. 

[Error - 6:28:33 PM] 24/03/2017 6:25:00 PM Unable to index C:/Users/twlrlm/.m2/repository/com/ibm/icu/icu4j/2.6.1/icu4j-2.6.1.jar|Lcom/ibm/icu/impl/data/LocaleElements_zh__PINYIN;
null
org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException
at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.(ClassFileReader.java:406)
at org.eclipse.jdt.internal.core.nd.indexer.Indexer.addElement(Indexer.java:677)
at org.eclipse.jdt.internal.core.nd.indexer.Indexer.rescanArchive(Indexer.java:541)
at org.eclipse.jdt.internal.core.nd.indexer.Indexer.rescan(Indexer.java:231)
at org.eclipse.jdt.internal.core.nd.indexer.Indexer.lambda$0(Indexer.java:115)
at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:182)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)


Original report to eclipse.jdt.ls is at https://github.com/redhat-developer/vscode-java/issues/170
Comment 1 Jay Arthanareeswaran CLA 2017-03-27 02:16:54 EDT
I think the issue something else. The said file is probably a class file but something is wrong with it. Unfortunately the ICU I downloaded doesn't have that file.

Can you please attach the particular JAR you have?
Comment 2 Gorkem Ercan CLA 2017-03-27 09:24:29 EDT
At least the one I got from Maven has the class file in question. https://mvnrepository.com/artifact/com.ibm.icu/icu4j/2.6.1
Comment 3 Jay Arthanareeswaran CLA 2017-03-28 00:10:39 EDT
(In reply to Gorkem Ercan from comment #2)
> At least the one I got from Maven has the class file in question.
> https://mvnrepository.com/artifact/com.ibm.icu/icu4j/2.6.1

Hmm.. I tried that too. But I find no file named LocaleElements_zh__PINYIN. However, I do find one by name /com/ibm/icu/impl/data/CollationElements_zh__PINYIN.col.

Stefan/Manoj, any thoughts on what might be going on?
Comment 4 Fred Bricon CLA 2017-03-28 11:09:03 EDT
This is similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=197733
Comment 5 Stefan Xenos CLA 2017-03-28 13:00:32 EDT
It could just be a corrupt .jar file, but we should ensure that the indexer is recording the corruption and continuing with indexing correctly.

We should also investigate why the indexer was attempting to open that file to begin with.

It seems weird that the class file contained a ".col" suffix. Are periods even allowed in binary class names?
Comment 6 Jay Arthanareeswaran CLA 2017-04-03 00:09:12 EDT
Fred is right, this is same as bug 197733.

*** This bug has been marked as a duplicate of bug 197733 ***