### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: dom/org/eclipse/jdt/core/dom/AST.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java,v retrieving revision 1.166 diff -u -r1.166 AST.java --- dom/org/eclipse/jdt/core/dom/AST.java 21 Feb 2010 03:35:50 -0000 1.166 +++ dom/org/eclipse/jdt/core/dom/AST.java 31 Aug 2010 20:07:03 -0000 @@ -1132,6 +1132,7 @@ *
  • "long"
  • *
  • "short"
  • *
  • "void"
  • + *
  • "java.lang.AssertionError" (since 3.7)
  • *
  • "java.lang.Boolean" (since 3.1)
  • *
  • "java.lang.Byte" (since 3.1)
  • *
  • "java.lang.Character" (since 3.1)
  • Index: dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java,v retrieving revision 1.169 diff -u -r1.169 DefaultBindingResolver.java --- dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java 21 Feb 2010 03:35:51 -0000 1.169 +++ dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java 31 Aug 2010 20:07:03 -0000 @@ -1718,6 +1718,8 @@ typeBinding = this.getTypeBinding(this.scope.getType(TypeConstants.JAVA_LANG_SHORT, 3)); } else if ("java.lang.Void".equals(name)) {//$NON-NLS-1$ typeBinding = this.getTypeBinding(this.scope.getType(TypeConstants.JAVA_LANG_VOID, 3)); + } else if ("java.lang.AssertionError".equals(name)) { //$NON-NLS-1$ + typeBinding = this.getTypeBinding(this.scope.getType(TypeConstants.JAVA_LANG_ASSERTIONERROR, 3)); } } catch (AbortCompilation e) { // ignore missing types #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v retrieving revision 1.174 diff -u -r1.174 ASTConverterTestAST3_2.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 17 Mar 2010 16:10:01 -0000 1.174 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 31 Aug 2010 20:07:04 -0000 @@ -122,7 +122,7 @@ static { // TESTS_NAMES = new String[] {"test0602"}; // TESTS_RANGE = new int[] { 713, -1 }; -// TESTS_NUMBERS = new int[] { 653 }; + TESTS_NUMBERS = new int[] { 719 }; } public static Test suite() { return buildModelTestSuite(ASTConverterTestAST3_2.class); @@ -10497,4 +10497,65 @@ } } } + //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258905 + public void test0719() throws JavaModelException { + ICompilationUnit workingCopy = null; + try { + workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); + String contents = + "public class X {}"; + + CompilationUnit unit = (CompilationUnit) buildAST( + contents, + workingCopy, + true); + final AST currentAst = unit.getAST(); + // well known bindings + String[] wkbs = { + "byte", "char", "short", "int", "long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + "boolean", "float", "double", "void", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + "java.lang.AssertionError", //$NON-NLS-1$ + "java.lang.Class", //$NON-NLS-1$ + "java.lang.Cloneable", //$NON-NLS-1$ + "java.lang.Error", //$NON-NLS-1$ + "java.lang.Exception", //$NON-NLS-1$ + "java.lang.Object", //$NON-NLS-1$ + "java.lang.RuntimeException", //$NON-NLS-1$ + "java.lang.String", //$NON-NLS-1$ + "java.lang.StringBuffer", //$NON-NLS-1$ + "java.lang.Throwable", //$NON-NLS-1$ + "java.io.Serializable", //$NON-NLS-1$ + "java.lang.Boolean", //$NON-NLS-1$ + "java.lang.Byte", //$NON-NLS-1$ + "java.lang.Character", //$NON-NLS-1$ + "java.lang.Double", //$NON-NLS-1$ + "java.lang.Float", //$NON-NLS-1$ + "java.lang.Integer", //$NON-NLS-1$ + "java.lang.Long", //$NON-NLS-1$ + "java.lang.Short", //$NON-NLS-1$ + "java.lang.Void", //$NON-NLS-1$ + }; + + // no-so-well-known bindings + String[] nwkbs = { + "verylong", //$NON-NLS-1$ + "java.lang.Math", //$NON-NLS-1$ + "com.example.MyCode", //$NON-NLS-1$ + }; + + // none of the well known bindings resolve in a plain AST + for (int i = 0; i