Summary: | Internal compiler error | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Martin Börlin <borlin> | ||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | major | ||||||
Priority: | P3 | CC: | chris, kent_johnson, Olivier_Thomann | ||||
Version: | 3.1 | ||||||
Target Milestone: | 3.1 M6 | ||||||
Hardware: | PC | ||||||
OS: | Windows NT | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Martin Börlin
2005-03-09 08:35:50 EST
Could you please attach your project for further investigation? I'm afraid my project is confidential because of business reasons... :-( I investigated this problem further and pin pointed the lines of code Eclipse "didn't like". I have no idea why it didn't like them but I found a work around by changing a method argument type to another type. You can close this bug report as far as I'm concerned. Many thanks! No, we have a bug. Could you please try to isolate a test case that would reproduce this issue? I would really encourage you to spend a few minutes trying to isolate a testcase, if not the bug will remain. Are you using static imports in your code ? (In reply to comment #5) > Are you using static imports in your code ? Actually, I am. Or was... I don't have the code in front of me right now but I did do some static imports for a static enum from another class. I will try to see if I can reproduce this error by adding these static imports again tomorrow. Cheers -Martin I tried something like that, in vain... but maybe you can find a common pattern: import static p.ST.foo; public class X { foo bar; } package p; public class ST { static int foo; } Created attachment 18675 [details]
Test case
I reproduced the problem with a small test case.
Steps to reproduce:
1) Unzip the attachment on your disk
2) Create a project that points to the project you just extracted
3) Do a full build
4) This should work.
5) Add a space in Y.java and recompile.
You should end up with the following stack trace:
Exception in thread "Text Viewer Hover Presenter" java.lang.ClassCastException:
org.eclipse.jdt.internal.compiler.lookup.FieldBinding
at
org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2132)
at
org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:39)
at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:141)
at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:104)
at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1051)
at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperInterfaces(ClassScope.java:790)
at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:847)
at
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:243)
at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:249)
at
org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:713)
at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:140)
at
org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:300)
at
org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:294)
at
org.eclipse.jdt.internal.ui.text.java.hover.AbstractJavaEditorTextHover.getHoverInfo(AbstractJavaEditorTextHover.java:108)
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)
It is not exactly the same one, but I believe this is the same problem.
Glad you reproduced it olivier. Made a fix, Kent pls verify it. Added StaticImportTest#test028. Martin - if you take next nightly build, you should be able to prove it addresses your problem. fixed Glad to see you fixed this! *** Bug 87003 has been marked as a duplicate of this bug. *** Verified in I20050330-0500 |