View | Details | Raw Unified | Return to bug 258905 | Differences between
and this patch

Collapse All | Expand All

(-)dom/org/eclipse/jdt/core/dom/AST.java (+1 lines)
Lines 1132-1137 Link Here
1132
	 * <li><code>"long"</code></li>
1132
	 * <li><code>"long"</code></li>
1133
	 * <li><code>"short"</code></li>
1133
	 * <li><code>"short"</code></li>
1134
	 * <li><code>"void"</code></li>
1134
	 * <li><code>"void"</code></li>
1135
	 * <li><code>"java.lang.AssertionError"</code> (since 3.7)</li>
1135
	 * <li><code>"java.lang.Boolean"</code> (since 3.1)</li>
1136
	 * <li><code>"java.lang.Boolean"</code> (since 3.1)</li>
1136
	 * <li><code>"java.lang.Byte"</code> (since 3.1)</li>
1137
	 * <li><code>"java.lang.Byte"</code> (since 3.1)</li>
1137
	 * <li><code>"java.lang.Character"</code> (since 3.1)</li>
1138
	 * <li><code>"java.lang.Character"</code> (since 3.1)</li>
(-)dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java (+2 lines)
Lines 1718-1723 Link Here
1718
				typeBinding = this.getTypeBinding(this.scope.getType(TypeConstants.JAVA_LANG_SHORT, 3));
1718
				typeBinding = this.getTypeBinding(this.scope.getType(TypeConstants.JAVA_LANG_SHORT, 3));
1719
			} else if ("java.lang.Void".equals(name)) {//$NON-NLS-1$
1719
			} else if ("java.lang.Void".equals(name)) {//$NON-NLS-1$
1720
				typeBinding = this.getTypeBinding(this.scope.getType(TypeConstants.JAVA_LANG_VOID, 3));
1720
				typeBinding = this.getTypeBinding(this.scope.getType(TypeConstants.JAVA_LANG_VOID, 3));
1721
			} else if ("java.lang.AssertionError".equals(name)) { //$NON-NLS-1$
1722
				typeBinding = this.getTypeBinding(this.scope.getType(TypeConstants.JAVA_LANG_ASSERTIONERROR, 3));
1721
			}
1723
			}
1722
		} catch (AbortCompilation e) {
1724
		} catch (AbortCompilation e) {
1723
			// ignore missing types
1725
			// ignore missing types
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java (-1 / +62 lines)
Lines 122-128 Link Here
122
	static {
122
	static {
123
//		TESTS_NAMES = new String[] {"test0602"};
123
//		TESTS_NAMES = new String[] {"test0602"};
124
//		TESTS_RANGE = new int[] { 713, -1 };
124
//		TESTS_RANGE = new int[] { 713, -1 };
125
//		TESTS_NUMBERS =  new int[] { 653 };
125
		TESTS_NUMBERS =  new int[] { 719 };
126
	}
126
	}
127
	public static Test suite() {
127
	public static Test suite() {
128
		return buildModelTestSuite(ASTConverterTestAST3_2.class);
128
		return buildModelTestSuite(ASTConverterTestAST3_2.class);
Lines 10497-10500 Link Here
10497
			}
10497
			}
10498
		}
10498
		}
10499
	}
10499
	}
10500
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258905
10501
	public void test0719() throws JavaModelException {
10502
		ICompilationUnit workingCopy = null;
10503
		try {
10504
			workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/);
10505
			String contents =
10506
				"public class X {}";
10507
	
10508
			CompilationUnit unit = (CompilationUnit) buildAST(
10509
					contents,
10510
					workingCopy,
10511
					true);
10512
			final AST currentAst = unit.getAST();
10513
			// well known bindings
10514
			String[] wkbs = {
10515
				"byte", "char", "short", "int", "long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
10516
				"boolean", "float", "double", "void", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
10517
				"java.lang.AssertionError", //$NON-NLS-1$
10518
				"java.lang.Class", //$NON-NLS-1$
10519
				"java.lang.Cloneable", //$NON-NLS-1$
10520
				"java.lang.Error", //$NON-NLS-1$
10521
				"java.lang.Exception", //$NON-NLS-1$
10522
				"java.lang.Object", //$NON-NLS-1$
10523
				"java.lang.RuntimeException", //$NON-NLS-1$
10524
				"java.lang.String", //$NON-NLS-1$
10525
				"java.lang.StringBuffer", //$NON-NLS-1$
10526
				"java.lang.Throwable", //$NON-NLS-1$
10527
				"java.io.Serializable", //$NON-NLS-1$
10528
				"java.lang.Boolean", //$NON-NLS-1$
10529
				"java.lang.Byte", //$NON-NLS-1$
10530
				"java.lang.Character", //$NON-NLS-1$
10531
				"java.lang.Double", //$NON-NLS-1$
10532
				"java.lang.Float", //$NON-NLS-1$
10533
				"java.lang.Integer", //$NON-NLS-1$
10534
				"java.lang.Long", //$NON-NLS-1$
10535
				"java.lang.Short", //$NON-NLS-1$
10536
				"java.lang.Void", //$NON-NLS-1$
10537
			};
10538
10539
			// no-so-well-known bindings
10540
			String[] nwkbs = {
10541
				"verylong", //$NON-NLS-1$
10542
				"java.lang.Math", //$NON-NLS-1$
10543
				"com.example.MyCode", //$NON-NLS-1$
10544
			};
10545
10546
			// none of the well known bindings resolve in a plain AST
10547
			for (int i = 0; i<wkbs.length; i++) {
10548
				assertNotNull("No binding for " + wkbs[i], currentAst.resolveWellKnownType(wkbs[i]));
10549
			}
10550
10551
			// none of the no so well known bindings resolve either
10552
			for (int i = 0; i<nwkbs.length; i++) {
10553
				assertNull("Binding for " + nwkbs[i], currentAst.resolveWellKnownType(nwkbs[i]));
10554
			}
10555
		} finally {
10556
			if (workingCopy != null) {
10557
				workingCopy.discardWorkingCopy();
10558
			}
10559
		}
10560
	}
10500
}
10561
}
(-)src/org/eclipse/jdt/core/tests/dom/ASTTest.java (+1 lines)
Lines 1337-1342 Link Here
1337
		String[] wkbs = {
1337
		String[] wkbs = {
1338
			"byte", "char", "short", "int", "long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
1338
			"byte", "char", "short", "int", "long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
1339
			"boolean", "float", "double", "void", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
1339
			"boolean", "float", "double", "void", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
1340
			"java.lang.AssertionError", //$NON-NLS-1$
1340
			"java.lang.Class", //$NON-NLS-1$
1341
			"java.lang.Class", //$NON-NLS-1$
1341
			"java.lang.Cloneable", //$NON-NLS-1$
1342
			"java.lang.Cloneable", //$NON-NLS-1$
1342
			"java.lang.Error", //$NON-NLS-1$
1343
			"java.lang.Error", //$NON-NLS-1$

Return to bug 258905