Community
Participate
Working Groups
On the night of 8/15/2005 we hit this npe during BEA internal tests: java.lang.NullPointerException [java] at org.eclipse.jdt.internal.compiler.classfmt.ClassFileStruct.u2At(ClassFileStruct.java:71) [java] at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:117) [java] at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:94) [java] at org.eclipse.jdt.internal.core.search.indexing.BinaryIndexer.indexDocument(BinaryIndexer.java:443) [java] at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.indexDocument(JavaSearchParticipant.java:74) [java] at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexDocument(IndexManager.java:290) [java] at org.eclipse.jdt.internal.core.search.indexing.IndexManager$1.execute(IndexManager.java:601) [java] at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:372) [java] at java.lang.Thread.run()V(Unknown Source)
Would you have steps to reproduce? This would mean that the byte array is null.
No, sorry, I don't have repro steps. Seems to have just come out of the blue.
This can potentially happen if the binary contents cannot be retrieved for a document. byte[] contents = this.document.getByteContents(); can return null if a IOException occurs while retrieving the contents. So the binary indexer should be protected against this. I will add a null check. If you get it repeatedly, then it could be interesting to run in debug mode and enable the following options: # Reports background indexer activity: indexing, saving index file, index queries org.eclipse.jdt.core/debug/indexmanager=true # Reports background indexer activity: indexing, saving index file, index queries org.eclipse.jdt.core/debug/indexmanager=true in the .options file of the JDT/Core plugin. Then put this file in the same directory than the eclipse.exe that you are using. and restart with -debug on the Eclipse command line.
Fixed and released in HEAD. No regression tests added as this could only happen if a IOException occurs while retrieving the contents of a search document.
Verified using I20050920-0010 for 3.2M2