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

Collapse All | Expand All

(-)a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java (-1 / +33 lines)
Lines 37-43 Link Here
37
	super(name);
37
	super(name);
38
}
38
}
39
static {
39
static {
40
//	TESTS_NAMES = new String[] { "testAddExternalLibFolder6" };
40
//	TESTS_NAMES = new String[] { "testBug360164" };
41
}
41
}
42
public static Test suite() {
42
public static Test suite() {
43
	TestSuite suite = (TestSuite) buildModelTestSuite(JavaProjectTests.class);
43
	TestSuite suite = (TestSuite) buildModelTestSuite(JavaProjectTests.class);
Lines 2389-2392 Link Here
2389
		deleteProject("JavaProjectTestsInvalidProject");
2389
		deleteProject("JavaProjectTestsInvalidProject");
2390
	}
2390
	}
2391
}
2391
}
2392
// Bug 360164 - Compile error in XSDImpl
2393
// test that we can tolerate if a 1.4 project refers to an enum inside a library.
2394
public void testBug360164() throws IOException, CoreException {
2395
	String libPath = getWorkspacePath()+"JavaProjectTests/bin/bug360164.jar";
2396
	try {
2397
		this.createJavaProject("P", new String[] {"src"}, new String[] {"JCL_LIB", libPath}, "bin", JavaCore.VERSION_1_4);
2398
		IFile file = createFile("/P/src/X.java", 
2399
				"import p360164.Provider;\n" +
2400
				"import p360164.MyEnum;\n" +
2401
				"public class X {\n" +
2402
				"    int foo(Provider p) {\n" +
2403
				"        MyEnum e = p.getE();\n" +
2404
				"        switch (e) {\n" +
2405
				"        case ONE: return 1;\n" +
2406
				"        case TWO: return 2;\n" +
2407
				"        }\n" +
2408
				"        return 0;\n" +
2409
				"    }\n" +
2410
				"}"
2411
		);	
2412
		ICompilationUnit unit = (ICompilationUnit)JavaCore.create(file);
2413
		ProblemRequestor problemRequestor = new ProblemRequestor();
2414
		WorkingCopyOwner owner = newWorkingCopyOwner(problemRequestor);
2415
		unit.getWorkingCopy(owner, null);
2416
		assertProblems("Unexpected problems", 
2417
				"----------\n" + 
2418
				"----------\n", 
2419
				problemRequestor);
2420
	} finally {
2421
		this.deleteProject("P");
2422
	}
2423
}
2392
}
2424
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java (-2 / +8 lines)
Added Link Here
975
}
975
}
976
public boolean hasTypeBit(int bit) {
976
public boolean hasTypeBit(int bit) {
977
	// ensure hierarchy is resolved, which will propagate bits down to us
977
	// ensure hierarchy is resolved, which will propagate bits down to us
978
	superclass();
978
	boolean wasToleratingMissingTypeProcessingAnnotations = this.environment.mayTolerateMissingType;
979
	superInterfaces();
979
	this.environment.mayTolerateMissingType = true;
980
	try {
981
		superclass();
982
		superInterfaces();
983
	} finally {
984
		this.environment.mayTolerateMissingType = wasToleratingMissingTypeProcessingAnnotations;
985
	}
980
	return (this.typeBits & bit) != 0;
986
	return (this.typeBits & bit) != 0;
981
}
987
}
982
private void initializeTypeVariable(TypeVariableBinding variable, TypeVariableBinding[] existingVariables, SignatureWrapper wrapper, char[][][] missingTypeNames) {
988
private void initializeTypeVariable(TypeVariableBinding variable, TypeVariableBinding[] existingVariables, SignatureWrapper wrapper, char[][][] missingTypeNames) {
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java (+1 lines)
Lines 74-79 Link Here
74
	private ArrayList missingTypes;
74
	private ArrayList missingTypes;
75
	Set typesBeingConnected;
75
	Set typesBeingConnected;
76
	public boolean isProcessingAnnotations = false;
76
	public boolean isProcessingAnnotations = false;
77
	public boolean mayTolerateMissingType = false;
77
78
78
	final static int BUILD_FIELDS_AND_METHODS = 4;
79
	final static int BUILD_FIELDS_AND_METHODS = 4;
79
	final static int BUILD_TYPE_HIERARCHY = 1;
80
	final static int BUILD_TYPE_HIERARCHY = 1;
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java (-1 / +1 lines)
Lines 55-61 Link Here
55
		}
55
		}
56
		if (targetType == null || targetType == this) { // could not resolve any better, error was already reported against it
56
		if (targetType == null || targetType == this) { // could not resolve any better, error was already reported against it
57
			// report the missing class file first - only if not resolving a previously missing type
57
			// report the missing class file first - only if not resolving a previously missing type
58
			if ((this.tagBits & TagBits.HasMissingType) == 0) {
58
			if ((this.tagBits & TagBits.HasMissingType) == 0 && !environment.mayTolerateMissingType) {
59
				environment.problemReporter.isClassPathCorrect(
59
				environment.problemReporter.isClassPathCorrect(
60
					this.compoundName,
60
					this.compoundName,
61
					environment.unitBeingCompleted,
61
					environment.unitBeingCompleted,

Return to bug 360164