Bug 118897 ASTParser resolves bindings without request
I20051130-1215 ASTParser resolves bindings without request when certain conditions hold, although setResolveBindings(true) has not been called. The following extract from internalCreateAST(IProgressMonitor) looks suspicios: if (this.rawSource != null) { needToResolveBindings = this.unitName != null && this.project != null && this.compilerOptions != null; ... I would not expect to get bindings unless I explicitly requested them. This can be a serious performance hit for clients that only need lightweight ASTs.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TypeRulesTest.java
String castType= f2.resolveBinding().getType().getQualifiedName();
				String line= castType + " x= (" + castType + ") " + f1.getName().getIdentifier();
				
				StringBuffer buf= new StringBuffer();
				buf.append("package test1;\n");
				buf.append("public class F<T, U extends Number> extends E<T, U> {\n");
				buf.append("    void foo() {\n");
				buf.append("        ").append(line).append(";\n");
				buf.append("    }\n");
				buf.append("}\n");
				char[] content= buf.toString().toCharArray();
				
				ASTParser parser= ASTParser.newParser(AST.JLS3);
				parser.setSource(content);
				parser.setResolveBindings(true);
				parser.setProject(fJProject1);
				parser.setUnitName("F.java");
				
				CompilationUnit astRoot= null;
				astRoot= (CompilationUnit) parser.createAST(null);
				IProblem[] problems= astRoot.getProblems();
				ITypeBinding b1= f1.resolveBinding().getType();
				assertNotNull(b1);
				ITypeBinding b2= f2.resolveBinding().getType();
				assertNotNull(b2);
				boolean res= b2.isCastCompatible(b1);
				if (res != (problems.length == 0)) {
					errors.append(line).append('\n');
				}
			}