Bug 61877 - ClassCastException in DefaultBindingResolver
Summary: ClassCastException in DefaultBindingResolver
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-12 07:45 EDT by David Audel CLA
Modified: 2004-05-18 13:25 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2004-05-12 07:45:05 EDT
build I20040511 + jdtcore head

add the following test to org.eclipse.jdt.core.tests.dom.ASTConverterTest

public void test0XXX() throws JavaModelException {
  ICompilationUnit sourceUnit =
    getCompilationUnit("Converter" , "src", "test0XXX", "Test.java");
  CompilationUnit result = (CompilationUnit)runConversion(sourceUnit, true);
		
  TypeDeclaration declaration = (TypeDeclaration)result.types().get(0);
  Block body = declaration.getMethods()[0].getBody();
  ExpressionStatement expr = (ExpressionStatement)body.statements().get(0);
  MethodInvocation invocation = (MethodInvocation) expr.getExpression();
  InfixExpression node = (InfixExpression)invocation.arguments().get(0);
  node.resolveTypeBinding();
}

Test.java
package test0XXX;

public class Test {
  void foo() {
    "aaa".equals("a" + "a" + "a");
  }
}

When you run the test an ClassCastException occur.

This bug cause a failure of a JDT/UI test
  org.eclipse.jdt.ui.tests.quickfix.AssistQuickFixTest#testInvertEquals21()
Comment 1 Olivier Thomann CLA 2004-05-12 10:00:37 EDT
Fixed and released in HEAD.
Regression test added.
Comment 2 David Audel CLA 2004-05-18 13:25:35 EDT
Verified for 3.0M9