View | Details | Raw Unified | Return to bug 159709
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java (-2 / +12 lines)
Lines 107-113 Link Here
107
}
107
}
108
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159709
108
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159709
109
// guard variant for DeprecatedTest#test015 using an annotation 
109
// guard variant for DeprecatedTest#test015 using an annotation 
110
public void _test002() {
110
public void test002() {
111
	Map customOptions = new HashMap();
111
	Map customOptions = new HashMap();
112
	customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
112
	customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
113
	this.runNegativeTest(
113
	this.runNegativeTest(
Lines 132-138 Link Here
132
			"  }" +
132
			"  }" +
133
			"}\n",
133
			"}\n",
134
		}, 
134
		}, 
135
		"2 ERRS expected",
135
		"----------\n" + 
136
		"1. ERROR in p\\M1.java (at line 4)\n" + 
137
		"	a.N1.N2.N3 m = null;\n" + 
138
		"	^^^^^^^^^^\n" + 
139
		"The type N1.N2.N3 is deprecated\n" + 
140
		"----------\n" + 
141
		"2. ERROR in p\\M1.java (at line 5)\n" + 
142
		"	m.foo();\n" + 
143
		"	^^^^^^^\n" + 
144
		"The method foo() from the type N1.N2.N3 is deprecated\n" + 
145
		"----------\n",
136
		null,
146
		null,
137
		true,
147
		true,
138
		customOptions,
148
		customOptions,
(-)src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java (-1 / +1 lines)
Lines 545-551 Link Here
545
}
545
}
546
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159709
546
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159709
547
// the order of the CUs must not modify the behavior, see also test016 
547
// the order of the CUs must not modify the behavior, see also test016 
548
public void _test015() {
548
public void test015() {
549
	Map customOptions = new HashMap();
549
	Map customOptions = new HashMap();
550
	customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
550
	customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
551
	this.runNegativeTest(
551
	this.runNegativeTest(
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java (+23 lines)
Lines 11-16 Link Here
11
package org.eclipse.jdt.internal.compiler.lookup;
11
package org.eclipse.jdt.internal.compiler.lookup;
12
12
13
import org.eclipse.jdt.core.compiler.CharOperation;
13
import org.eclipse.jdt.core.compiler.CharOperation;
14
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
15
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
16
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
14
17
15
public final class MemberTypeBinding extends NestedTypeBinding {
18
public final class MemberTypeBinding extends NestedTypeBinding {
16
public MemberTypeBinding(char[][] compoundName, ClassScope scope, SourceTypeBinding enclosingType) {
19
public MemberTypeBinding(char[][] compoundName, ClassScope scope, SourceTypeBinding enclosingType) {
Lines 33-38 Link Here
33
36
34
	return constantPoolName = CharOperation.concat(enclosingType().constantPoolName(), sourceName, '$');
37
	return constantPoolName = CharOperation.concat(enclosingType().constantPoolName(), sourceName, '$');
35
}
38
}
39
public void initializeDeprecatedAnnotationTagBits() {
40
	if ((this.tagBits & (TagBits.AnnotationResolved|TagBits.AnnotationDeprecated)) == 0) {
41
		ReferenceBinding enclosing = this.enclosingType();
42
		enclosing.initializeDeprecatedAnnotationTagBits();
43
		TypeDeclaration typeDecl = this.scope.referenceContext;
44
		boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation;
45
		try {
46
			typeDecl.staticInitializerScope.insideTypeAnnotation = true;
47
			ASTNode.resolveDeprecatedAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this);
48
		} finally {
49
			typeDecl.staticInitializerScope.insideTypeAnnotation = old;
50
		}
51
		if ((this.tagBits & TagBits.AnnotationDeprecated) != 0) {
52
			this.modifiers |= ClassFileConstants.AccDeprecated;
53
		} else if ((enclosing.modifiers & (ClassFileConstants.AccDeprecated |
54
						ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0) {
55
			this.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly;
56
		}
57
	}
58
}
36
public String toString() {
59
public String toString() {
37
	return "Member type : " + new String(sourceName()) + " " + super.toString(); //$NON-NLS-2$ //$NON-NLS-1$
60
	return "Member type : " + new String(sourceName()) + " " + super.toString(); //$NON-NLS-2$ //$NON-NLS-1$
38
}
61
}

Return to bug 159709