Community
Participate
Working Groups
Sidecar 2003-10-23 IBuild 2003-10-23 ZRH build input 10/28 1) follow the JDT UI smoke test up to "Editing" section 2) When using the actions "shift left" and "shift right", I got the following exception in the console: java.lang.ClassCastException: org/eclipse/jdt/internal/core/LocalVariable incomp atible with org/eclipse/jdt/core/IMember at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at java.lang.ClassCastException.<init>(ClassCastException.java:53) at org.eclipse.jdt.internal.core.util.HandleFactory$1$Visitor.visit(Hand leFactory.java:167) at org.eclipse.jdt.internal.compiler.ast.AnonymousLocalTypeDeclaration.t raverse(AnonymousLocalTypeDeclaration.java:139) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.t raverse(QualifiedAllocationExpression.java:342) at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.traverse(Local Declaration.java:224) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse(Meth odDeclaration.java:160) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDe claration.java:949) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.trav erse(CompilationUnitDeclaration.java:305) at org.eclipse.jdt.internal.core.util.HandleFactory.createElement(Handle Factory.java:296) at org.eclipse.jdt.internal.core.SelectionRequestor.acceptLocalMethod(Se lectionRequestor.java:149) at org.eclipse.jdt.internal.codeassist.SelectionEngine.selectFrom(Select ionEngine.java:607) at org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionE ngine.java:520) at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:169) at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationU nit.java:269) at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationU nit.java:263) at org.eclipse.jdt.internal.ui.text.java.hover.AbstractJavaEditorTextHov er.getHoverInfo(AbstractJavaEditorTextHover.java:95) at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverIn fo(BestMatchHover.java:140) at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy. getHoverInfo(JavaEditorTextHoverProxy.java:69) at org.eclipse.jface.text.TextViewerHoverManager$2.run(TextViewerHoverMa nager.java) The exact selection I had was this: Protectable p= new Protectable() { public void protect() throws Throwable { test.runBare(); } }; in the method protected void run(final TestCase test) (in TestResult.java).
This seems to be a JDT/Core problem.
Please provide a description of the JDT UI smoke test.
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-ui-home/smoke-test/smoke.html
Suspecting some releng build issue or classloader problem. Olivier: Can you check whether the jdtcore.jar contained the correct LocalVariable type ? Can it be reproduced on a different VM ?
I will investigate.
To reproduce: 1. Create the following cu: public class X { void foo() { Object o = new Object() { void bar() { } }; } } 2. Select ;bar' 3. F3 Observe: You get the above stack trace
Fixed by setting the local variable element in HandleFactory$Visitor only if the node is found. Added regression test ResolveTests.testMethodDeclarationInAnonymous()
Verified.