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 106796 Details for
Bug 239229
[compiler] Regression bug against Eclipse 3.3: cannot resolve correct import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Better patch for 3.4.x
239229-34x.txt (text/plain), 11.81 KB, created by
Philipe Mulet
on 2008-07-08 05:40:50 EDT
(
hide
)
Description:
Better patch for 3.4.x
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2008-07-08 05:40:50 EDT
Size:
11.81 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java,v >retrieving revision 1.44 >diff -u -r1.44 PackageBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java 27 May 2008 22:21:12 -0000 1.44 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java 8 Jul 2008 09:39:59 -0000 >@@ -165,16 +165,18 @@ > public Binding getTypeOrPackage(char[] name) { > ReferenceBinding typeBinding = getType0(name); > if (typeBinding != null && typeBinding != LookupEnvironment.TheNotFoundType) { >- typeBinding = BinaryTypeBinding.resolveType(typeBinding, environment, false); // no raw conversion for now >- if (typeBinding.isNestedType()) >- return new ProblemReferenceBinding(new char[][]{name}, typeBinding, ProblemReasons.InternalNameProvided); >- return typeBinding; >+ if ((typeBinding.tagBits & TagBits.HasMissingType) == 0) { >+ typeBinding = BinaryTypeBinding.resolveType(typeBinding, environment, false); // no raw conversion for now >+ if (typeBinding.isNestedType()) >+ return new ProblemReferenceBinding(new char[][]{name}, typeBinding, ProblemReasons.InternalNameProvided); >+ return typeBinding; >+ } > } > > PackageBinding packageBinding = getPackage0(name); >- if (packageBinding != null && packageBinding != LookupEnvironment.TheNotFoundPackage) >+ if (packageBinding != null && packageBinding != LookupEnvironment.TheNotFoundPackage) { > return packageBinding; >- >+ } > if (typeBinding == null) { // have not looked for it before > if ((typeBinding = environment.askForType(this, name)) != null) { > if (typeBinding.isNestedType()) >@@ -190,6 +192,9 @@ > if (packageBinding == null) { // have not looked for it before > if ((packageBinding = findPackage(name)) != null) > return packageBinding; >+ if (typeBinding != null) { >+ return typeBinding; // found cached missing type - check if package conflict >+ } > addNotFoundPackage(name); > } > >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java,v >retrieving revision 1.8.2.1 >diff -u -r1.8.2.1 ProblemTypeAndMethodTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java 7 Jul 2008 15:43:13 -0000 1.8.2.1 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java 8 Jul 2008 09:40:00 -0000 >@@ -3797,7 +3797,7 @@ > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 >-public void _test081() { >+public void test081() { > if (this.complianceLevel <= ClassFileConstants.JDK1_4) return; > Map customOptions = getCompilerOptions(); > customOptions.put( CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED); >@@ -3868,6 +3868,11 @@ > " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + > "The serializable class FilterConstraintSpecification does not declare a static final serialVersionUID field of type long\n" + > "----------\n" + >+ "2. WARNING in com\\ost\\util\\report\\FilterConstraintSpecification.java (at line 5)\n" + >+ " private final void makeConstraint(){\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "The method makeConstraint() from the type FilterConstraintSpecification is never used locally\n" + >+ "----------\n" + > "----------\n" + > "1. WARNING in com\\ost\\util\\report\\exceptions\\MalformedFilterConstraintSpecification.java (at line 2)\n" + > " public class MalformedFilterConstraintSpecification extends RuntimeException {\n" + >@@ -3884,5 +3889,232 @@ > false, > customOptions); > } >- >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 - variation >+public void test082() { >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) return; >+ this.runConformTest( >+ new String[] { >+ "com/ost/util/report/Matrix.java", // ================= >+ "package com.ost.util.report;\n" + >+ "import java.io.Serializable;\n" + >+ "import com.ost.util.report.exceptions.InvalidRowSizeException;\n" + >+ "public class Matrix<T> implements Serializable {\n" + >+ " /**\n" + >+ " * @see exceptions.InvalidRowSizeException2\n" + >+ " */\n" + >+ " public synchronized final void addRow(Object[] row){\n" + >+ " throw new InvalidRowSizeException();\n" + >+ " }\n" + >+ "}\n", >+ "com/ost/util/report/FilterConstraintSpecification.java", // ================= >+ "package com.ost.util.report;\n" + >+ "import java.io.Serializable;\n" + >+ "import com.ost.util.report.exceptions.MalformedFilterConstraintSpecification;\n" + >+ "public final class FilterConstraintSpecification implements Serializable, Cloneable {\n" + >+ " private final void makeConstraint(){\n" + >+ " throw new MalformedFilterConstraintSpecification();\n" + >+ " }\n" + >+ "}\n", >+ "com/ost/util/report/exceptions/MalformedFilterConstraintSpecification.java", // ================= >+ "package com.ost.util.report.exceptions;\n" + >+ "public class MalformedFilterConstraintSpecification extends RuntimeException {\n" + >+ " /** Creates a new instance of MalformedFilterConstraintSpecification */\n" + >+ " public MalformedFilterConstraintSpecification() {\n" + >+ " super();\n" + >+ " }\n" + >+ " /* Creates a new instance of MalformedFilterConstraintSpecification */\n" + >+ " public MalformedFilterConstraintSpecification(String message) {\n" + >+ " super(message);\n" + >+ " }\n" + >+ "}\n", >+ "com/ost/util/report/exceptions/InvalidRowSizeException.java", // ================= >+ "package com.ost.util.report.exceptions;\n" + >+ "public class InvalidRowSizeException extends RuntimeException {\n" + >+ " /** Creates a new instance of InvalidRowSizeException */\n" + >+ " public InvalidRowSizeException() {\n" + >+ " super();\n" + >+ " }\n" + >+ " /* Creates a new instance of InvalidRowSizeException */\n" + >+ " public InvalidRowSizeException(String message) {\n" + >+ " super(message);\n" + >+ " }\n" + >+ "}\n" >+ }, >+ ""); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 - variation >+public void test083() { >+ this.runConformTest( >+ new String[] { >+ "foo/X.java", // ================= >+ "package foo;\n" + >+ "import foo.exceptions.*;\n" + >+ "public class X {\n" + >+ " class exceptions {}\n" + >+ " exceptions E;\n" + >+ "}\n", >+ "foo/exceptions/Z.java", // ================= >+ "package foo.exceptions;\n" + >+ "public class Z {\n" + >+ "}\n" >+ }, >+ ""); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 - variation >+public void test084() { >+ this.runNegativeTest( >+ new String[] { >+ "foo/X.java", // ================= >+ "package foo;\n" + >+ "import foo.exceptions.*;\n" + >+ "public class X {\n" + >+ " exceptions E;\n" + >+ "}\n" + >+ "class exceptions {}\n", >+ "foo/exceptions/Z.java", // ================= >+ "package foo.exceptions;\n" + >+ "public class Z {\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. WARNING in foo\\X.java (at line 2)\n" + >+ " import foo.exceptions.*;\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "The import foo.exceptions is never used\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in foo\\exceptions\\Z.java (at line 1)\n" + >+ " package foo.exceptions;\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "The package foo.exceptions collides with a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 - variation >+public void test085() { >+ this.runNegativeTest( >+ new String[] { >+ "p/X.java", // ================= >+ "package p;\n" + >+ "public class X extends zork.Z {\n" + >+ "}\n", >+ "p/Y.java", // ================= >+ "package p;\n" + >+ "import p.zork.Z;\n" + >+ "public class Y {\n" + >+ "}\n", >+ "p/zork/Z.java", // ================= >+ "package p.zork;\n" + >+ "public class Z {\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in p\\X.java (at line 2)\n" + >+ " public class X extends zork.Z {\n" + >+ " ^^^^\n" + >+ "zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. WARNING in p\\Y.java (at line 2)\n" + >+ " import p.zork.Z;\n" + >+ " ^^^^^^^^\n" + >+ "The import p.zork.Z is never used\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 - variation >+public void test086() { >+ this.runNegativeTest( >+ new String[] { >+ "p/X.java", // ================= >+ "package p;\n" + >+ "public class X extends zork.Z {\n" + >+ "}\n", >+ "p/Y.java", // ================= >+ "package p;\n" + >+ "import p.zork.*;\n" + >+ "public class Y {\n" + >+ "}\n", >+ "p/zork/Z.java", // ================= >+ "package p.zork;\n" + >+ "public class Z {\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in p\\X.java (at line 2)\n" + >+ " public class X extends zork.Z {\n" + >+ " ^^^^\n" + >+ "zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. WARNING in p\\Y.java (at line 2)\n" + >+ " import p.zork.*;\n" + >+ " ^^^^^^\n" + >+ "The import p.zork is never used\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 - variation >+public void test087() { >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) return; >+ this.runNegativeTest( >+ new String[] { >+ "p/X.java", // ================= >+ "package p;\n" + >+ "public class X extends zork.Z {\n" + >+ "}\n", >+ "p/Y.java", // ================= >+ "package p;\n" + >+ "import static p.zork.Z.M;\n" + >+ "public class Y {\n" + >+ "}\n", >+ "p/zork/Z.java", // ================= >+ "package p.zork;\n" + >+ "public class Z {\n" + >+ " public static class M {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in p\\X.java (at line 2)\n" + >+ " public class X extends zork.Z {\n" + >+ " ^^^^\n" + >+ "zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. WARNING in p\\Y.java (at line 2)\n" + >+ " import static p.zork.Z.M;\n" + >+ " ^^^^^^^^^^\n" + >+ "The import p.zork.Z.M is never used\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758 - variation >+public void test088() { >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) return; >+ this.runNegativeTest( >+ new String[] { >+ "p/X.java", // ================= >+ "package p;\n" + >+ "public class X extends zork.Z {\n" + >+ "}\n", >+ "p/Y.java", // ================= >+ "package p;\n" + >+ "import static p.zork.Z.*;\n" + >+ "public class Y {\n" + >+ "}\n", >+ "p/zork/Z.java", // ================= >+ "package p.zork;\n" + >+ "public class Z {\n" + >+ " static class M {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in p\\X.java (at line 2)\n" + >+ " public class X extends zork.Z {\n" + >+ " ^^^^\n" + >+ "zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. WARNING in p\\Y.java (at line 2)\n" + >+ " import static p.zork.Z.*;\n" + >+ " ^^^^^^^^\n" + >+ "The import p.zork.Z is never used\n" + >+ "----------\n"); >+} > }
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 239229
:
106408
|
106735
|
106736
|
106796
|
106802
|
106810