Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 204799 Details for
Bug 360164
Compile error in XSDImpl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
test & proposed fix
Bug_360164.patch (text/plain), 4.99 KB, created by
Stephan Herrmann
on 2011-10-08 08:55:55 EDT
(
hide
)
Description:
test & proposed fix
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2011-10-08 08:55:55 EDT
Size:
4.99 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java >index 6357803..250b66e 100644 >--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java >+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java >@@ -37,7 +37,7 @@ > super(name); > } > static { >-// TESTS_NAMES = new String[] { "testAddExternalLibFolder6" }; >+// TESTS_NAMES = new String[] { "testBug360164" }; > } > public static Test suite() { > TestSuite suite = (TestSuite) buildModelTestSuite(JavaProjectTests.class); >@@ -2389,4 +2389,36 @@ > deleteProject("JavaProjectTestsInvalidProject"); > } > } >+// Bug 360164 - Compile error in XSDImpl >+// test that we can tolerate if a 1.4 project refers to an enum inside a library. >+public void testBug360164() throws IOException, CoreException { >+ String libPath = getWorkspacePath()+"JavaProjectTests/bin/bug360164.jar"; >+ try { >+ this.createJavaProject("P", new String[] {"src"}, new String[] {"JCL_LIB", libPath}, "bin", JavaCore.VERSION_1_4); >+ IFile file = createFile("/P/src/X.java", >+ "import p360164.Provider;\n" + >+ "import p360164.MyEnum;\n" + >+ "public class X {\n" + >+ " int foo(Provider p) {\n" + >+ " MyEnum e = p.getE();\n" + >+ " switch (e) {\n" + >+ " case ONE: return 1;\n" + >+ " case TWO: return 2;\n" + >+ " }\n" + >+ " return 0;\n" + >+ " }\n" + >+ "}" >+ ); >+ ICompilationUnit unit = (ICompilationUnit)JavaCore.create(file); >+ ProblemRequestor problemRequestor = new ProblemRequestor(); >+ WorkingCopyOwner owner = newWorkingCopyOwner(problemRequestor); >+ unit.getWorkingCopy(owner, null); >+ assertProblems("Unexpected problems", >+ "----------\n" + >+ "----------\n", >+ problemRequestor); >+ } finally { >+ this.deleteProject("P"); >+ } >+} > } >diff --git a/org.eclipse.jdt.core.tests.model/workspace/JavaProjectTests/bin/bug360164.jar b/org.eclipse.jdt.core.tests.model/workspace/JavaProjectTests/bin/bug360164.jar >new file mode 100644 >index 0000000..134f3f6 >--- /dev/null >+++ b/org.eclipse.jdt.core.tests.model/workspace/JavaProjectTests/bin/bug360164.jar >Binary files differ >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java >index 74dd0eb..8a84619 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java >@@ -975,8 +975,14 @@ > } > public boolean hasTypeBit(int bit) { > // ensure hierarchy is resolved, which will propagate bits down to us >- superclass(); >- superInterfaces(); >+ boolean wasToleratingMissingTypeProcessingAnnotations = this.environment.mayTolerateMissingType; >+ this.environment.mayTolerateMissingType = true; >+ try { >+ superclass(); >+ superInterfaces(); >+ } finally { >+ this.environment.mayTolerateMissingType = wasToleratingMissingTypeProcessingAnnotations; >+ } > return (this.typeBits & bit) != 0; > } > private void initializeTypeVariable(TypeVariableBinding variable, TypeVariableBinding[] existingVariables, SignatureWrapper wrapper, char[][][] missingTypeNames) { >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java >index 84d3e74..2e7fe97 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java >@@ -74,6 +74,7 @@ > private ArrayList missingTypes; > Set typesBeingConnected; > public boolean isProcessingAnnotations = false; >+ public boolean mayTolerateMissingType = false; > > final static int BUILD_FIELDS_AND_METHODS = 4; > final static int BUILD_TYPE_HIERARCHY = 1; >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java >index 3038368..2da4984 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java >@@ -55,7 +55,7 @@ > } > if (targetType == null || targetType == this) { // could not resolve any better, error was already reported against it > // report the missing class file first - only if not resolving a previously missing type >- if ((this.tagBits & TagBits.HasMissingType) == 0) { >+ if ((this.tagBits & TagBits.HasMissingType) == 0 && !environment.mayTolerateMissingType) { > environment.problemReporter.isClassPathCorrect( > this.compoundName, > environment.unitBeingCompleted,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 360164
:
204725
|
204799
|
205181
|
205424
|
205590