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 124532 Details for
Bug 247206
[compiler] Deprecation problem on inherited return type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Take 2 : An alternate fix with tests
patch.txt (text/plain), 27.43 KB, created by
Srikanth Sankaran
on 2009-02-03 07:00:07 EST
(
hide
)
Description:
Take 2 : An alternate fix with tests
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2009-02-03 07:00:07 EST
Size:
27.43 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java,v >retrieving revision 1.37 >diff -u -r1.37 DeprecatedTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java 27 Jun 2008 16:04:44 -0000 1.37 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java 3 Feb 2009 11:54:50 -0000 >@@ -796,6 +796,298 @@ > // javac options > JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206 >+public void test020() { >+ Map customOptions = new HashMap(); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.IGNORE); >+ >+ this.runConformTest( >+ new String[] { >+ "test1/E.java", >+ "package test1;\n" + >+ "\n" + >+ "public class E implements I {\n" + >+ " public I2 foo() {\n" + >+ " return null;\n" + >+ " }\n" + >+ "}\n" + >+ "interface I {\n" + >+ " /** @deprecated */\n" + >+ " public I2 foo();\n" + >+ "}\n" + >+ "/** @deprecated */\n" + >+ "interface I2 {}", >+ }, >+ "", // expected output >+ null, >+ true, // flush previous output dir content >+ null, // special vm args >+ customOptions, // custom options >+ null); // custom requestor >+} >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206 >+public void test021() { >+ Map customOptions = new HashMap(); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.IGNORE); >+ >+ this.runConformTest( >+ new String[] { >+ "test1/E.java", >+ "package test1;\n" + >+ "\n" + >+ "public class E implements I {\n" + >+ " public I2 foo() {\n" + >+ " return null;\n" + >+ " }\n" + >+ "}\n" + >+ "interface I {\n" + >+ " /** @deprecated */\n" + >+ " public I2 foo();\n" + >+ "}\n", >+ "test1/I2.java", >+ "package test1;\n" + >+ "/** @deprecated */\n" + >+ "interface I2 {}", >+ }, >+ "", // expected output >+ null, >+ true, // flush previous output dir content >+ null, // special vm args >+ customOptions, // custom options >+ null); // custom requestor >+} >+ >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206, additional tests that verify that >+// deprecation messages originate from type parameters, bounds, arguments, return types, >+// local variables, exception specifications etc. Valid only for 1.5 and above >+public void test022() { >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) >+ return; >+ Map customOptions = new HashMap(); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.IGNORE); >+ >+ this.runNegativeTest( >+ // test directory preparation >+ true /* flush output directory */, >+ new String[] { >+ "test1/E.java", >+ "package test1;\n" + >+ "\n" + >+ "public class E implements I {\n" + >+ " public <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ " I2 p = null; \n" + >+ " return p;\n" + >+ " }\n" + >+ "}\n" + >+ "interface I {\n" + >+ " /** @deprecated */\n" + >+ " public <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception;\n" + >+ "}\n", >+ "test1/I2.java", >+ "package test1;\n" + >+ "/** @deprecated */\n" + >+ "interface I2 { /** @deprecated */ interface I3 {} }\n" + >+ "/** @deprecated */\n" + >+ "class Xception extends Throwable {\n" + >+ " private static final long serialVersionUID = 1L;\n}\n", >+ }, >+ // compiler options >+ null /* no class libraries */, >+ customOptions /* custom options */, >+ "----------\n" + // expected output >+ "1. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "2. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^^^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "3. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^^^^\n" + >+ "The type I2.I3 is deprecated\n" + >+ "----------\n" + >+ "4. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "5. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "6. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^^^^^^^\n" + >+ "The type Xception is deprecated\n" + >+ "----------\n" + >+ "7. ERROR in test1\\E.java (at line 5)\n" + >+ "\tI2 p = null; \n" + >+ "\t^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "8. ERROR in test1\\E.java (at line 11)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception;\n" + >+ "\t ^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "9. ERROR in test1\\E.java (at line 11)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception;\n" + >+ "\t ^^^^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "10. ERROR in test1\\E.java (at line 11)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception;\n" + >+ "\t ^^^^^\n" + >+ "The type I2.I3 is deprecated\n" + >+ "----------\n" + >+ "11. ERROR in test1\\E.java (at line 11)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception;\n" + >+ "\t ^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "12. ERROR in test1\\E.java (at line 11)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception;\n" + >+ "\t ^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "13. ERROR in test1\\E.java (at line 11)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception;\n" + >+ "\t ^^^^^^^^\n" + >+ "The type Xception is deprecated\n" + >+ "----------\n", >+ // javac options >+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */ >+ ); >+} >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206, verify that none of the 13 errros produced >+// by test022 show up when deprecation reporting in an already deprecated context is disabled. >+public void test023() { >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) >+ return; >+ Map customOptions = new HashMap(); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.IGNORE); >+ >+ this.runConformTest( >+ new String[] { >+ "test1/E.java", >+ "package test1;\n" + >+ "\n" + >+ "public class E implements I {\n" + >+ " public <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ " I2 p = null; \n" + >+ " return p;\n" + >+ " }\n" + >+ "}\n" + >+ "interface I {\n" + >+ " /** @deprecated */\n" + >+ " public <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception;\n" + >+ "}\n", >+ "test1/I2.java", >+ "package test1;\n" + >+ "/** @deprecated */\n" + >+ "interface I2 { /** @deprecated */ interface I3 {} }\n" + >+ "/** @deprecated */\n" + >+ "class Xception extends Throwable {\n" + >+ " private static final long serialVersionUID = 1L;\n}\n", >+ }, >+ "", // expected output >+ null, >+ true, // flush previous output dir content >+ null, // special vm args >+ customOptions, // custom options >+ null); // custom requestor >+} >+ >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206, Note : foo in class E is not overriding >+// foo in interface I in this test. It is a new method and as such is not deprecated implicitly. >+public void test024() { >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) >+ return; >+ Map customOptions = new HashMap(); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED); >+ customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.IGNORE); >+ >+ this.runNegativeTest( >+ // test directory preparation >+ true /* flush output directory */, >+ new String[] { >+ "test1/E.java", >+ "package test1;\n" + >+ "\n" + >+ "public abstract class E implements I {\n" + >+ " public <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ " I2 p = null; \n" + >+ " return p;\n" + >+ " }\n" + >+ "}\n" + >+ "interface I {\n" + >+ " /** @deprecated */\n" + >+ " public <T extends I2 & I2.I3> I2 foo() throws Xception;\n" + >+ "}\n", >+ "test1/I2.java", >+ "package test1;\n" + >+ "/** @deprecated */\n" + >+ "interface I2 { /** @deprecated */ interface I3 {} }\n" + >+ "/** @deprecated */\n" + >+ "class Xception extends Throwable {\n" + >+ " private static final long serialVersionUID = 1L;\n}\n", >+ }, >+ // compiler options >+ null /* no class libraries */, >+ customOptions /* custom options */, >+ "----------\n" + >+ "1. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "2. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^^^^\n" + >+ "The type I2.I3 is deprecated\n" + >+ "----------\n" + >+ "3. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^^^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "4. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "5. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n" + >+ "6. ERROR in test1\\E.java (at line 4)\n" + >+ "\tpublic <T extends I2 & I2.I3> I2 foo(I2 i2) throws Xception {\n" + >+ "\t ^^^^^^^^\n" + >+ "The type Xception is deprecated\n" + >+ "----------\n" + >+ "7. ERROR in test1\\E.java (at line 5)\n" + >+ "\tI2 p = null; \n" + >+ "\t^^\n" + >+ "The type I2 is deprecated\n" + >+ "----------\n", >+ // javac options >+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */ >+ ); >+} >+ > public static Class testClass() { > return DeprecatedTest.class; > } >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v >retrieving revision 1.389 >diff -u -r1.389 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 2 Feb 2009 17:36:39 -0000 1.389 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 3 Feb 2009 11:55:03 -0000 >@@ -14,6 +14,7 @@ > import java.io.CharConversionException; > import java.io.PrintWriter; > import java.io.StringWriter; >+import java.util.ArrayList; > import java.util.Iterator; > import java.util.List; > >@@ -89,6 +90,7 @@ > import org.eclipse.jdt.internal.compiler.lookup.InvocationSite; > import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding; > import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; >+import org.eclipse.jdt.internal.compiler.lookup.MethodScope; > import org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; >@@ -119,6 +121,31 @@ > FIELD_ACCESS = 0x4, > CONSTRUCTOR_ACCESS = 0x8, > METHOD_ACCESS = 0xC; >+ >+ private interface IDeferredProblem { >+ void doubleCheckIfProblemPersists(); >+ } >+ >+ private class DeferredDeprecationProblem implements IDeferredProblem { >+ private TypeBinding type; >+ private ASTNode location; >+ private Scope scope; >+ private int severity; >+ public DeferredDeprecationProblem(TypeBinding type, ASTNode location, Scope scope, int severity) { >+ this.type = type; >+ this.location = location; >+ this.scope = scope; >+ this.severity = severity; >+ } >+ public void doubleCheckIfProblemPersists() { >+ // Double check now. It is the responsibility of the outer layer to ensure that, the element of >+ // ambiguity/uncertainty that caused us to reserve judgment has gone away now. >+ if (this.location.isTypeUseDeprecated(this.type, this.scope)) { >+ this.scope.problemReporter().deprecatedType(this.type, this.location, this.severity); >+ } >+ } >+ } >+ private ArrayList deferredProblems = null; > > public ProblemReporter(IErrorHandlingPolicy policy, CompilerOptions options, IProblemFactory problemFactory) { > super(policy, options, problemFactory); >@@ -1366,10 +1393,19 @@ > location.sourceEnd); > } > } >-public void deprecatedType(TypeBinding type, ASTNode location) { >+public void deprecatedType(TypeBinding type, ASTNode location, Scope scope) { > if (location == null) return; // 1G828DN - no type ref for synthetic arguments > int severity = computeSeverity(IProblem.UsingDeprecatedType); > if (severity == ProblemSeverities.Ignore) return; >+ if (!isTypeUseDeprecatedForSure(scope)) { >+ // Defer problem reporting till later when we can be sure. >+ scope.compilationUnitScope().problemReporter().recordDeferredProblem(new DeferredDeprecationProblem(type, location, scope, severity)); >+ return; >+ } >+ deprecatedType(type, location, severity); >+} >+ >+void deprecatedType(TypeBinding type, ASTNode location, int severity) { > type = type.leafComponentType(); > this.handle( > IProblem.UsingDeprecatedType, >@@ -1379,6 +1415,32 @@ > location.sourceStart, > nodeSourceEnd(null, location)); > } >+ >+private void recordDeferredProblem(IDeferredProblem aDeferredProblem) { >+ if (this.deferredProblems == null) >+ this.deferredProblems = new ArrayList(4); >+ this.deferredProblems.add(aDeferredProblem); >+} >+ >+private boolean isTypeUseDeprecatedForSure(Scope scope) { >+ if (!scope.compilerOptions().reportDeprecationInsideDeprecatedCode) { >+ // Don't be too eager in reporting a deprecated type usage, IFF we got here while analyzing >+ // method signatures (CompilationUnitScope.faultInTypes). We cannot conclusively say (until >+ // method verification) whether the method is really an implementation of a deprecated interface. >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206 >+ if (scope instanceof MethodScope) { >+ MethodScope mScope = (MethodScope) scope; >+ if (!mScope.isInsideInitializer()) { >+ MethodBinding method = ((AbstractMethodDeclaration) mScope.referenceContext).binding; >+ if (method != null && (method.modifiers & ExtraCompilerModifiers.AccUnresolved) != 0) { >+ return false; >+ } >+ } >+ } >+ } >+ return true; >+} >+ > public void disallowedTargetForAnnotation(Annotation annotation) { > this.handle( > IProblem.DisallowedTargetForAnnotation, >@@ -1998,6 +2060,20 @@ > problemEndPosition); > } > >+public void handleDeferredDeprecationProblems() { >+ if (this.deferredProblems == null) >+ return; >+ for (int i = this.deferredProblems.size() - 1; i >= 0; --i) { >+ Object problem = this.deferredProblems.get(i); >+ if (problem instanceof DeferredDeprecationProblem) { >+ ((DeferredDeprecationProblem) problem).doubleCheckIfProblemPersists(); >+ this.deferredProblems.remove(i); >+ } >+ } >+ if (this.deferredProblems.isEmpty()) >+ this.deferredProblems = null; >+} >+ > public void hiddenCatchBlock(ReferenceBinding exceptionType, ASTNode location) { > this.handle( > IProblem.MaskedCatch, >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java,v >retrieving revision 1.100 >diff -u -r1.100 MethodVerifier.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 4 Dec 2008 17:06:52 -0000 1.100 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 3 Feb 2009 11:54:56 -0000 >@@ -168,8 +168,14 @@ > if(inheritedMethod.isSynchronized() && !currentMethod.isSynchronized()) { > problemReporter(currentMethod).missingSynchronizedOnInheritedMethod(currentMethod, inheritedMethod); > } >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206 >+ boolean currentMethodIsViewedDeprecated = currentMethod.isViewedAsDeprecated(); >+ if (inheritedMethod.isViewedAsDeprecated()) { >+ if (currentMethod.isImplementing() && !currentMethodIsViewedDeprecated) >+ currentMethod.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly; >+ } > if (options.reportDeprecationWhenOverridingDeprecatedMethod && inheritedMethod.isViewedAsDeprecated()) { >- if (!currentMethod.isViewedAsDeprecated() || options.reportDeprecationInsideDeprecatedCode) { >+ if (!currentMethodIsViewedDeprecated || options.reportDeprecationInsideDeprecatedCode) { > // check against the other inherited methods to see if they hide this inheritedMethod > ReferenceBinding declaringClass = inheritedMethod.declaringClass; > if (declaringClass.isInterface()) >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java,v >retrieving revision 1.115 >diff -u -r1.115 BlockScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 1 Oct 2008 21:16:38 -0000 1.115 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 3 Feb 2009 11:54:55 -0000 >@@ -461,7 +461,7 @@ > if (invocationSite instanceof ASTNode) { > ASTNode invocationNode = (ASTNode) invocationSite; > if (invocationNode.isTypeUseDeprecated(referenceBinding, this)) { >- problemReporter().deprecatedType(referenceBinding, invocationNode); >+ problemReporter().deprecatedType(referenceBinding, invocationNode, this); > } > } > while (currentIndex < length) { >@@ -501,7 +501,7 @@ > referenceBinding = (ReferenceBinding) binding; > ASTNode invocationNode = (ASTNode) invocationSite; > if (invocationNode.isTypeUseDeprecated(referenceBinding, this)) { >- problemReporter().deprecatedType(referenceBinding, invocationNode); >+ problemReporter().deprecatedType(referenceBinding, invocationNode, this); > } > } > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java,v >retrieving revision 1.125 >diff -u -r1.125 CompilationUnitScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 12 Jan 2009 18:37:16 -0000 1.125 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 3 Feb 2009 11:54:55 -0000 >@@ -386,7 +386,7 @@ > ? ((ProblemReferenceBinding) referenceBinding).closestMatch > : referenceBinding; > if (importReference.isTypeUseDeprecated(typeToCheck, this)) >- problemReporter().deprecatedType(typeToCheck, importReference); >+ problemReporter().deprecatedType(typeToCheck, importReference, this); > > ReferenceBinding existingType = typesBySimpleNames.get(compoundName[compoundName.length - 1]); > if (existingType != null) { >@@ -812,5 +812,8 @@ > public void verifyMethods(MethodVerifier verifier) { > for (int i = 0, length = this.topLevelTypes.length; i < length; i++) > this.topLevelTypes[i].verifyMethods(verifier); >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206, if we have deferred any >+ // deprecation messages, flush them now. >+ this.problemReporter().handleDeferredDeprecationProblems(); > } > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java,v >retrieving revision 1.32 >diff -u -r1.32 SingleTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java 27 Jun 2008 16:03:54 -0000 1.32 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java 3 Feb 2009 11:54:54 -0000 >@@ -70,7 +70,7 @@ > } > } > if (isTypeUseDeprecated(memberType, scope)) >- scope.problemReporter().deprecatedType(memberType, this); >+ scope.problemReporter().deprecatedType(memberType, this, scope); > memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/); > if (memberType.isRawType() > && (this.bits & IgnoreRawTypeCheck) == 0 >Index: compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java,v >retrieving revision 1.41 >diff -u -r1.41 TypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java 27 Jun 2008 16:03:55 -0000 1.41 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java 3 Feb 2009 11:54:54 -0000 >@@ -167,7 +167,7 @@ > } > > protected void reportDeprecatedType(TypeBinding type, Scope scope) { >- scope.problemReporter().deprecatedType(type, this); >+ scope.problemReporter().deprecatedType(type, this, scope); > } > > protected void reportInvalidType(Scope scope) { >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java,v >retrieving revision 1.49 >diff -u -r1.49 ParameterizedSingleTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java 8 Dec 2008 14:19:29 -0000 1.49 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java 3 Feb 2009 11:54:53 -0000 >@@ -155,7 +155,7 @@ > return null; > } > if (isTypeUseDeprecated(currentType, scope)) >- scope.problemReporter().deprecatedType(currentType, this); >+ scope.problemReporter().deprecatedType(currentType, this, scope); > ReferenceBinding currentEnclosing = currentType.enclosingType(); > if (currentEnclosing != null && currentEnclosing.erasure() != enclosingType.erasure()) { > enclosingType = currentEnclosing; // inherited member type, leave it associated with its enclosing rather than subtype >Index: compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java,v >retrieving revision 1.115 >diff -u -r1.115 SingleNameReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 29 Jan 2009 17:00:08 -0000 1.115 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 3 Feb 2009 11:54:54 -0000 >@@ -884,7 +884,7 @@ > //deprecated test > TypeBinding type = (TypeBinding)this.binding; > if (isTypeUseDeprecated(type, scope)) >- scope.problemReporter().deprecatedType(type, this); >+ scope.problemReporter().deprecatedType(type, this, scope); > type = scope.environment().convertToRawType(type, false /*do not force conversion of enclosing types*/); > return this.resolvedType = type; > }
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 247206
:
112476
|
124141
|
124262
| 124532