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 51832 Details for
Bug 159709
[compiler] missing warnings for deprecated member types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix + test cases tuning
org.eclipse.jdt.core_01.txt (text/plain), 4.62 KB, created by
Maxime Daniel
on 2006-10-12 02:53:31 EDT
(
hide
)
Description:
Fix + test cases tuning
Filename:
MIME Type:
Creator:
Maxime Daniel
Created:
2006-10-12 02:53:31 EDT
Size:
4.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java,v >retrieving revision 1.2 >diff -u -r1.2 Deprecated15Test.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java 11 Oct 2006 16:03:13 -0000 1.2 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java 12 Oct 2006 06:50:58 -0000 >@@ -107,7 +107,7 @@ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=159709 > // guard variant for DeprecatedTest#test015 using an annotation >-public void _test002() { >+public void test002() { > Map customOptions = new HashMap(); > customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR); > this.runNegativeTest( >@@ -132,7 +132,17 @@ > " }" + > "}\n", > }, >- "2 ERRS expected", >+ "----------\n" + >+ "1. ERROR in p\\M1.java (at line 4)\n" + >+ " a.N1.N2.N3 m = null;\n" + >+ " ^^^^^^^^^^\n" + >+ "The type N1.N2.N3 is deprecated\n" + >+ "----------\n" + >+ "2. ERROR in p\\M1.java (at line 5)\n" + >+ " m.foo();\n" + >+ " ^^^^^^^\n" + >+ "The method foo() from the type N1.N2.N3 is deprecated\n" + >+ "----------\n", > null, > true, > customOptions, >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.28 >diff -u -r1.28 DeprecatedTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java 12 Oct 2006 06:23:16 -0000 1.28 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java 12 Oct 2006 06:50:58 -0000 >@@ -545,7 +545,7 @@ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=159709 > // the order of the CUs must not modify the behavior, see also test016 >-public void _test015() { >+public void test015() { > Map customOptions = new HashMap(); > customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR); > this.runNegativeTest( >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java,v >retrieving revision 1.20 >diff -u -r1.20 MemberTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java 29 Mar 2006 02:45:27 -0000 1.20 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java 12 Oct 2006 06:51:00 -0000 >@@ -11,6 +11,9 @@ > package org.eclipse.jdt.internal.compiler.lookup; > > import org.eclipse.jdt.core.compiler.CharOperation; >+import org.eclipse.jdt.internal.compiler.ast.ASTNode; >+import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > > public final class MemberTypeBinding extends NestedTypeBinding { > public MemberTypeBinding(char[][] compoundName, ClassScope scope, SourceTypeBinding enclosingType) { >@@ -33,6 +36,26 @@ > > return constantPoolName = CharOperation.concat(enclosingType().constantPoolName(), sourceName, '$'); > } >+public void initializeDeprecatedAnnotationTagBits() { >+ if ((this.tagBits & (TagBits.AnnotationResolved|TagBits.AnnotationDeprecated)) == 0) { >+ ReferenceBinding enclosing = this.enclosingType(); >+ enclosing.initializeDeprecatedAnnotationTagBits(); >+ TypeDeclaration typeDecl = this.scope.referenceContext; >+ boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation; >+ try { >+ typeDecl.staticInitializerScope.insideTypeAnnotation = true; >+ ASTNode.resolveDeprecatedAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this); >+ } finally { >+ typeDecl.staticInitializerScope.insideTypeAnnotation = old; >+ } >+ if ((this.tagBits & TagBits.AnnotationDeprecated) != 0) { >+ this.modifiers |= ClassFileConstants.AccDeprecated; >+ } else if ((enclosing.modifiers & (ClassFileConstants.AccDeprecated | >+ ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0) { >+ this.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly; >+ } >+ } >+} > public String toString() { > return "Member type : " + new String(sourceName()) + " " + super.toString(); //$NON-NLS-2$ //$NON-NLS-1$ > }
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 159709
: 51832