Community
Participate
Working Groups
I'm running Eclipse 3.2RC3 on the Apple JVM 1.5.0_06. On typing in a JDT editor, everytime context assist comes up, an error in a dialog window is raised, saying "An internal error occurred while "Computing additional info"". The workbench log contains this stacktrace: !ENTRY org.eclipse.core.jobs 4 2 2006-05-09 09:57:25.969 !MESSAGE An internal error occurred during: "Computing additional info". !STACK 0 java.lang.IllegalStateException: zip file closed at java.util.zip.ZipFile.ensureOpen(ZipFile.java:518) at java.util.zip.ZipFile.getEntry(ZipFile.java:251) at java.util.jar.JarFile.getEntry(JarFile.java:200) at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90) at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112) at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:69) at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:792) at org.eclipse.jdt.internal.core.BinaryType.getJavadocContents(BinaryType.java:1086) at org.eclipse.jdt.internal.core.BinaryMethod.getAttachedJavadoc(BinaryMethod.java:531) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.getHTMLContentReader(ProposalInfo.java:112) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.extractJavadoc(ProposalInfo.java:99) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.computeInfo(ProposalInfo.java:76) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.getInfo(ProposalInfo.java:59) at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.getAdditionalProposalInfo(AbstractJavaCompletionProposal.java:458) at org.eclipse.jface.text.contentassist.AdditionalInfoController$3.run(AdditionalInfoController.java:100) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) (END) It happens in a reproducable fashion every time I access documentation for something in the JDK class library. I've set the JavaDoc location for that to a zipfile on my hard drive, which is existent and readable and the corresponding dialog says it's ok when I click "Validate". If I unzip the files from the documentation and point Eclipse to that, the error vanishes.
Should be investigated for RC4.
In the worse case, we should throw a JME not an IllegalStateException.
The failure occurs when trying to close the jarFile from the JarURLConnection. On Windows or Linux, the file is not closed when the stream is closed. I could add a catch for runtime exception or IllegalStateException around this call to silently eat this exception since we simply want to be sure that the file handle is released.
Created attachment 40781 [details] Proposed fix
+1 to add this workaround for RC4 - the patch is of very low riks.
+1 for 3.2RC4. Martin - pls cast your vote
Well, I'm certainly for fixing the problem, but I don't have a working Eclipse build system around (I tried, but it apparently didn't like me...) so I cannot test the patch. Fix sounds good though :-)
+ 1 for 3.2 RC4. patch looks good.
Fixed and released in HEAD. No regression test available since this is MacOS specific. To verify, simply check that the IllegalStateException are handled in the source code.
Verified with I20060511-2000 for 3.2RC4
(In reply to comment #10) > Verified with I20060511-2000 for 3.2RC4 This bug appears in 3.2RC7. It is appearing when attempting to get the JavaDoc via the JavaDoc view or hover in the Java Editor. The related JAR file has the JavaDoc in the JAR and is configured using the JavaDoc Location specified against the JAR with a local file system path and the archive specific (doc) folder. The location passes validation. The JavaDoc for the related JAR appears the first time it is accessed, and the exception it throw thereafter. java.lang.IllegalStateException: zip file closed at java.util.zip.ZipFile.ensureOpen(ZipFile.java:398) at java.util.zip.ZipFile.getEntry(ZipFile.java:145) at java.util.jar.JarFile.getEntry(JarFile.java:194) at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:89) at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:95) at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:107) at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:734) at org.eclipse.jdt.internal.core.BinaryType.getJavadocContents(BinaryType.java:1086) at org.eclipse.jdt.internal.core.BinaryType.getAttachedJavadoc(BinaryType.java:998) at org.eclipse.jdt.ui.JavadocContentAccess.getHTMLContentReader(JavadocContentAccess.java:120) at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:153) at org.eclipse.jdt.internal.ui.text.java.hover.AbstractJavaEditorTextHover.getHoverInfo(AbstractJavaEditorTextHover.java:121) at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo(BestMatchHover.java:102) at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo(JavaEditorTextHoverProxy.java:69) at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:160)
This is a different issue.
I opened bug 147771. Could you please add yourself on the cc list and confirm that you are on MacOS? Thanks.