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
ITypeBinding b1= f1.resolveBinding().getType();
				assertNotNull(b1);
				ITypeBinding b2= f2.resolveBinding().getType();
				assertNotNull(b2);
				
				
				if (b1.isParameterizedType() || b1.isWildcardType() || b1.isTypeVariable())
					continue;
				if (b2.isParameterizedType() || b2.isWildcardType() || b2.isTypeVariable())
					continue;
				if (b1.isRawType() != b2.isRawType())
					continue;
				
				if (b1.isPrimitive() != b2.isPrimitive())
					continue;
				CompilationUnit astRoot= null;
				astRoot= (CompilationUnit) parser.createAST(null);
				IProblem[] problems= astRoot.getProblems();
				boolean res= TypeRules.canCast(b2, b1);
				if (res != (problems.length == 0)) {
					errors.append(line).append('\n');
				}
			}	
		}
		assertTrue(errors.toString(), errors.length() == 0);
	}
		
	
}