View | Details | Raw Unified | Return to bug 324848 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java (-1 / +1 lines)
Lines 879-885 Link Here
879
 * to abort.
879
 * to abort.
880
 */
880
 */
881
public ProblemReporter problemReporter() {
881
public ProblemReporter problemReporter() {
882
	return outerMostMethodScope().problemReporter();
882
	return methodScope().problemReporter();
883
}
883
}
884
884
885
/*
885
/*
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java (-8 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 403-415 Link Here
403
 * to abort.
403
 * to abort.
404
 */
404
 */
405
public ProblemReporter problemReporter() {
405
public ProblemReporter problemReporter() {
406
	MethodScope outerMethodScope;
406
	ProblemReporter problemReporter = referenceCompilationUnit().problemReporter;
407
	if ((outerMethodScope = outerMostMethodScope()) == this) {
407
	problemReporter.referenceContext = this.referenceContext;
408
		ProblemReporter problemReporter = referenceCompilationUnit().problemReporter;
408
	return problemReporter;
409
		problemReporter.referenceContext = this.referenceContext;
410
		return problemReporter;
411
	}
412
	return outerMethodScope.problemReporter();
413
}
409
}
414
410
415
public final int recordInitializationStates(FlowInfo flowInfo) {
411
public final int recordInitializationStates(FlowInfo flowInfo) {
(-)Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InnerClassTest.java (-24 / +37 lines)
Lines 30-35 Link Here
30
protected Map getCompilerOptions() {
30
protected Map getCompilerOptions() {
31
	Map options = super.getCompilerOptions();
31
	Map options = super.getCompilerOptions();
32
	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
32
	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
33
	options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
34
	options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE);
35
	options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
33
	return options;
36
	return options;
34
}
37
}
35
public void test001() {
38
public void test001() {
Lines 3063-3079 Link Here
3063
		"}",
3066
		"}",
3064
	},
3067
	},
3065
	"----------\n" +
3068
	"----------\n" +
3066
	"1. WARNING in InnerClassTests\\LocalClass\\ExtendingLocalClass\\AccessToMethod\\Test00.java (at line 21)\n" +
3069
	"1. ERROR in InnerClassTests\\LocalClass\\ExtendingLocalClass\\AccessToMethod\\Test00.java (at line 33)\n" +
3067
	"	private int var = 1;\n" +
3068
	"	            ^^^\n" +
3069
	"The field Test00.var is never read locally\n" +
3070
	"----------\n" +
3071
	"2. ERROR in InnerClassTests\\LocalClass\\ExtendingLocalClass\\AccessToMethod\\Test00.java (at line 33)\n" +
3072
	"	class Inner extends java.awt.Component {\n" +
3070
	"	class Inner extends java.awt.Component {\n" +
3073
	"	      ^^^^^\n" +
3071
	"	      ^^^^^\n" +
3074
	"Duplicate nested type Inner\n" +
3072
	"Duplicate nested type Inner\n" +
3075
	"----------\n" +
3073
	"----------\n" +
3076
	"3. WARNING in InnerClassTests\\LocalClass\\ExtendingLocalClass\\AccessToMethod\\Test00.java (at line 33)\n" +
3074
	"2. WARNING in InnerClassTests\\LocalClass\\ExtendingLocalClass\\AccessToMethod\\Test00.java (at line 33)\n" +
3077
	"	class Inner extends java.awt.Component {\n" +
3075
	"	class Inner extends java.awt.Component {\n" +
3078
	"	      ^^^^^\n" +
3076
	"	      ^^^^^\n" +
3079
	"The serializable class Inner does not declare a static final serialVersionUID field of type long\n" +
3077
	"The serializable class Inner does not declare a static final serialVersionUID field of type long\n" +
Lines 4701-4717 Link Here
4701
		"  }\n" +
4699
		"  }\n" +
4702
		"}",
4700
		"}",
4703
	},
4701
	},
4704
		"----------\n" +
4702
	"----------\n" + 
4705
		"1. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 44)\n" +
4703
	"1. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 42)\n" + 
4706
		"	int geta9BMember() { return a9; }\n" +
4704
	"	float getbtopBMember() { return btop; }\n" + 
4707
		"	                            ^^\n" +
4705
	"	                                ^^^^\n" + 
4708
		"Cannot make a static reference to the non-static field a9\n" +
4706
	"No enclosing instance of the type BTop is accessible in scope\n" + 
4709
		"----------\n" +
4707
	"----------\n" + 
4710
		"2. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 50)\n" +
4708
	"2. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 44)\n" + 
4711
		"	int geta9BMember() { return a9; }\n" +
4709
	"	int geta9BMember() { return a9; }\n" + 
4712
		"	                            ^^\n" +
4710
	"	                            ^^\n" + 
4713
		"Cannot make a static reference to the non-static field a9\n" +
4711
	"Cannot make a static reference to the non-static field a9\n" + 
4714
		"----------\n"
4712
	"----------\n" + 
4713
	"3. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 48)\n" + 
4714
	"	float getbtopBMember() { return btop; }\n" + 
4715
	"	                                ^^^^\n" + 
4716
	"No enclosing instance of the type BTop is accessible in scope\n" + 
4717
	"----------\n" + 
4718
	"4. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 50)\n" + 
4719
	"	int geta9BMember() { return a9; }\n" + 
4720
	"	                            ^^\n" + 
4721
	"Cannot make a static reference to the non-static field a9\n" + 
4722
	"----------\n"
4715
	);
4723
	);
4716
}
4724
}
4717
public void test104() {
4725
public void test104() {
Lines 4963-4974 Link Here
4963
		"  }\n" +
4971
		"  }\n" +
4964
		"}",
4972
		"}",
4965
	},
4973
	},
4966
		"----------\n" +
4974
	"----------\n" + 
4967
		"1. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test05.java (at line 44)\n" +
4975
	"1. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test05.java (at line 42)\n" + 
4968
		"	int geta8BMember() { return a8; }\n" +
4976
	"	float getbtopBMember() { return btop; }\n" + 
4969
		"	                            ^^\n" +
4977
	"	                                ^^^^\n" + 
4970
		"Cannot make a static reference to the non-static field a8\n" +
4978
	"No enclosing instance of the type BTop is accessible in scope\n" + 
4971
		"----------\n"
4979
	"----------\n" + 
4980
	"2. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test05.java (at line 44)\n" + 
4981
	"	int geta8BMember() { return a8; }\n" + 
4982
	"	                            ^^\n" + 
4983
	"Cannot make a static reference to the non-static field a8\n" + 
4984
	"----------\n"
4972
	);
4985
	);
4973
}
4986
}
4974
public void test108() {
4987
public void test108() {
(-)Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java (-563 / +67 lines)
Lines 30-35 Link Here
30
protected Map getCompilerOptions() {
30
protected Map getCompilerOptions() {
31
	Map options = super.getCompilerOptions();
31
	Map options = super.getCompilerOptions();
32
	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
32
	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
33
	options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
34
	options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE);
35
	options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
33
	return options;
36
	return options;
34
}
37
}
35
/**
38
/**
Lines 1894-1905 Link Here
1894
			"}",
1897
			"}",
1895
		},
1898
		},
1896
		"----------\n" +
1899
		"----------\n" +
1897
		"1. WARNING in p\\X.java (at line 6)\n" +
1900
		"1. ERROR in p\\X.java (at line 6)\n" +
1898
		"	int j = i; \n" +
1899
		"	    ^\n" +
1900
		"The field Local.j is never read locally\n" +
1901
		"----------\n" +
1902
		"2. ERROR in p\\X.java (at line 6)\n" +
1903
		"	int j = i; \n" +
1901
		"	int j = i; \n" +
1904
		"	        ^\n" +
1902
		"	        ^\n" +
1905
		"The local variable i may not have been initialized\n" +
1903
		"The local variable i may not have been initialized\n" +
Lines 2306-2317 Link Here
2306
			"}",
2304
			"}",
2307
		},
2305
		},
2308
		"----------\n" +
2306
		"----------\n" +
2309
		"1. WARNING in p\\Init2.java (at line 6)\n" +
2307
		"1. ERROR in p\\Init2.java (at line 6)\n" +
2310
		"	int j = i;  // Javac complains here (Jikes does not)\n" +
2311
		"	    ^\n" +
2312
		"The field Local.j is never read locally\n" +
2313
		"----------\n" +
2314
		"2. ERROR in p\\Init2.java (at line 6)\n" +
2315
		"	int j = i;  // Javac complains here (Jikes does not)\n" +
2308
		"	int j = i;  // Javac complains here (Jikes does not)\n" +
2316
		"	        ^\n" +
2309
		"	        ^\n" +
2317
		"The local variable i may not have been initialized\n" +
2310
		"The local variable i may not have been initialized\n" +
Lines 2632-2643 Link Here
2632
			"}",
2625
			"}",
2633
		},
2626
		},
2634
		"----------\n" +
2627
		"----------\n" +
2635
		"1. WARNING in p\\X.java (at line 5)\n" +
2628
		"1. ERROR in p\\X.java (at line 5)\n" +
2636
		"	Object obj = X.this;\n" +
2637
		"	       ^^^\n" +
2638
		"The field new Object(){}.obj is never read locally\n" +
2639
		"----------\n" +
2640
		"2. ERROR in p\\X.java (at line 5)\n" +
2641
		"	Object obj = X.this;\n" +
2629
		"	Object obj = X.this;\n" +
2642
		"	             ^^^^^^\n" +
2630
		"	             ^^^^^^\n" +
2643
		"No enclosing instance of the type X is accessible in scope\n" +
2631
		"No enclosing instance of the type X is accessible in scope\n" +
Lines 3121-3155 Link Here
3121
		"	      ^^^^^^^\n" +
3109
		"	      ^^^^^^^\n" +
3122
		"The blank final field a may not have been initialized\n" +
3110
		"The blank final field a may not have been initialized\n" +
3123
		"----------\n" +
3111
		"----------\n" +
3124
		"2. WARNING in p\\CheckBlankFinals.java (at line 13)\n" +
3112
		"2. ERROR in p\\CheckBlankFinals.java (at line 13)\n" +
3125
		"	class LocA {\n" +
3126
		"	      ^^^^\n" +
3127
		"The type LocA is never used locally\n" +
3128
		"----------\n" +
3129
		"3. ERROR in p\\CheckBlankFinals.java (at line 13)\n" +
3130
		"	class LocA {\n" +
3113
		"	class LocA {\n" +
3131
		"	      ^^^^\n" +
3114
		"	      ^^^^\n" +
3132
		"The blank final field a may not have been initialized\n" +
3115
		"The blank final field a may not have been initialized\n" +
3133
		"----------\n" +
3116
		"----------\n" +
3134
		"4. WARNING in p\\CheckBlankFinals.java (at line 14)\n" +
3117
		"3. ERROR in p\\CheckBlankFinals.java (at line 15)\n" +
3135
		"	final int a;  //  never initialized\n" +
3136
		"	          ^\n" +
3137
		"The field LocA.a is never read locally\n" +
3138
		"----------\n" +
3139
		"5. WARNING in p\\CheckBlankFinals.java (at line 15)\n" +
3140
		"	class LocB {\n" +
3141
		"	      ^^^^\n" +
3142
		"The type LocA.LocB is never used locally\n" +
3143
		"----------\n" +
3144
		"6. ERROR in p\\CheckBlankFinals.java (at line 15)\n" +
3145
		"	class LocB {\n" +
3118
		"	class LocB {\n" +
3146
		"	      ^^^^\n" +
3119
		"	      ^^^^\n" +
3147
		"The blank final field b may not have been initialized\n" +
3120
		"The blank final field b may not have been initialized\n" +
3148
		"----------\n" +
3149
		"7. WARNING in p\\CheckBlankFinals.java (at line 16)\n" +
3150
		"	final int b; \n" +
3151
		"	          ^\n" +
3152
		"The field LocA.LocB.b is never read locally\n" +
3153
		"----------\n"
3121
		"----------\n"
3154
	);
3122
	);
3155
}
3123
}
Lines 3895-3930 Link Here
3895
		"	class SubLocal extends SuperLokcal {}\n" +
3863
		"	class SubLocal extends SuperLokcal {}\n" +
3896
		"	                       ^^^^^^^^^^^\n" +
3864
		"	                       ^^^^^^^^^^^\n" +
3897
		"SuperLokcal cannot be resolved to a type\n" +
3865
		"SuperLokcal cannot be resolved to a type\n" +
3898
		"----------\n" +
3899
		"3. WARNING in p\\TheSub.java (at line 12)\n" +
3900
		"	class SubLocal extends MidLocal {}\n" +
3901
		"	      ^^^^^^^^\n" +
3902
		"The type SubLocal is never used locally\n" +
3903
		"----------\n" +
3904
		"4. WARNING in p\\TheSub.java (at line 16)\n" +
3905
		"	int y = x;  }\n" +
3906
		"	    ^\n" +
3907
		"The field SuperLocal.y is never read locally\n" +
3908
		"----------\n" +
3909
		"5. WARNING in p\\TheSub.java (at line 18)\n" +
3910
		"	class SubLocal extends MidLocal {}\n" +
3911
		"	      ^^^^^^^^\n" +
3912
		"The type SubLocal is never used locally\n" +
3913
		"----------\n" +
3914
		"6. WARNING in p\\TheSub.java (at line 22)\n" +
3915
		"	Object o = TheSub.this; }\n" +
3916
		"	       ^\n" +
3917
		"The field SuperLocal.o is never read locally\n" +
3918
		"----------\n" +
3919
		"7. WARNING in p\\TheSub.java (at line 24)\n" +
3920
		"	class SubLocal extends MidLocal {}\n" +
3921
		"	      ^^^^^^^^\n" +
3922
		"The type SubLocal is never used locally\n" +
3923
		"----------\n" +
3924
		"8. WARNING in p\\TheSub.java (at line 29)\n" +
3925
		"	class SubLocal extends MidLocal {}\n" +
3926
		"	      ^^^^^^^^\n" +
3927
		"The type SubLocal is never used locally\n" +
3928
		"----------\n"
3866
		"----------\n"
3929
	);
3867
	);
3930
}
3868
}
Lines 3956-3985 Link Here
3956
			"}",
3894
			"}",
3957
		},
3895
		},
3958
		"----------\n" +
3896
		"----------\n" +
3959
		"1. WARNING in p\\CheckBlankFinals1.java (at line 11)\n" +
3897
		"1. ERROR in p\\CheckBlankFinals1.java (at line 11)\n" +
3960
		"	class LocA {\n" +
3961
		"	      ^^^^\n" +
3962
		"The type LocA is never used locally\n" +
3963
		"----------\n" +
3964
		"2. ERROR in p\\CheckBlankFinals1.java (at line 11)\n" +
3965
		"	class LocA {\n" +
3898
		"	class LocA {\n" +
3966
		"	      ^^^^\n" +
3899
		"	      ^^^^\n" +
3967
		"The blank final field a may not have been initialized\n" +
3900
		"The blank final field a may not have been initialized\n" +
3968
		"----------\n" +
3969
		"3. WARNING in p\\CheckBlankFinals1.java (at line 12)\n" +
3970
		"	final int a;  //  never initialized\n" +
3971
		"	          ^\n" +
3972
		"The field LocA.a is never read locally\n" +
3973
		"----------\n" +
3974
		"4. WARNING in p\\CheckBlankFinals1.java (at line 13)\n" +
3975
		"	class LocB {\n" +
3976
		"	      ^^^^\n" +
3977
		"The type LocA.LocB is never used locally\n" +
3978
		"----------\n" +
3979
		"5. WARNING in p\\CheckBlankFinals1.java (at line 14)\n" +
3980
		"	final int b; \n" +
3981
		"	          ^\n" +
3982
		"The field LocA.LocB.b is never read locally\n" +
3983
		"----------\n");
3901
		"----------\n");
3984
}
3902
}
3985
public void test098() {
3903
public void test098() {
Lines 4001-4035 Link Here
4001
			"}  ",
3919
			"}  ",
4002
		},
3920
		},
4003
		"----------\n" +
3921
		"----------\n" +
4004
		"1. WARNING in p\\CheckBlankFinals2.java (at line 6)\n" +
3922
		"1. ERROR in p\\CheckBlankFinals2.java (at line 6)\n" +
4005
		"	class LocA {\n" +
4006
		"	      ^^^^\n" +
4007
		"The type LocA is never used locally\n" +
4008
		"----------\n" +
4009
		"2. ERROR in p\\CheckBlankFinals2.java (at line 6)\n" +
4010
		"	class LocA {\n" +
3923
		"	class LocA {\n" +
4011
		"	      ^^^^\n" +
3924
		"	      ^^^^\n" +
4012
		"The blank final field a may not have been initialized\n" +
3925
		"The blank final field a may not have been initialized\n" +
4013
		"----------\n" +
3926
		"----------\n" +
4014
		"3. WARNING in p\\CheckBlankFinals2.java (at line 7)\n" +
3927
		"2. ERROR in p\\CheckBlankFinals2.java (at line 8)\n" +
4015
		"	final int a;  //  never initialized\n" +
4016
		"	          ^\n" +
4017
		"The field LocA.a is never read locally\n" +
4018
		"----------\n" +
4019
		"4. WARNING in p\\CheckBlankFinals2.java (at line 8)\n" +
4020
		"	class LocB {\n" +
4021
		"	      ^^^^\n" +
4022
		"The type LocA.LocB is never used locally\n" +
4023
		"----------\n" +
4024
		"5. ERROR in p\\CheckBlankFinals2.java (at line 8)\n" +
4025
		"	class LocB {\n" +
3928
		"	class LocB {\n" +
4026
		"	      ^^^^\n" +
3929
		"	      ^^^^\n" +
4027
		"The blank final field b may not have been initialized\n" +
3930
		"The blank final field b may not have been initialized\n" +
4028
		"----------\n" +
4029
		"6. WARNING in p\\CheckBlankFinals2.java (at line 9)\n" +
4030
		"	final int b;   // never initialized\n" +
4031
		"	          ^\n" +
4032
		"The field LocA.LocB.b is never read locally\n" +
4033
		"----------\n"
3931
		"----------\n"
4034
	);
3932
	);
4035
}
3933
}
Lines 4055-4070 Link Here
4055
		"	class MemberA {\n" +
3953
		"	class MemberA {\n" +
4056
		"	      ^^^^^^^\n" +
3954
		"	      ^^^^^^^\n" +
4057
		"The blank final field a may not have been initialized\n" +
3955
		"The blank final field a may not have been initialized\n" +
4058
		"----------\n" +
4059
		"2. WARNING in p\\CheckBlankFinals3.java (at line 6)\n" +
4060
		"	class MemberB {\n" +
4061
		"	      ^^^^^^^\n" +
4062
		"The type MemberB is never used locally\n" +
4063
		"----------\n" +
4064
		"3. WARNING in p\\CheckBlankFinals3.java (at line 7)\n" +
4065
		"	final int b; \n" +
4066
		"	          ^\n" +
4067
		"The field MemberB.b is never read locally\n" +
4068
		"----------\n"
3956
		"----------\n"
4069
	);
3957
	);
4070
}
3958
}
Lines 4568-4594 Link Here
4568
			"}",
4456
			"}",
4569
		},
4457
		},
4570
		"----------\n" +
4458
		"----------\n" +
4571
		"1. WARNING in p\\Outer12.java (at line 7)\n" +
4459
		"1. ERROR in p\\Outer12.java (at line 9)\n" +
4572
		"	void g() {\n" +
4573
		"	     ^^^\n" +
4574
		"The method g() from the type Local is never used locally\n" +
4575
		"----------\n" +
4576
		"2. WARNING in p\\Outer12.java (at line 8)\n" +
4577
		"	class Local2 {\n" +
4578
		"	      ^^^^^^\n" +
4579
		"The type Local2 is never used locally\n" +
4580
		"----------\n" +
4581
		"3. WARNING in p\\Outer12.java (at line 9)\n" +
4582
		"	int n = count + count; // another compiler rejects\n" +
4583
		"	    ^\n" +
4584
		"The field Local2.n is never read locally\n" +
4585
		"----------\n" +
4586
		"4. ERROR in p\\Outer12.java (at line 9)\n" +
4587
		"	int n = count + count; // another compiler rejects\n" +
4460
		"	int n = count + count; // another compiler rejects\n" +
4588
		"	        ^^^^^\n" +
4461
		"	        ^^^^^\n" +
4589
		"The local variable count may not have been initialized\n" +
4462
		"The local variable count may not have been initialized\n" +
4590
		"----------\n" +
4463
		"----------\n" +
4591
		"5. ERROR in p\\Outer12.java (at line 9)\n" +
4464
		"2. ERROR in p\\Outer12.java (at line 9)\n" +
4592
		"	int n = count + count; // another compiler rejects\n" +
4465
		"	int n = count + count; // another compiler rejects\n" +
4593
		"	                ^^^^^\n" +
4466
		"	                ^^^^^\n" +
4594
		"The local variable count may not have been initialized\n" +
4467
		"The local variable count may not have been initialized\n" +
Lines 6082-6103 Link Here
6082
		"	       ^\n" +
5955
		"	       ^\n" +
6083
		"Cannot define static initializer in inner type B\n" +
5956
		"Cannot define static initializer in inner type B\n" +
6084
		"----------\n" +
5957
		"----------\n" +
6085
		"2. WARNING in p\\A11.java (at line 10)\n" +
5958
		"2. ERROR in p\\A11.java (at line 13)\n" +
6086
		"	class A {\n" +
6087
		"	      ^\n" +
6088
		"The type A is never used locally\n" +
6089
		"----------\n" +
6090
		"3. WARNING in p\\A11.java (at line 11)\n" +
6091
		"	void f()\n" +
6092
		"	     ^^^\n" +
6093
		"The method f() from the type A is never used locally\n" +
6094
		"----------\n" +
6095
		"4. ERROR in p\\A11.java (at line 13)\n" +
6096
		"	b=3; // B has not been definitely assigned!\n" +
5959
		"	b=3; // B has not been definitely assigned!\n" +
6097
		"	^\n" +
5960
		"	^\n" +
6098
		"The final local variable b cannot be assigned, since it is defined in an enclosing type\n" +
5961
		"The final local variable b cannot be assigned, since it is defined in an enclosing type\n" +
6099
		"----------\n" +
5962
		"----------\n" +
6100
		"5. ERROR in p\\A11.java (at line 17)\n" +
5963
		"3. ERROR in p\\A11.java (at line 17)\n" +
6101
		"	System.out.println(b);\n" +
5964
		"	System.out.println(b);\n" +
6102
		"	                   ^\n" +
5965
		"	                   ^\n" +
6103
		"The local variable b may not have been initialized\n" +
5966
		"The local variable b may not have been initialized\n" +
Lines 6795-6811 Link Here
6795
			"}",
6658
			"}",
6796
		},
6659
		},
6797
		"----------\n" +
6660
		"----------\n" +
6798
		"1. WARNING in p\\ASB.java (at line 8)\n" +
6661
		"1. ERROR in p\\ASB.java (at line 9)\n" +
6799
		"	class L {\n" +
6800
		"	      ^\n" +
6801
		"The type L is never used locally\n" +
6802
		"----------\n" +
6803
		"2. WARNING in p\\ASB.java (at line 9)\n" +
6804
		"	int l = ASB.this.x;  // no enclosing instance of type X is available\n" +
6805
		"	    ^\n" +
6806
		"The field L.l is never read locally\n" +
6807
		"----------\n" +
6808
		"3. ERROR in p\\ASB.java (at line 9)\n" +
6809
		"	int l = ASB.this.x;  // no enclosing instance of type X is available\n" +
6662
		"	int l = ASB.this.x;  // no enclosing instance of type X is available\n" +
6810
		"	        ^^^^^^^^\n" +
6663
		"	        ^^^^^^^^\n" +
6811
		"No enclosing instance of the type ASB is accessible in scope\n" +
6664
		"No enclosing instance of the type ASB is accessible in scope\n" +
Lines 7370-7431 Link Here
7370
		"	      ^^^^^^^^^^^^^^^^^^^\n" + 
7223
		"	      ^^^^^^^^^^^^^^^^^^^\n" + 
7371
		"Unreachable catch block for IOException. This exception is never thrown from the try statement body\n" + 
7224
		"Unreachable catch block for IOException. This exception is never thrown from the try statement body\n" + 
7372
		"----------\n" + 
7225
		"----------\n" + 
7373
		"3. WARNING in p\\DCBug.java (at line 15)\n" + 
7226
		"3. WARNING in p\\DCBug.java (at line 20)\n" + 
7374
		"	private static void check_break ()\n" + 
7375
		"	                    ^^^^^^^^^^^^^^\n" + 
7376
		"The method check_break() from the type DCBug is never used locally\n" + 
7377
		"----------\n" + 
7378
		"4. WARNING in p\\DCBug.java (at line 20)\n" + 
7379
		"	outer:\n" + 
7227
		"	outer:\n" + 
7380
		"	^^^^^\n" + 
7228
		"	^^^^^\n" + 
7381
		"The label outer is never explicitly referenced\n" + 
7229
		"The label outer is never explicitly referenced\n" + 
7382
		"----------\n" + 
7230
		"----------\n" + 
7383
		"5. WARNING in p\\DCBug.java (at line 23)\n" + 
7231
		"4. WARNING in p\\DCBug.java (at line 23)\n" + 
7384
		"	middle:\n" + 
7232
		"	middle:\n" + 
7385
		"	^^^^^^\n" + 
7233
		"	^^^^^^\n" + 
7386
		"The label middle is never explicitly referenced\n" + 
7234
		"The label middle is never explicitly referenced\n" + 
7387
		"----------\n" + 
7235
		"----------\n" + 
7388
		"6. WARNING in p\\DCBug.java (at line 41)\n" + 
7236
		"5. WARNING in p\\DCBug.java (at line 41)\n" + 
7389
		"	outer:\n" + 
7237
		"	outer:\n" + 
7390
		"	^^^^^\n" + 
7238
		"	^^^^^\n" + 
7391
		"The label outer is never explicitly referenced\n" + 
7239
		"The label outer is never explicitly referenced\n" + 
7392
		"----------\n" + 
7240
		"----------\n" + 
7393
		"7. WARNING in p\\DCBug.java (at line 42)\n" + 
7241
		"6. WARNING in p\\DCBug.java (at line 42)\n" + 
7394
		"	for (int i = 0; i < 1000; i++)\n" + 
7242
		"	for (int i = 0; i < 1000; i++)\n" + 
7395
		"	                          ^^^\n" + 
7243
		"	                          ^^^\n" + 
7396
		"Dead code\n" + 
7244
		"Dead code\n" + 
7397
		"----------\n" + 
7245
		"----------\n" + 
7398
		"8. WARNING in p\\DCBug.java (at line 45)\n" + 
7246
		"7. WARNING in p\\DCBug.java (at line 45)\n" + 
7399
		"	for (int j = 0; j < 1000; j++)\n" + 
7247
		"	for (int j = 0; j < 1000; j++)\n" + 
7400
		"	                          ^^^\n" + 
7248
		"	                          ^^^\n" + 
7401
		"Dead code\n" + 
7249
		"Dead code\n" + 
7402
		"----------\n" + 
7250
		"----------\n" + 
7403
		"9. WARNING in p\\DCBug.java (at line 47)\n" + 
7251
		"8. WARNING in p\\DCBug.java (at line 47)\n" + 
7404
		"	inner:\n" + 
7252
		"	inner:\n" + 
7405
		"	^^^^^\n" + 
7253
		"	^^^^^\n" + 
7406
		"The label inner is never explicitly referenced\n" + 
7254
		"The label inner is never explicitly referenced\n" + 
7407
		"----------\n" + 
7255
		"----------\n" + 
7408
		"10. WARNING in p\\DCBug.java (at line 48)\n" + 
7256
		"9. WARNING in p\\DCBug.java (at line 48)\n" + 
7409
		"	for (int k = 0; k < 1000; k++)\n" + 
7257
		"	for (int k = 0; k < 1000; k++)\n" + 
7410
		"	                          ^^^\n" + 
7258
		"	                          ^^^\n" + 
7411
		"Dead code\n" + 
7259
		"Dead code\n" + 
7412
		"----------\n" + 
7260
		"----------\n" + 
7413
		"11. WARNING in p\\DCBug.java (at line 63)\n" + 
7261
		"10. WARNING in p\\DCBug.java (at line 63)\n" + 
7414
		"	middle:\n" + 
7262
		"	middle:\n" + 
7415
		"	^^^^^^\n" + 
7263
		"	^^^^^^\n" + 
7416
		"The label middle is never explicitly referenced\n" + 
7264
		"The label middle is never explicitly referenced\n" + 
7417
		"----------\n" + 
7265
		"----------\n" + 
7418
		"12. WARNING in p\\DCBug.java (at line 66)\n" + 
7266
		"11. WARNING in p\\DCBug.java (at line 66)\n" + 
7419
		"	inner:\n" + 
7267
		"	inner:\n" + 
7420
		"	^^^^^\n" + 
7268
		"	^^^^^\n" + 
7421
		"The label inner is never explicitly referenced\n" + 
7269
		"The label inner is never explicitly referenced\n" + 
7422
		"----------\n" + 
7270
		"----------\n" + 
7423
		"13. WARNING in p\\DCBug.java (at line 67)\n" + 
7271
		"12. WARNING in p\\DCBug.java (at line 67)\n" + 
7424
		"	for (int k = 0; k < 1000; k++)\n" + 
7272
		"	for (int k = 0; k < 1000; k++)\n" + 
7425
		"	                          ^^^\n" + 
7273
		"	                          ^^^\n" + 
7426
		"Dead code\n" + 
7274
		"Dead code\n" + 
7427
		"----------\n" + 
7275
		"----------\n" + 
7428
		"14. WARNING in p\\DCBug.java (at line 90)\n" + 
7276
		"13. WARNING in p\\DCBug.java (at line 90)\n" + 
7429
		"	{\n" + 
7277
		"	{\n" + 
7430
		"       i = 20;\n" + 
7278
		"       i = 20;\n" + 
7431
		"       continue;\n" + 
7279
		"       continue;\n" + 
Lines 7625-7636 Link Here
7625
			"}",
7473
			"}",
7626
		},
7474
		},
7627
		"----------\n" +
7475
		"----------\n" +
7628
		"1. WARNING in p\\Outer.java (at line 7)\n" +
7476
		"1. ERROR in p\\Outer.java (at line 7)\n" +
7629
		"	int n = count; // another compiler rejects\n" +
7630
		"	    ^\n" +
7631
		"The field Local.n is never read locally\n" +
7632
		"----------\n" +
7633
		"2. ERROR in p\\Outer.java (at line 7)\n" +
7634
		"	int n = count; // another compiler rejects\n" +
7477
		"	int n = count; // another compiler rejects\n" +
7635
		"	        ^^^^^\n" +
7478
		"	        ^^^^^\n" +
7636
		"The local variable count may not have been initialized\n" +
7479
		"The local variable count may not have been initialized\n" +
Lines 7738-7760 Link Here
7738
7581
7739
		},
7582
		},
7740
		"----------\n" +
7583
		"----------\n" +
7741
		"1. WARNING in p\\a\\Init.java (at line 9)\n" +
7584
		"1. ERROR in p\\a\\Init.java (at line 9)\n" +
7742
		"	int j = i;  // Javac complains here (Jikes does not)\n" +
7743
		"	    ^\n" +
7744
		"The field Local.j is never read locally\n" +
7745
		"----------\n" +
7746
		"2. ERROR in p\\a\\Init.java (at line 9)\n" +
7747
		"	int j = i;  // Javac complains here (Jikes does not)\n" +
7585
		"	int j = i;  // Javac complains here (Jikes does not)\n" +
7748
		"	        ^\n" +
7586
		"	        ^\n" +
7749
		"The local variable i may not have been initialized\n" +
7587
		"The local variable i may not have been initialized\n" +
7750
		"----------\n" +
7588
		"----------\n" +
7751
		"----------\n" +
7589
		"----------\n" +
7752
		"1. WARNING in p\\a\\Outer.java (at line 9)\n" +
7590
		"1. ERROR in p\\a\\Outer.java (at line 9)\n" +
7753
		"	int n = count; // another compiler rejects\n" +
7754
		"	    ^\n" +
7755
		"The field Local.n is never read locally\n" +
7756
		"----------\n" +
7757
		"2. ERROR in p\\a\\Outer.java (at line 9)\n" +
7758
		"	int n = count; // another compiler rejects\n" +
7591
		"	int n = count; // another compiler rejects\n" +
7759
		"	        ^^^^^\n" +
7592
		"	        ^^^^^\n" +
7760
		"The local variable count may not have been initialized\n" +
7593
		"The local variable count may not have been initialized\n" +
Lines 7817-7848 Link Here
7817
7650
7818
		}, //TODO should improve error message to suggest addition of explicit constructor instead
7651
		}, //TODO should improve error message to suggest addition of explicit constructor instead
7819
		"----------\n" +
7652
		"----------\n" +
7820
		"1. WARNING in p\\z\\AClass.java (at line 13)\n" +
7821
		"	static private class Inner3 {\n" +
7822
		"	                     ^^^^^^\n" +
7823
		"The type AClass.Inner3 is never used locally\n" +
7824
		"----------\n" +
7825
		"2. WARNING in p\\z\\AClass.java (at line 14)\n" +
7826
		"	String test() {\n" +
7827
		"	       ^^^^^^\n" +
7828
		"The method test() from the type AClass.Inner3 is never used locally\n" +
7829
		"----------\n" +
7830
		"3. WARNING in p\\z\\AClass.java (at line 18)\n" +
7831
		"	private class Inner4 {\n" +
7832
		"	              ^^^^^^\n" +
7833
		"The type AClass.Inner4 is never used locally\n" +
7834
		"----------\n" +
7835
		"4. WARNING in p\\z\\AClass.java (at line 19)\n" +
7836
		"	String test() {\n" +
7837
		"	       ^^^^^^\n" +
7838
		"The method test() from the type AClass.Inner4 is never used locally\n" +
7839
		"----------\n" +
7840
		"5. WARNING in p\\z\\AClass.java (at line 31)\n" +
7841
		"	public String test() {\n" +
7842
		"	              ^^^^^^\n" +
7843
		"The method test() from the type new Object(){} is never used locally\n" +
7844
		"----------\n" +
7845
		"----------\n" +
7846
		"1. ERROR in p\\z\\AClassExtension.java (at line 2)\n" +
7653
		"1. ERROR in p\\z\\AClassExtension.java (at line 2)\n" +
7847
		"	public class AClassExtension extends AClass.Inner1 {}\n" +
7654
		"	public class AClassExtension extends AClass.Inner1 {}\n" +
7848
		"	             ^^^^^^^^^^^^^^^\n" +
7655
		"	             ^^^^^^^^^^^^^^^\n" +
Lines 8603-8613 Link Here
8603
	"----------\n" +
8410
	"----------\n" +
8604
	"3. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" +
8411
	"3. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" +
8605
	"	int x = i; };        // bad since from inside inner\n" +
8412
	"	int x = i; };        // bad since from inside inner\n" +
8606
	"	    ^\n" +
8607
	"The field new Object(){}.x is never read locally\n" +
8608
	"----------\n" +
8609
	"4. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" +
8610
	"	int x = i; };        // bad since from inside inner\n" +
8611
	"	        ^\n" +
8413
	"	        ^\n" +
8612
	"Read access to enclosing field A.i is emulated by a synthetic accessor method\n" +
8414
	"Read access to enclosing field A.i is emulated by a synthetic accessor method\n" +
8613
	"----------\n" +
8415
	"----------\n" +
Lines 9027-9038 Link Here
9027
	"	int i = new AA().new Inner().i; // THIS LINE SHOULD CAUSE AN ERROR\n" +
8829
	"	int i = new AA().new Inner().i; // THIS LINE SHOULD CAUSE AN ERROR\n" +
9028
	"	                     ^^^^^\n" +
8830
	"	                     ^^^^^\n" +
9029
	"The type AA.Inner is not visible\n" +
8831
	"The type AA.Inner is not visible\n" +
9030
	"----------\n" +
9031
	"----------\n" +
9032
	"1. WARNING in p\\k\\AA.java (at line 4)\n" +
9033
	"	int i = 10;\n" +
9034
	"	    ^\n" +
9035
	"The field AA.Inner.i is never read locally\n" +
9036
	"----------\n");
8832
	"----------\n");
9037
}
8833
}
9038
public void test227() {
8834
public void test227() {
Lines 9228-9243 Link Here
9228
		"	             ^\n" +
9024
		"	             ^\n" +
9229
		"X cannot be resolved to a type\n" +
9025
		"X cannot be resolved to a type\n" +
9230
		"----------\n" +
9026
		"----------\n" +
9231
		"9. WARNING in p\\h\\X1.java (at line 29)\n" +
9232
		"	class Local {\n" +
9233
		"	      ^^^^^\n" +
9234
		"The type Local is never used locally\n" +
9235
		"----------\n" +
9236
		"10. WARNING in p\\h\\X1.java (at line 30)\n" +
9237
		"	void foo() {\n" +
9238
		"	     ^^^^^\n" +
9239
		"The method foo() from the type Local is never used locally\n" +
9240
		"----------\n" +
9241
		"----------\n" +
9027
		"----------\n" +
9242
		"1. WARNING in p\\h\\B.java (at line 2)\n" +
9028
		"1. WARNING in p\\h\\B.java (at line 2)\n" +
9243
		"	class B extends Exception {\n" +
9029
		"	class B extends Exception {\n" +
Lines 9513-9524 Link Here
9513
9299
9514
		},
9300
		},
9515
		"----------\n" + 
9301
		"----------\n" + 
9516
		"1. WARNING in p\\d\\One1.java (at line 7)\n" + 
9302
		"1. WARNING in p\\d\\One1.java (at line 8)\n" + 
9517
		"	public void problem2() {\n" + 
9518
		"	            ^^^^^^^^^^\n" + 
9519
		"The method problem2() from the type new Object(){} is never used locally\n" + 
9520
		"----------\n" + 
9521
		"2. WARNING in p\\d\\One1.java (at line 8)\n" + 
9522
		"	if(dialog == 3) return;\n" + 
9303
		"	if(dialog == 3) return;\n" + 
9523
		"	                ^^^^^^^\n" + 
9304
		"	                ^^^^^^^\n" + 
9524
		"Dead code\n" + 
9305
		"Dead code\n" + 
Lines 9529-9606 Link Here
9529
		"	             ^^^^^^^^\n" + 
9310
		"	             ^^^^^^^^\n" + 
9530
		"The serializable class JE_5_AWT does not declare a static final serialVersionUID field of type long\n" + 
9311
		"The serializable class JE_5_AWT does not declare a static final serialVersionUID field of type long\n" + 
9531
		"----------\n" + 
9312
		"----------\n" + 
9532
		"2. WARNING in p\\d\\JE_5_AWT.java (at line 21)\n" + 
9313
		"2. ERROR in p\\d\\JE_5_AWT.java (at line 26)\n" + 
9533
		"	Object obj = JE_5_AWT.this; //<---------OK\n" + 
9534
		"	       ^^^\n" + 
9535
		"The field new Object(){}.obj is never read locally\n" + 
9536
		"----------\n" + 
9537
		"3. WARNING in p\\d\\JE_5_AWT.java (at line 26)\n" + 
9538
		"	Object obj = JE_5_AWT.this; //<---------KO \n" + 
9539
		"	       ^^^\n" + 
9540
		"The field new Object(){}.obj is never read locally\n" + 
9541
		"----------\n" + 
9542
		"4. ERROR in p\\d\\JE_5_AWT.java (at line 26)\n" + 
9543
		"	Object obj = JE_5_AWT.this; //<---------KO \n" + 
9314
		"	Object obj = JE_5_AWT.this; //<---------KO \n" + 
9544
		"	             ^^^^^^^^^^^^^\n" + 
9315
		"	             ^^^^^^^^^^^^^\n" + 
9545
		"No enclosing instance of the type JE_5_AWT is accessible in scope\n" + 
9316
		"No enclosing instance of the type JE_5_AWT is accessible in scope\n" + 
9546
		"----------\n" + 
9317
		"----------\n" + 
9547
		"5. ERROR in p\\d\\JE_5_AWT.java (at line 32)\n" + 
9318
		"3. ERROR in p\\d\\JE_5_AWT.java (at line 32)\n" + 
9548
		"	Object obj2 = d;    // KO\n" + 
9319
		"	Object obj2 = d;    // KO\n" + 
9549
		"	              ^\n" + 
9320
		"	              ^\n" + 
9550
		"Cannot refer to an instance field d while explicitly invoking a constructor\n" + 
9321
		"Cannot refer to an instance field d while explicitly invoking a constructor\n" + 
9551
		"----------\n" + 
9322
		"----------\n" + 
9552
		"6. WARNING in p\\d\\JE_5_AWT.java (at line 37)\n" + 
9323
		"4. ERROR in p\\d\\JE_5_AWT.java (at line 50)\n" + 
9553
		"	Object myself() {\n" + 
9554
		"	       ^^^^^^^^\n" + 
9555
		"The method myself() from the type new Object(){} is never used locally\n" + 
9556
		"----------\n" + 
9557
		"7. WARNING in p\\d\\JE_5_AWT.java (at line 43)\n" + 
9558
		"	class Local {\n" + 
9559
		"	      ^^^^^\n" + 
9560
		"The type Local is never used locally\n" + 
9561
		"----------\n" + 
9562
		"8. WARNING in p\\d\\JE_5_AWT.java (at line 44)\n" + 
9563
		"	JE_5_AWT obj = JE_5_AWT.this;\n" + 
9564
		"	         ^^^\n" + 
9565
		"The field Local.obj is never read locally\n" + 
9566
		"----------\n" + 
9567
		"9. WARNING in p\\d\\JE_5_AWT.java (at line 49)\n" + 
9568
		"	Object outer() {\n" + 
9569
		"	       ^^^^^^^\n" + 
9570
		"The method outer() from the type new Object(){} is never used locally\n" + 
9571
		"----------\n" + 
9572
		"10. ERROR in p\\d\\JE_5_AWT.java (at line 50)\n" + 
9573
		"	return JE_5_AWT.this; //<---- KO\n" + 
9324
		"	return JE_5_AWT.this; //<---- KO\n" + 
9574
		"	       ^^^^^^^^^^^^^\n" + 
9325
		"	       ^^^^^^^^^^^^^\n" + 
9575
		"No enclosing instance of the type JE_5_AWT is accessible in scope\n" + 
9326
		"No enclosing instance of the type JE_5_AWT is accessible in scope\n" + 
9576
		"----------\n" + 
9327
		"----------\n" + 
9577
		"11. WARNING in p\\d\\JE_5_AWT.java (at line 55)\n" + 
9578
		"	class Local extends Thread {\n" + 
9579
		"	      ^^^^^\n" + 
9580
		"The type Local is never used locally\n" + 
9581
		"----------\n" + 
9328
		"----------\n" + 
9582
		"12. WARNING in p\\d\\JE_5_AWT.java (at line 56)\n" + 
9329
		"1. WARNING in p\\d\\One.java (at line 14)\n" + 
9583
		"	Local() {\n" + 
9584
		"	^^^^^^^\n" + 
9585
		"The constructor Local() is never used locally\n" + 
9586
		"----------\n" + 
9587
		"----------\n" + 
9588
		"1. WARNING in p\\d\\One.java (at line 13)\n" + 
9589
		"	public void problem2() {\n" + 
9590
		"	            ^^^^^^^^^^\n" + 
9591
		"The method problem2() from the type new Object(){} is never used locally\n" + 
9592
		"----------\n" + 
9593
		"2. WARNING in p\\d\\One.java (at line 14)\n" + 
9594
		"	if(dialog == 3) return;\n" + 
9330
		"	if(dialog == 3) return;\n" + 
9595
		"	                ^^^^^^^\n" + 
9331
		"	                ^^^^^^^\n" + 
9596
		"Dead code\n" + 
9332
		"Dead code\n" + 
9597
		"----------\n" + 
9333
		"----------\n" + 
9598
		"3. ERROR in p\\d\\One.java (at line 24)\n" + 
9334
		"2. ERROR in p\\d\\One.java (at line 24)\n" + 
9599
		"	fireTableCellUpdated();\n" + 
9335
		"	fireTableCellUpdated();\n" + 
9600
		"	^^^^^^^^^^^^^^^^^^^^\n" + 
9336
		"	^^^^^^^^^^^^^^^^^^^^\n" + 
9601
		"Cannot refer to an instance method while explicitly invoking a constructor\n" + 
9337
		"Cannot refer to an instance method while explicitly invoking a constructor\n" + 
9602
		"----------\n" +
9338
		"----------\n" +
9603
		"4. WARNING in p\\d\\One.java (at line 40)\n" +
9339
		"3. WARNING in p\\d\\One.java (at line 40)\n" +
9604
		"	if (m == null) return;\n" +
9340
		"	if (m == null) return;\n" +
9605
		"	               ^^^^^^^\n" +
9341
		"	               ^^^^^^^\n" +
9606
		"Dead code\n" +
9342
		"Dead code\n" +
Lines 10339-10349 Link Here
10339
		"	super.init();	\n" +
10075
		"	super.init();	\n" +
10340
		"	^^^^^^^^^^^^\n" +
10076
		"	^^^^^^^^^^^^\n" +
10341
		"Cannot directly invoke the abstract method init() for the type I\n" +
10077
		"Cannot directly invoke the abstract method init() for the type I\n" +
10342
		"----------\n" +
10343
		"2. WARNING in p1\\X.java (at line 10)\n" +
10344
		"	private void init(){}	\n" +
10345
		"	             ^^^^^^\n" +
10346
		"The method init() from the type AbstractZ is never used locally\n" +
10347
		"----------\n"
10078
		"----------\n"
10348
);
10079
);
10349
}
10080
}
Lines 10565-10601 Link Here
10565
			"}	\n"
10296
			"}	\n"
10566
		},
10297
		},
10567
		"----------\n" +
10298
		"----------\n" +
10568
		"1. WARNING in p1\\X.java (at line 5)\n" +
10299
		"1. WARNING in p1\\X.java (at line 8)\n" +
10569
		"	class Local extends C {	\n" +
10570
		"	      ^^^^^\n" +
10571
		"The type Local is never used locally\n" +
10572
		"----------\n" +
10573
		"2. WARNING in p1\\X.java (at line 8)\n" +
10574
		"	public final int CST2 = 12;	\n" +
10300
		"	public final int CST2 = 12;	\n" +
10575
		"	                 ^^^^\n" +
10301
		"	                 ^^^^\n" +
10576
		"The field Local.CST2 is hiding a field from type C\n" +
10302
		"The field Local.CST2 is hiding a field from type C\n" +
10577
		"----------\n" +
10303
		"----------\n" +
10578
		"3. WARNING in p1\\X.java (at line 8)\n" +
10304
		"2. ERROR in p1\\X.java (at line 11)\n" +
10579
		"	public final int CST2 = 12;	\n" +
10580
		"	                 ^^^^\n" +
10581
		"The field Local.CST2 is never read locally\n" +
10582
		"----------\n" +
10583
		"4. WARNING in p1\\X.java (at line 9)\n" +
10584
		"	void foo(int i){	\n" +
10585
		"	     ^^^^^^^^^^\n" +
10586
		"The method foo(int) from the type Local is never used locally\n" +
10587
		"----------\n" +
10588
		"5. ERROR in p1\\X.java (at line 11)\n" +
10589
		"	case this.CST : 	\n" +
10305
		"	case this.CST : 	\n" +
10590
		"	     ^^^^^^^^\n" +
10306
		"	     ^^^^^^^^\n" +
10591
		"case expressions must be constant expressions\n" +
10307
		"case expressions must be constant expressions\n" +
10592
		"----------\n" +
10308
		"----------\n" +
10593
		"6. ERROR in p1\\X.java (at line 15)\n" +
10309
		"3. ERROR in p1\\X.java (at line 15)\n" +
10594
		"	case super.CST2 : 	\n" +
10310
		"	case super.CST2 : 	\n" +
10595
		"	     ^^^^^^^^^^\n" +
10311
		"	     ^^^^^^^^^^\n" +
10596
		"case expressions must be constant expressions\n" +
10312
		"case expressions must be constant expressions\n" +
10597
		"----------\n" +
10313
		"----------\n" +
10598
		"7. ERROR in p1\\X.java (at line 17)\n" +
10314
		"4. ERROR in p1\\X.java (at line 17)\n" +
10599
		"	case X.this.CST3 : 	\n" +
10315
		"	case X.this.CST3 : 	\n" +
10600
		"	     ^^^^^^^^^^^\n" +
10316
		"	     ^^^^^^^^^^^\n" +
10601
		"case expressions must be constant expressions\n" +
10317
		"case expressions must be constant expressions\n" +
Lines 11685-11696 Link Here
11685
		},
11401
		},
11686
		null, customOptions,
11402
		null, customOptions,
11687
		"----------\n" + 
11403
		"----------\n" + 
11688
		"1. WARNING in Test.java (at line 3)\n" + 
11404
		"1. WARNING in Test.java (at line 12)\n" + 
11689
		"	private void doTest() {	\n" + 
11690
		"	             ^^^^^^^^\n" + 
11691
		"The method doTest() from the type Test is never used locally\n" + 
11692
		"----------\n" + 
11693
		"2. WARNING in Test.java (at line 12)\n" + 
11694
		"	int i = 0;	\n" + 
11405
		"	int i = 0;	\n" + 
11695
		"	    ^\n" + 
11406
		"	    ^\n" + 
11696
		"The local variable i is never read\n" + 
11407
		"The local variable i is never read\n" + 
Lines 12271-12287 Link Here
12271
			"}	\n",
11982
			"}	\n",
12272
		},
11983
		},
12273
		"----------\n" +
11984
		"----------\n" +
12274
		"1. WARNING in TestEclipseBug.java (at line 2)\n" +
11985
		"1. ERROR in TestEclipseBug.java (at line 12)\n" +
12275
		"	private Object root;	\n" +
12276
		"	               ^^^^\n" +
12277
		"The field TestEclipseBug.root is never read locally\n" +
12278
		"----------\n" +
12279
		"2. WARNING in TestEclipseBug.java (at line 3)\n" +
12280
		"	private Number count;	\n" +
12281
		"	               ^^^^^\n" +
12282
		"The field TestEclipseBug.count is never read locally\n" +
12283
		"----------\n" +
12284
		"3. ERROR in TestEclipseBug.java (at line 12)\n" +
12285
		"	this(objEntityName); // recursive constructor call	\n" +
11986
		"	this(objEntityName); // recursive constructor call	\n" +
12286
		"	^^^^^^^^^^^^^^^^^^^^\n" +
11987
		"	^^^^^^^^^^^^^^^^^^^^\n" +
12287
		"Recursive constructor invocation TestEclipseBug(String)\n" +
11988
		"Recursive constructor invocation TestEclipseBug(String)\n" +
Lines 12307-12323 Link Here
12307
			"}	\n",
12008
			"}	\n",
12308
		},
12009
		},
12309
		"----------\n" +
12010
		"----------\n" +
12310
		"1. WARNING in p\\X.java (at line 3)\n" + 
12311
		"	private class Y {	\n" + 
12312
		"	              ^\n" + 
12313
		"The type X.Y is never used locally\n" + 
12314
		"----------\n" + 
12315
		"2. WARNING in p\\X.java (at line 4)\n" +
12316
		"	public class Z {	\n" +
12317
		"	             ^\n" +
12318
		"The type X.Y.Z is never used locally\n" +
12319
		"----------\n" +
12320
		"----------\n" +
12321
		"1. ERROR in q\\Y.java (at line 2)\n" +
12011
		"1. ERROR in q\\Y.java (at line 2)\n" +
12322
		"	import p.X.Y.Z;	\n" +
12012
		"	import p.X.Y.Z;	\n" +
12323
		"	       ^^^^^\n" +
12013
		"	       ^^^^^\n" +
Lines 12422-12433 Link Here
12422
			"	}	\n"+
12112
			"	}	\n"+
12423
			"}			\n"
12113
			"}			\n"
12424
		},
12114
		},
12425
		"----------\n" +
12115
		"",
12426
		"1. WARNING in X.java (at line 2)\n" +
12427
		"	private int foo() {	\n" +
12428
		"	            ^^^^^\n" +
12429
		"The method foo() from the type X is never used locally\n" +
12430
		"----------\n",
12431
		null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
12116
		null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
12432
}
12117
}
12433
// no private unused if syntax error
12118
// no private unused if syntax error
Lines 12473-12484 Link Here
12473
			"}	\n",
12158
			"}	\n",
12474
		},
12159
		},
12475
		"----------\n" +
12160
		"----------\n" +
12476
		"1. WARNING in X.java (at line 2)\n" +
12477
		"	private int foo() {	\n" +
12478
		"	            ^^^^^\n" +
12479
		"The method foo() from the type X is never used locally\n" +
12480
		"----------\n" +
12481
		"----------\n" +
12482
		"1. ERROR in Y.java (at line 1)\n" +
12161
		"1. ERROR in Y.java (at line 1)\n" +
12483
		"	public class Y extends X {	\n" +
12162
		"	public class Y extends X {	\n" +
12484
		"	             ^\n" +
12163
		"	             ^\n" +
Lines 12971-12987 Link Here
12971
			"}	\n",
12650
			"}	\n",
12972
		},
12651
		},
12973
		"----------\n" +
12652
		"----------\n" +
12974
		"1. WARNING in X.java (at line 2)\n" +
12653
		"1. WARNING in X.java (at line 6)\n" +
12975
		"	private void foo(int i) {	\n" +
12976
		"	             ^^^^^^^^^^\n" +
12977
		"The method foo(int) from the type X is never used locally\n" +
12978
		"----------\n" +
12979
		"2. WARNING in X.java (at line 5)\n" +
12980
		"	void bar() { \n" +
12981
		"	     ^^^^^\n" +
12982
		"The method bar() from the type new Object(){} is never used locally\n" +
12983
		"----------\n" +
12984
		"3. WARNING in X.java (at line 6)\n" +
12985
		"	foo(2);	\n" +
12654
		"	foo(2);	\n" +
12986
		"	^^^^^^\n" +
12655
		"	^^^^^^\n" +
12987
		"Access to enclosing method foo(int) from the type X is emulated by a synthetic accessor method\n" +
12656
		"Access to enclosing method foo(int) from the type X is emulated by a synthetic accessor method\n" +
Lines 13010-13026 Link Here
13010
			"}	\n",
12679
			"}	\n",
13011
		},
12680
		},
13012
		"----------\n" +
12681
		"----------\n" +
13013
		"1. WARNING in X.java (at line 2)\n" +
12682
		"1. WARNING in X.java (at line 7)\n" +
13014
		"	private class Member	{	\n" +
13015
		"	              ^^^^^^\n" +
13016
		"The type X.Member is never used locally\n" +
13017
		"----------\n" +
13018
		"2. WARNING in X.java (at line 3)\n" +
13019
		"	private Member foo(int i) {	\n" +
13020
		"	               ^^^^^^^^^^\n" +
13021
		"The method foo(int) from the type X.Member is never used locally\n" +
13022
		"----------\n" +
13023
		"3. WARNING in X.java (at line 7)\n" +
13024
		"	return foo(2);	\n" +
12683
		"	return foo(2);	\n" +
13025
		"	       ^^^^^^\n" +
12684
		"	       ^^^^^^\n" +
13026
		"Access to enclosing method foo(int) from the type X.Member is emulated by a synthetic accessor method\n" +
12685
		"Access to enclosing method foo(int) from the type X.Member is emulated by a synthetic accessor method\n" +
Lines 13046-13062 Link Here
13046
			"}	\n",
12705
			"}	\n",
13047
		},
12706
		},
13048
		"----------\n" +
12707
		"----------\n" +
13049
		"1. WARNING in X.java (at line 2)\n" +
12708
		"1. WARNING in X.java (at line 5)\n" +
13050
		"	private int field = 	\n" +
13051
		"	            ^^^^^\n" +
13052
		"The field X.field is never read locally\n" +
13053
		"----------\n" +
13054
		"2. WARNING in X.java (at line 5)\n" +
13055
		"	field = 0;	\n" +
12709
		"	field = 0;	\n" +
13056
		"	^^^^^\n" +
12710
		"	^^^^^\n" +
13057
		"Write access to enclosing field X.field is emulated by a synthetic accessor method\n" +
12711
		"Write access to enclosing field X.field is emulated by a synthetic accessor method\n" +
13058
		"----------\n" +
12712
		"----------\n" +
13059
		"3. WARNING in X.java (at line 6)\n" +
12713
		"2. WARNING in X.java (at line 6)\n" +
13060
		"	return field;	\n" +
12714
		"	return field;	\n" +
13061
		"	       ^^^^^\n" +
12715
		"	       ^^^^^\n" +
13062
		"Read access to enclosing field X.field is emulated by a synthetic accessor method\n" +
12716
		"Read access to enclosing field X.field is emulated by a synthetic accessor method\n" +
Lines 13366-13377 Link Here
13366
		},
13020
		},
13367
		null, customOptions,
13021
		null, customOptions,
13368
		"----------\n" +
13022
		"----------\n" +
13369
		"1. WARNING in X.java (at line 2)\n" +
13023
		"1. ERROR in X.java (at line 3)\n" +
13370
		"	private int x = 0;\n" +
13371
		"	            ^\n" +
13372
		"The field X.x is never read locally\n" +
13373
		"----------\n" +
13374
		"2. ERROR in X.java (at line 3)\n" +
13375
		"	int foo(int x) {	\n" +
13024
		"	int foo(int x) {	\n" +
13376
		"	            ^\n" +
13025
		"	            ^\n" +
13377
		"The parameter x is hiding a field from type X\n" +
13026
		"The parameter x is hiding a field from type X\n" +
Lines 13399-13420 Link Here
13399
			"}	\n",
13048
			"}	\n",
13400
		},
13049
		},
13401
		"----------\n" +
13050
		"----------\n" +
13402
		"1. WARNING in X.java (at line 3)\n" +
13051
		"1. WARNING in X.java (at line 8)\n" +
13403
		"	private X nextX;	\n" +
13404
		"	          ^^^^^\n" +
13405
		"The field X.nextX is never read locally\n" +
13406
		"----------\n" +
13407
		"2. WARNING in X.java (at line 7)\n" +
13408
		"	void bar() { \n" +
13409
		"	     ^^^^^\n" +
13410
		"The method bar() from the type new Object(){} is never used locally\n" +
13411
		"----------\n" +
13412
		"3. WARNING in X.java (at line 8)\n" +
13413
		"	someX.nextX = null;	\n" +
13052
		"	someX.nextX = null;	\n" +
13414
		"	^^^^^\n" +
13053
		"	^^^^^\n" +
13415
		"Read access to enclosing field X.someX is emulated by a synthetic accessor method\n" +
13054
		"Read access to enclosing field X.someX is emulated by a synthetic accessor method\n" +
13416
		"----------\n" +
13055
		"----------\n" +
13417
		"4. WARNING in X.java (at line 8)\n" +
13056
		"2. WARNING in X.java (at line 8)\n" +
13418
		"	someX.nextX = null;	\n" +
13057
		"	someX.nextX = null;	\n" +
13419
		"	      ^^^^^\n" +
13058
		"	      ^^^^^\n" +
13420
		"Write access to enclosing field X.nextX is emulated by a synthetic accessor method\n" +
13059
		"Write access to enclosing field X.nextX is emulated by a synthetic accessor method\n" +
Lines 13874-13884 Link Here
13874
		"----------\n" +
13513
		"----------\n" +
13875
		"11. WARNING in p\\X.java (at line 13)\n" +
13514
		"11. WARNING in p\\X.java (at line 13)\n" +
13876
		"	class Object { };	\n" +
13515
		"	class Object { };	\n" +
13877
		"	      ^^^^^^\n" +
13878
		"The type Object is never used locally\n" +
13879
		"----------\n" +
13880
		"12. WARNING in p\\X.java (at line 13)\n" +
13881
		"	class Object { };	\n" +
13882
		"	                ^\n" +
13516
		"	                ^\n" +
13883
		"Unnecessary semicolon\n" +
13517
		"Unnecessary semicolon\n" +
13884
		"----------\n",
13518
		"----------\n",
Lines 13935-13956 Link Here
13935
		"	^\n" +
13569
		"	^\n" +
13936
		"Unnecessary semicolon\n" +
13570
		"Unnecessary semicolon\n" +
13937
		"----------\n" +
13571
		"----------\n" +
13938
		"6. WARNING in X.java (at line 9)\n" +
13572
		"6. WARNING in X.java (at line 10)\n" +
13939
		"	class L {\n" +
13940
		"	      ^\n" +
13941
		"The type L is never used locally\n" +
13942
		"----------\n" +
13943
		"7. WARNING in X.java (at line 10)\n" +
13944
		"	};//6\n" +
13573
		"	};//6\n" +
13945
		"	 ^\n" +
13574
		"	 ^\n" +
13946
		"Unnecessary semicolon\n" +
13575
		"Unnecessary semicolon\n" +
13947
		"----------\n" +
13576
		"----------\n" +
13948
		"8. WARNING in X.java (at line 11)\n" +
13577
		"7. WARNING in X.java (at line 11)\n" +
13949
		"	};//7\n" +
13578
		"	};//7\n" +
13950
		"	 ^\n" +
13579
		"	 ^\n" +
13951
		"Unnecessary semicolon\n" +
13580
		"Unnecessary semicolon\n" +
13952
		"----------\n" +
13581
		"----------\n" +
13953
		"9. WARNING in X.java (at line 12)\n" +
13582
		"8. WARNING in X.java (at line 12)\n" +
13954
		"	};//8\n" +
13583
		"	};//8\n" +
13955
		"	 ^\n" +
13584
		"	 ^\n" +
13956
		"Unnecessary semicolon\n" +
13585
		"Unnecessary semicolon\n" +
Lines 15406-15416 Link Here
15406
			"}\n"
15035
			"}\n"
15407
		},
15036
		},
15408
		null, customOptions,
15037
		null, customOptions,
15409
		"----------\n" +
15038
		"----------\n" + 
15410
		"1. ERROR in X.java (at line 6)\n" +
15039
		"1. ERROR in X.java (at line 6)\n" + 
15411
		"	private final int unused = 0;\n" +
15040
		"	private final int unused = 0;\n" + 
15412
		"	                  ^^^^^^\n" +
15041
		"	                  ^^^^^^\n" + 
15413
		"The field X.unused is never read locally\n" +
15042
		"The field X.unused is never read locally\n" + 
15414
		"----------\n",
15043
		"----------\n",
15415
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
15044
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
15416
}
15045
}
Lines 16385-16441 Link Here
16385
			"	}\n" +
16014
			"	}\n" +
16386
			"}\n"
16015
			"}\n"
16387
		},
16016
		},
16388
		"----------\n" +
16017
		"",
16389
		"1. WARNING in X.java (at line 4)\n" +
16390
		"	int unused1 = this.unused1 + 1;\n" +
16391
		"	    ^^^^^^^\n" +
16392
		"The field new Object(){}.unused1 is never read locally\n" +
16393
		"----------\n" +
16394
		"2. WARNING in X.java (at line 5)\n" +
16395
		"	void foo1() {}\n" +
16396
		"	     ^^^^^^\n" +
16397
		"The method foo1() from the type new Object(){} is never used locally\n" +
16398
		"----------\n" +
16399
		"3. WARNING in X.java (at line 8)\n" +
16400
		"	class Local {\n" +
16401
		"	      ^^^^^\n" +
16402
		"The type Local is never used locally\n" +
16403
		"----------\n" +
16404
		"4. WARNING in X.java (at line 9)\n" +
16405
		"	class LMember implements Runnable {\n" +
16406
		"	      ^^^^^^^\n" +
16407
		"The type Local.LMember is never used locally\n" +
16408
		"----------\n" +
16409
		"5. WARNING in X.java (at line 10)\n" +
16410
		"	LMember(int i) {}\n" +
16411
		"	^^^^^^^^^^^^^^\n" +
16412
		"The constructor Local.LMember(int) is never used locally\n" +
16413
		"----------\n" +
16414
		"6. WARNING in X.java (at line 11)\n" +
16415
		"	int unused2;\n" +
16416
		"	    ^^^^^^^\n" +
16417
		"The field Local.LMember.unused2 is never read locally\n" +
16418
		"----------\n" +
16419
		"7. WARNING in X.java (at line 12)\n" +
16420
		"	void foo2() {}\n" +
16421
		"	     ^^^^^^\n" +
16422
		"The method foo2() from the type Local.LMember is never used locally\n" +
16423
		"----------\n" +
16424
		"8. WARNING in X.java (at line 15)\n" +
16425
		"	Local(int i) {}\n" +
16426
		"	^^^^^^^^^^^^\n" +
16427
		"The constructor Local(int) is never used locally\n" +
16428
		"----------\n" +
16429
		"9. WARNING in X.java (at line 16)\n" +
16430
		"	int unused3;\n" +
16431
		"	    ^^^^^^^\n" +
16432
		"The field Local.unused3 is never read locally\n" +
16433
		"----------\n" +
16434
		"10. WARNING in X.java (at line 17)\n" +
16435
		"	void foo3() {}\n" +
16436
		"	     ^^^^^^\n" +
16437
		"The method foo3() from the type Local is never used locally\n" +
16438
		"----------\n",
16439
		null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
16018
		null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
16440
}
16019
}
16441
public void test441() {
16020
public void test441() {
Lines 16492-16536 Link Here
16492
			"} \n"
16071
			"} \n"
16493
		},
16072
		},
16494
		"----------\n" +
16073
		"----------\n" +
16495
		"1. WARNING in X.java (at line 2)\n" +
16074
		"1. WARNING in X.java (at line 4)\n" +
16496
		"	private class M { \n" +
16497
		"	              ^\n" +
16498
		"The type X.M is never used locally\n" +
16499
		"----------\n" +
16500
		"2. WARNING in X.java (at line 3)\n" +
16501
		"	private class Member1 {} \n" +
16502
		"	              ^^^^^^^\n" +
16503
		"The type X.M.Member1 is never used locally\n" +
16504
		"----------\n" +
16505
		"3. WARNING in X.java (at line 4)\n" +
16506
		"	private class Member2 extends M { \n" +
16507
		"	              ^^^^^^^\n" +
16508
		"The type X.M.Member2 is never used locally\n" +
16509
		"----------\n" +
16510
		"4. WARNING in X.java (at line 4)\n" +
16511
		"	private class Member2 extends M { \n" +
16075
		"	private class Member2 extends M { \n" +
16512
		"	              ^^^^^^^\n" +
16076
		"	              ^^^^^^^\n" +
16513
		"Access to enclosing constructor X.M() is emulated by a synthetic accessor method\n" +
16077
		"Access to enclosing constructor X.M() is emulated by a synthetic accessor method\n" +
16514
		"----------\n" +
16515
		"5. WARNING in X.java (at line 8)\n" +
16516
		"	class Local1 {} \n" +
16517
		"	      ^^^^^^\n" +
16518
		"The type Local1 is never used locally\n" +
16519
		"----------\n" +
16520
		"6. WARNING in X.java (at line 9)\n" +
16521
		"	class Local2 { \n" +
16522
		"	      ^^^^^^\n" +
16523
		"The type Local2 is never used locally\n" +
16524
		"----------\n" +
16525
		"7. WARNING in X.java (at line 11)\n" +
16526
		"	class LMember2 extends Local2 { \n" +
16527
		"	      ^^^^^^^^\n" +
16528
		"The type Local2.LMember2 is never used locally\n" +
16529
		"----------\n" +
16530
		"8. WARNING in X.java (at line 13)\n" +
16531
		"	LMember1 m1;\n" +
16532
		"	         ^^\n" +
16533
		"The field Local2.m1 is never read locally\n" +
16534
		"----------\n",
16078
		"----------\n",
16535
		null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
16079
		null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
16536
16080
Lines 16562-16606 Link Here
16562
			"} \n"
16106
			"} \n"
16563
		},
16107
		},
16564
		"----------\n" +
16108
		"----------\n" +
16565
		"1. WARNING in X.java (at line 2)\n" +
16109
		"1. WARNING in X.java (at line 4)\n" +
16566
		"	private class M { \n" +
16567
		"	              ^\n" +
16568
		"The type X.M is never used locally\n" +
16569
		"----------\n" +
16570
		"2. WARNING in X.java (at line 3)\n" +
16571
		"	private class Member1 {} \n" +
16572
		"	              ^^^^^^^\n" +
16573
		"The type X.M.Member1 is never used locally\n" +
16574
		"----------\n" +
16575
		"3. WARNING in X.java (at line 4)\n" +
16576
		"	private class Member2 extends M { \n" +
16110
		"	private class Member2 extends M { \n" +
16577
		"	              ^^^^^^^\n" +
16111
		"	              ^^^^^^^\n" +
16578
		"Access to enclosing constructor X.M() is emulated by a synthetic accessor method\n" +
16112
		"Access to enclosing constructor X.M() is emulated by a synthetic accessor method\n" +
16579
		"----------\n" +
16580
		"4. WARNING in X.java (at line 6)\n" +
16581
		"	M.Member2 m2;\n" +
16582
		"	          ^^\n" +
16583
		"The field X.M.m2 is never read locally\n" +
16584
		"----------\n" +
16585
		"5. WARNING in X.java (at line 9)\n" +
16586
		"	class Local1 {} \n" +
16587
		"	      ^^^^^^\n" +
16588
		"The type Local1 is never used locally\n" +
16589
		"----------\n" +
16590
		"6. WARNING in X.java (at line 10)\n" +
16591
		"	class Local2 { \n" +
16592
		"	      ^^^^^^\n" +
16593
		"The type Local2 is never used locally\n" +
16594
		"----------\n" +
16595
		"7. WARNING in X.java (at line 11)\n" +
16596
		"	class LMember1 {} \n" +
16597
		"	      ^^^^^^^^\n" +
16598
		"The type Local2.LMember1 is never used locally\n" +
16599
		"----------\n" +
16600
		"8. WARNING in X.java (at line 12)\n" +
16601
		"	class LMember2 extends Local2 { \n" +
16602
		"	      ^^^^^^^^\n" +
16603
		"The type Local2.LMember2 is never used locally\n" +
16604
		"----------\n",
16113
		"----------\n",
16605
		null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
16114
		null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
16606
16115
Lines 16637-16668 Link Here
16637
				"} \n"
16146
				"} \n"
16638
			},
16147
			},
16639
		"----------\n" +
16148
		"----------\n" +
16640
		"1. WARNING in X.java (at line 2)\n" +
16149
		"1. ERROR in X.java (at line 4)\n" +
16641
		"	private class M { \n" +
16642
		"	              ^\n" +
16643
		"The type X.M is never used locally\n" +
16644
		"----------\n" +
16645
		"2. ERROR in X.java (at line 4)\n" +
16646
		"	static{} \n" +
16150
		"	static{} \n" +
16647
		"	      ^\n" +
16151
		"	      ^\n" +
16648
		"Cannot define static initializer in inner type X.M.Member1\n" +
16152
		"Cannot define static initializer in inner type X.M.Member1\n" +
16649
		"----------\n" +
16153
		"----------\n" +
16650
		"3. ERROR in X.java (at line 7)\n" +
16154
		"2. ERROR in X.java (at line 7)\n" +
16651
		"	static{} \n" +
16155
		"	static{} \n" +
16652
		"	      ^\n" +
16156
		"	      ^\n" +
16653
		"Cannot define static initializer in inner type X.M.Member2\n" +
16157
		"Cannot define static initializer in inner type X.M.Member2\n" +
16654
		"----------\n" +
16158
		"----------\n" +
16655
		"4. ERROR in X.java (at line 12)\n" +
16159
		"3. ERROR in X.java (at line 12)\n" +
16656
		"	static{} \n" +
16160
		"	static{} \n" +
16657
		"	      ^\n" +
16161
		"	      ^\n" +
16658
		"Cannot define static initializer in inner type Local1\n" +
16162
		"Cannot define static initializer in inner type Local1\n" +
16659
		"----------\n" +
16163
		"----------\n" +
16660
		"5. ERROR in X.java (at line 16)\n" +
16164
		"4. ERROR in X.java (at line 16)\n" +
16661
		"	static{} \n" +
16165
		"	static{} \n" +
16662
		"	      ^\n" +
16166
		"	      ^\n" +
16663
		"Cannot define static initializer in inner type Local2.LMember1\n" +
16167
		"Cannot define static initializer in inner type Local2.LMember1\n" +
16664
		"----------\n" +
16168
		"----------\n" +
16665
		"6. ERROR in X.java (at line 19)\n" +
16169
		"5. ERROR in X.java (at line 19)\n" +
16666
		"	static{} \n" +
16170
		"	static{} \n" +
16667
		"	      ^\n" +
16171
		"	      ^\n" +
16668
		"Cannot define static initializer in inner type Local2.LMember2\n" +
16172
		"Cannot define static initializer in inner type Local2.LMember2\n" +
(-)src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java (-17 / +5 lines)
Lines 38-43 Link Here
38
		options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
38
		options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
39
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED);
39
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED);
40
	}
40
	}
41
	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
42
	options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
43
	options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE);
44
	options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
41
	return options;
45
	return options;
42
}
46
}
43
public static Test suite() {
47
public static Test suite() {
Lines 1676-1687 Link Here
1676
			"}"
1680
			"}"
1677
		},
1681
		},
1678
		"----------\n" +
1682
		"----------\n" +
1679
		"1. WARNING in p\\A.java (at line 6)\n" +
1683
		"1. ERROR in p\\A.java (at line 8)\n" +
1680
		"	private int i;\n" +
1681
		"	            ^\n" +
1682
		"The field A.i is never read locally\n" +
1683
		"----------\n" +
1684
		"2. ERROR in p\\A.java (at line 8)\n" +
1685
		"	int x = i;\n" +
1684
		"	int x = i;\n" +
1686
		"	        ^\n" +
1685
		"	        ^\n" +
1687
		"Cannot make a static reference to the non-static field i\n" +
1686
		"Cannot make a static reference to the non-static field i\n" +
Lines 1999-2010 Link Here
1999
		"	Z someField;	\n" +
1998
		"	Z someField;	\n" +
2000
		"	^\n" +
1999
		"	^\n" +
2001
		"The type Z is defined in an inherited type and an enclosing scope\n" +
2000
		"The type Z is defined in an inherited type and an enclosing scope\n" +
2002
		"----------\n" +
2003
		"----------\n" +
2004
		"1. WARNING in q\\Y.java (at line 3)\n" +
2005
		"	private static class X {}	\n" +
2006
		"	                     ^\n" +
2007
		"The type Y.X is never used locally\n" +
2008
		"----------\n");
2001
		"----------\n");
2009
}
2002
}
2010
2003
Lines 2874-2884 Link Here
2874
		"	this.super();\n" +
2867
		"	this.super();\n" +
2875
		"	^^^^\n" +
2868
		"	^^^^\n" +
2876
		"Illegal enclosing instance specification for type Object\n" +
2869
		"Illegal enclosing instance specification for type Object\n" +
2877
		"----------\n" +
2878
		"3. WARNING in p\\X.java (at line 25)\n" +
2879
		"	private void a() { System.out.println(\"A\");} \n" +
2880
		"	             ^^^\n" +
2881
		"The method a() from the type X is never used locally\n" +
2882
		"----------\n");
2870
		"----------\n");
2883
}
2871
}
2884
/*
2872
/*
(-)src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java (-72 / +11 lines)
Lines 40-45 Link Here
40
		options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
40
		options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
41
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED);
41
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED);
42
	}
42
	}
43
	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
44
	options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
45
	options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE);
46
	options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
43
	return options;
47
	return options;
44
}
48
}
45
public static Test suite() {
49
public static Test suite() {
Lines 1752-1763 Link Here
1752
			"}"
1756
			"}"
1753
		},
1757
		},
1754
		"----------\n" +
1758
		"----------\n" +
1755
		"1. WARNING in p\\A.java (at line 6)\n" +
1759
		"1. ERROR in p\\A.java (at line 8)\n" +
1756
		"	private int i;\n" +
1757
		"	            ^\n" +
1758
		"The field A.i is never read locally\n" +
1759
		"----------\n" +
1760
		"2. ERROR in p\\A.java (at line 8)\n" +
1761
		"	int x = i;\n" +
1760
		"	int x = i;\n" +
1762
		"	        ^\n" +
1761
		"	        ^\n" +
1763
		"Cannot make a static reference to the non-static field i\n" +
1762
		"Cannot make a static reference to the non-static field i\n" +
Lines 1984-2009 Link Here
1984
			"}",
1983
			"}",
1985
		},
1984
		},
1986
		// compiler results
1985
		// compiler results
1987
		"----------\n" +  /* expected compiler log */
1988
		"1. WARNING in p\\FieldQualification.java (at line 5)\n" +
1989
		"	class Local {\n" +
1990
		"	      ^^^^^\n" +
1991
		"The type Local is never used locally\n" +
1992
		"----------\n" +
1986
		"----------\n" +
1993
		"2. WARNING in p\\FieldQualification.java (at line 6)\n" +
1987
		"1. WARNING in p\\FieldQualification.java (at line 6)\n" +
1994
		"	String field = \"Enclosing field for anonymous type\";\n" +
1988
		"	String field = \"Enclosing field for anonymous type\";\n" +
1995
		"	       ^^^^^\n" +
1989
		"	       ^^^^^\n" +
1996
		"The field Local.field is hiding a field from type FieldQualification\n" +
1990
		"The field Local.field is hiding a field from type FieldQualification\n" +
1997
		"----------\n" +
1998
		"3. WARNING in p\\FieldQualification.java (at line 6)\n" +
1999
		"	String field = \"Enclosing field for anonymous type\";\n" +
2000
		"	       ^^^^^\n" +
2001
		"The field Local.field is never read locally\n" +
2002
		"----------\n" +
2003
		"4. WARNING in p\\FieldQualification.java (at line 7)\n" +
2004
		"	void foo() {\n" +
2005
		"	     ^^^^^\n" +
2006
		"The method foo() from the type Local is never used locally\n" +
2007
		"----------\n",
1991
		"----------\n",
2008
		// runtime results
1992
		// runtime results
2009
		null /* do not check output string */,
1993
		null /* do not check output string */,
Lines 2066-2082 Link Here
2066
			"}	\n"
2050
			"}	\n"
2067
		},
2051
		},
2068
		// compiler results
2052
		// compiler results
2069
		"----------\n" +  /* expected compiler log */
2053
		"",
2070
		"1. WARNING in q\\Y.java (at line 3)\n" +
2071
		"	private static class X {}	\n" +
2072
		"	                     ^\n" +
2073
		"The type Y.X is never used locally\n" +
2074
		"----------\n",
2075
		// runtime results
2054
		// runtime results
2076
		null /* do not check output string */,
2055
		null /* do not check output string */,
2077
		null /* do not check error string */,
2056
		null /* do not check error string */,
2078
		// javac options
2057
		// javac options
2079
		JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
2058
		JavacTestOptions.DEFAULT /* javac test options */);
2080
}
2059
}
2081
/*
2060
/*
2082
 * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11435
2061
 * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11435
Lines 2948-2974 Link Here
2948
		"	^^^^\n" +
2927
		"	^^^^\n" +
2949
		"Illegal enclosing instance specification for type Object\n" +
2928
		"Illegal enclosing instance specification for type Object\n" +
2950
		"----------\n" +
2929
		"----------\n" +
2951
		"3. WARNING in p\\X.java (at line 25)\n" +
2930
		"3. WARNING in p\\X.java (at line 39)\n" +
2952
		"	private void a() { System.out.println(\"A\");} \n" +
2953
		"	             ^^^\n" +
2954
		"The method a() from the type X is never used locally\n" +
2955
		"----------\n" +
2956
		"4. WARNING in p\\X.java (at line 31)\n" +
2957
		"	Class c = b.getClass();\n" +
2958
		"	^^^^^\n" +
2959
		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
2960
		"----------\n" +
2961
		"5. WARNING in p\\X.java (at line 32)\n" +
2962
		"	Class _getClasses [] = X.class.getClasses(); \n" +
2963
		"	^^^^^\n" +
2964
		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
2965
		"----------\n" +
2966
		"6. WARNING in p\\X.java (at line 36)\n" +
2967
		"	Constructor _getConstructors[] = c.getConstructors(); \n" +
2968
		"	^^^^^^^^^^^\n" +
2969
		"Constructor is a raw type. References to generic type Constructor<T> should be parameterized\n" +
2970
		"----------\n" +
2971
		"7. WARNING in p\\X.java (at line 39)\n" +
2972
		"	Method _getMethod = c.getMethod(\"d\",null);\n" +
2931
		"	Method _getMethod = c.getMethod(\"d\",null);\n" +
2973
		"	                    ^^^^^^^^^^^^^^^^^^^^^\n" +
2932
		"	                    ^^^^^^^^^^^^^^^^^^^^^\n" +
2974
		"The argument of type null should explicitly be cast to Class[] for the invocation of the varargs method getMethod(String, Class...) from type Class. It could alternatively be cast to Class for a varargs invocation\n" +
2933
		"The argument of type null should explicitly be cast to Class[] for the invocation of the varargs method getMethod(String, Class...) from type Class. It could alternatively be cast to Class for a varargs invocation\n" +
Lines 2986-3017 Link Here
2986
			"	^^^^\n" +
2945
			"	^^^^\n" +
2987
			"Illegal enclosing instance specification for type Object\n" +
2946
			"Illegal enclosing instance specification for type Object\n" +
2988
			"----------\n" +
2947
			"----------\n" +
2989
			"3. WARNING in p\\X.java (at line 25)\n" +
2948
			"3. WARNING in p\\X.java (at line 39)\n" +
2990
			"	private void a() { System.out.println(\"A\");} \n" +
2991
			"	             ^^^\n" +
2992
			"The method a() from the type X is never used locally\n" +
2993
			"----------\n" +
2994
			"4. WARNING in p\\X.java (at line 31)\n" +
2995
			"	Class c = b.getClass();\n" +
2996
			"	^^^^^\n" +
2997
			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
2998
			"----------\n" +
2999
			"5. WARNING in p\\X.java (at line 32)\n" +
3000
			"	Class _getClasses [] = X.class.getClasses(); \n" +
3001
			"	^^^^^\n" +
3002
			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
3003
			"----------\n" +
3004
			"6. WARNING in p\\X.java (at line 36)\n" +
3005
			"	Constructor _getConstructors[] = c.getConstructors(); \n" +
3006
			"	^^^^^^^^^^^\n" +
3007
			"Constructor is a raw type. References to generic type Constructor<T> should be parameterized\n" +
3008
			"----------\n" +
3009
			"7. WARNING in p\\X.java (at line 39)\n" +
3010
			"	Method _getMethod = c.getMethod(\"d\",null);\n" +
2949
			"	Method _getMethod = c.getMethod(\"d\",null);\n" +
3011
			"	                    ^^^^^^^^^^^^^^^^^^^^^\n" +
2950
			"	                    ^^^^^^^^^^^^^^^^^^^^^\n" +
3012
			"The argument of type null should explicitly be cast to Class[] for the invocation of the varargs method getMethod(String, Class...) from type Class. It could alternatively be cast to Class for a varargs invocation\n" +
2951
			"The argument of type null should explicitly be cast to Class[] for the invocation of the varargs method getMethod(String, Class...) from type Class. It could alternatively be cast to Class for a varargs invocation\n" +
3013
			"----------\n" +
2952
			"----------\n" +
3014
			"8. WARNING in p\\X.java (at line 39)\n" +
2953
			"4. WARNING in p\\X.java (at line 39)\n" +
3015
			"	Method _getMethod = c.getMethod(\"d\",null);\n" +
2954
			"	Method _getMethod = c.getMethod(\"d\",null);\n" +
3016
			"	                    ^^^^^^^^^^^^^^^^^^^^^\n" +
2955
			"	                    ^^^^^^^^^^^^^^^^^^^^^\n" +
3017
			"Type safety: The method getMethod(String, Class...) belongs to the raw type Class. References to generic type Class<T> should be parameterized\n" +
2956
			"Type safety: The method getMethod(String, Class...) belongs to the raw type Class. References to generic type Class<T> should be parameterized\n" +
(-)src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java (-12 / +5 lines)
Lines 53-58 Link Here
53
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
53
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
54
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
54
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
55
		options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED);
55
		options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED);
56
		options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
57
		options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE);
58
		options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
56
		if (this.reportMissingJavadocComments != null)
59
		if (this.reportMissingJavadocComments != null)
57
			options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, this.reportMissingJavadocComments);
60
			options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, this.reportMissingJavadocComments);
58
		return options;
61
		return options;
Lines 3755-3766 Link Here
3755
			"}\n",
3758
			"}\n",
3756
        },
3759
        },
3757
		"----------\n" +
3760
		"----------\n" +
3758
		"1. WARNING in X.java (at line 3)\n" +
3761
		"1. ERROR in X.java (at line 3)\n" +
3759
		"	static int bar;\n" +
3760
		"	           ^^^\n" +
3761
		"The field new BugDemo(){}.bar is never read locally\n" +
3762
		"----------\n" +
3763
		"2. ERROR in X.java (at line 3)\n" +
3764
		"	static int bar;\n" +
3762
		"	static int bar;\n" +
3765
		"	           ^^^\n" +
3763
		"	           ^^^\n" +
3766
		"The field bar cannot be declared static; static fields can only be declared in static or top level types\n" +
3764
		"The field bar cannot be declared static; static fields can only be declared in static or top level types\n" +
Lines 6193-6204 Link Here
6193
			"}\n"
6191
			"}\n"
6194
		},
6192
		},
6195
		null, customOptions,
6193
		null, customOptions,
6196
		"----------\n" + 
6194
		"",
6197
		"1. WARNING in X.java (at line 8)\n" + 
6198
		"	private enum Complaint {       WARNING, ERROR, FATAL_ERROR, PANIC;\n" + 
6199
		"	             ^^^^^^^^^\n" + 
6200
		"The type X.Complaint is never used locally\n" + 
6201
		"----------\n",
6202
		"HELLORED", null, 
6195
		"HELLORED", null, 
6203
		JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6196
		JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
6204
}
6197
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (-157 / +64 lines)
Lines 30-36 Link Here
30
	// Static initializer to specify tests subset using TESTS_* static variables
30
	// Static initializer to specify tests subset using TESTS_* static variables
31
	// All specified tests which does not belong to the class are skipped...
31
	// All specified tests which does not belong to the class are skipped...
32
	static {
32
	static {
33
//		TESTS_NAMES = new String[] { "test1464" };
33
		TESTS_NAMES = new String[] { "test1203c", "test1203d" };
34
//		TESTS_NUMBERS = new int[] { 1465 };
34
//		TESTS_NUMBERS = new int[] { 1465 };
35
//		TESTS_RANGE = new int[] { 1097, -1 };
35
//		TESTS_RANGE = new int[] { 1097, -1 };
36
	}
36
	}
Lines 43-51 Link Here
43
	}
43
	}
44
44
45
	protected Map getCompilerOptions() {
45
	protected Map getCompilerOptions() {
46
		Map compilerOptions = super.getCompilerOptions();
46
		Map options = super.getCompilerOptions();
47
		compilerOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED);
47
		options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED);
48
		return compilerOptions;
48
		options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
49
		options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE);
50
		options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
51
		return options;
49
	}
52
	}
50
53
51
	public void test0001() {
54
	public void test0001() {
Lines 14393-14409 Link Here
14393
				"}\n"
14396
				"}\n"
14394
			},
14397
			},
14395
			"----------\n" + 
14398
			"----------\n" + 
14396
			"1. WARNING in test\\Foo.java (at line 4)\n" + 
14397
			"	private R dosomething(){ return s; } \n" + 
14398
			"	          ^^^^^^^^^^^^^\n" + 
14399
			"The method dosomething() from the type Foo<R> is never used locally\n" + 
14400
			"----------\n" + 
14401
			"2. WARNING in test\\Foo.java (at line 5)\n" + 
14402
			"	private class Bar {} \n" + 
14403
			"	              ^^^\n" + 
14404
			"The type Foo<R>.Bar is never used locally\n" + 
14405
			"----------\n" + 
14406
			"----------\n" + 
14407
			"1. ERROR in test02\\FooBar.java (at line 6)\n" + 
14399
			"1. ERROR in test02\\FooBar.java (at line 6)\n" + 
14408
			"	f.s = \"foo\"; \n" + 
14400
			"	f.s = \"foo\"; \n" + 
14409
			"	  ^\n" + 
14401
			"	  ^\n" + 
Lines 19118-19129 Link Here
19118
    		"	private static class Bucket extends LinkedList<MPair<K,V>> {}\n" +
19110
    		"	private static class Bucket extends LinkedList<MPair<K,V>> {}\n" +
19119
    		"	                                                       ^\n" +
19111
    		"	                                                       ^\n" +
19120
    		"Cannot make a static reference to the non-static type V\n" +
19112
    		"Cannot make a static reference to the non-static type V\n" +
19121
    		"----------\n" +
19113
	    	"----------\n");
19122
    		"3. WARNING in X.java (at line 7)\n" +
19123
    		"	private Bucket[] buckets = new X.Bucket[100];\n" +
19124
    		"	                 ^^^^^^^\n" +
19125
    		"The field X<K,V>.buckets is never read locally\n" +
19126
    		"----------\n");
19127
	}
19114
	}
19128
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973
19115
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973
19129
	public void test0613() {
19116
	public void test0613() {
Lines 25832-25858 Link Here
25832
			"}\n",
25819
			"}\n",
25833
		},
25820
		},
25834
		"----------\n" +
25821
		"----------\n" +
25835
		"1. WARNING in X.java (at line 2)\n" +
25822
		"1. WARNING in X.java (at line 7)\n" +
25836
		"	private T t;\n" +
25837
		"	          ^\n" +
25838
		"The field X<T>.t is never read locally\n" +
25839
		"----------\n" +
25840
		"2. WARNING in X.java (at line 3)\n" +
25841
		"	private X<?>.Inner inner;\n" +
25842
		"	                   ^^^^^\n" +
25843
		"The field X<T>.inner is never read locally\n" +
25844
		"----------\n" +
25845
		"3. WARNING in X.java (at line 4)\n" +
25846
		"	private X<?>.Inner[] inners;\n" +
25847
		"	                     ^^^^^^\n" +
25848
		"The field X<T>.inners is never read locally\n" +
25849
		"----------\n" +
25850
		"4. WARNING in X.java (at line 7)\n" +
25851
		"	this.inner = new X.Inner();\n" +
25823
		"	this.inner = new X.Inner();\n" +
25852
		"	                 ^^^^^^^\n" +
25824
		"	                 ^^^^^^^\n" +
25853
		"X.Inner is a raw type. References to generic type X<T>.Inner should be parameterized\n" +
25825
		"X.Inner is a raw type. References to generic type X<T>.Inner should be parameterized\n" +
25854
		"----------\n" +
25826
		"----------\n" +
25855
		"5. ERROR in X.java (at line 9)\n" +
25827
		"2. ERROR in X.java (at line 9)\n" +
25856
		"	Zork z;\n" +
25828
		"	Zork z;\n" +
25857
		"	^^^^\n" +
25829
		"	^^^^\n" +
25858
		"Zork cannot be resolved to a type\n" +
25830
		"Zork cannot be resolved to a type\n" +
Lines 26020-26066 Link Here
26020
				"}\n",
25992
				"}\n",
26021
			},
25993
			},
26022
			"----------\n" + 
25994
			"----------\n" + 
26023
			"1. WARNING in X.java (at line 4)\n" + 
25995
			"1. WARNING in X.java (at line 9)\n" + 
26024
			"	private T t;\n" + 
26025
			"	          ^\n" + 
26026
			"The field X<T>.t is never read locally\n" + 
26027
			"----------\n" + 
26028
			"2. WARNING in X.java (at line 9)\n" + 
26029
			"	if (this.inner instanceof X<?>.Inner) {}\n" + 
25996
			"	if (this.inner instanceof X<?>.Inner) {}\n" + 
26030
			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
25997
			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
26031
			"The expression of type X<?>.Inner is already an instance of type X<?>.Inner\n" + 
25998
			"The expression of type X<?>.Inner is already an instance of type X<?>.Inner\n" + 
26032
			"----------\n" + 
25999
			"----------\n" + 
26033
			"3. WARNING in X.java (at line 10)\n" + 
26000
			"2. WARNING in X.java (at line 10)\n" + 
26034
			"	if (this.inners instanceof X<?>.Inner[]) {}\n" + 
26001
			"	if (this.inners instanceof X<?>.Inner[]) {}\n" + 
26035
			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
26002
			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
26036
			"The expression of type X<?>.Inner[] is already an instance of type X<?>.Inner[]\n" + 
26003
			"The expression of type X<?>.Inner[] is already an instance of type X<?>.Inner[]\n" + 
26037
			"----------\n" + 
26004
			"----------\n" + 
26038
			"4. WARNING in X.java (at line 14)\n" + 
26005
			"3. WARNING in X.java (at line 14)\n" + 
26039
			"	void foo(List l) {\n" + 
26006
			"	void foo(List l) {\n" + 
26040
			"	         ^^^^\n" + 
26007
			"	         ^^^^\n" + 
26041
			"List is a raw type. References to generic type List<E> should be parameterized\n" + 
26008
			"List is a raw type. References to generic type List<E> should be parameterized\n" + 
26042
			"----------\n" + 
26009
			"----------\n" + 
26043
			"5. WARNING in X.java (at line 15)\n" + 
26010
			"4. WARNING in X.java (at line 15)\n" + 
26044
			"	if (l instanceof List<?>) {}\n" + 
26011
			"	if (l instanceof List<?>) {}\n" + 
26045
			"	    ^^^^^^^^^^^^^^^^^\n" + 
26012
			"	    ^^^^^^^^^^^^^^^^^\n" + 
26046
			"The expression of type List is already an instance of type List<?>\n" + 
26013
			"The expression of type List is already an instance of type List<?>\n" + 
26047
			"----------\n" + 
26014
			"----------\n" + 
26048
			"6. ERROR in X.java (at line 16)\n" + 
26015
			"5. ERROR in X.java (at line 16)\n" + 
26049
			"	if (l instanceof List<? extends String>) {}\n" + 
26016
			"	if (l instanceof List<? extends String>) {}\n" + 
26050
			"	    ^^^^^^^^^^^^^^^^^\n" + 
26017
			"	    ^^^^^^^^^^^^^^^^^\n" + 
26051
			"Cannot perform instanceof check against parameterized type List<? extends String>. Use the form List<?> instead since further generic type information will be erased at runtime\n" + 
26018
			"Cannot perform instanceof check against parameterized type List<? extends String>. Use the form List<?> instead since further generic type information will be erased at runtime\n" + 
26052
			"----------\n" + 
26019
			"----------\n" + 
26053
			"7. WARNING in X.java (at line 18)\n" + 
26020
			"6. WARNING in X.java (at line 18)\n" + 
26054
			"	void foo(List[] ls) {\n" + 
26021
			"	void foo(List[] ls) {\n" + 
26055
			"	         ^^^^\n" + 
26022
			"	         ^^^^\n" + 
26056
			"List is a raw type. References to generic type List<E> should be parameterized\n" + 
26023
			"List is a raw type. References to generic type List<E> should be parameterized\n" + 
26057
			"----------\n" + 
26024
			"----------\n" + 
26058
			"8. WARNING in X.java (at line 19)\n" + 
26025
			"7. WARNING in X.java (at line 19)\n" + 
26059
			"	if (ls instanceof List<?>[]) {}\n" + 
26026
			"	if (ls instanceof List<?>[]) {}\n" + 
26060
			"	    ^^^^^^^^^^^^^^^^^^^^^^^\n" + 
26027
			"	    ^^^^^^^^^^^^^^^^^^^^^^^\n" + 
26061
			"The expression of type List[] is already an instance of type List<?>\n" + 
26028
			"The expression of type List[] is already an instance of type List<?>\n" + 
26062
			"----------\n" + 
26029
			"----------\n" + 
26063
			"9. ERROR in X.java (at line 20)\n" + 
26030
			"8. ERROR in X.java (at line 20)\n" + 
26064
			"	if (ls instanceof List<? extends String>[]) {}\n" + 
26031
			"	if (ls instanceof List<? extends String>[]) {}\n" + 
26065
			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
26032
			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
26066
			"Cannot perform instanceof check against parameterized type List<? extends String>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" + 
26033
			"Cannot perform instanceof check against parameterized type List<? extends String>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" + 
Lines 32552-32578 Link Here
32552
				"}\n", // =================
32519
				"}\n", // =================
32553
			},
32520
			},
32554
			"----------\n" +
32521
			"----------\n" +
32555
			"1. WARNING in X.java (at line 5)\n" +
32522
			"1. ERROR in X.java (at line 20)\n" +
32556
			"	private T aObject = null;\n" +
32557
			"	          ^^^^^^^\n" +
32558
			"The field X<T>.aObject is never read locally\n" +
32559
			"----------\n" +
32560
			"2. ERROR in X.java (at line 20)\n" +
32561
			"	final List<X<?>> l2 = castList(l1, List.class);\n" +
32523
			"	final List<X<?>> l2 = castList(l1, List.class);\n" +
32562
			"	                      ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
32524
			"	                      ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
32563
			"Type mismatch: cannot convert from List<List> to List<X<?>>\n" +
32525
			"Type mismatch: cannot convert from List<List> to List<X<?>>\n" +
32564
			"----------\n" +
32526
			"----------\n" +
32565
			"3. WARNING in X.java (at line 22)\n" +
32527
			"2. WARNING in X.java (at line 22)\n" +
32566
			"	List<X> l3 = l2;\n" +
32528
			"	List<X> l3 = l2;\n" +
32567
			"	     ^\n" +
32529
			"	     ^\n" +
32568
			"X is a raw type. References to generic type X<T> should be parameterized\n" +
32530
			"X is a raw type. References to generic type X<T> should be parameterized\n" +
32569
			"----------\n" +
32531
			"----------\n" +
32570
			"4. ERROR in X.java (at line 22)\n" +
32532
			"3. ERROR in X.java (at line 22)\n" +
32571
			"	List<X> l3 = l2;\n" +
32533
			"	List<X> l3 = l2;\n" +
32572
			"	             ^^\n" +
32534
			"	             ^^\n" +
32573
			"Type mismatch: cannot convert from List<X<?>> to List<X>\n" +
32535
			"Type mismatch: cannot convert from List<X<?>> to List<X>\n" +
32574
			"----------\n" +
32536
			"----------\n" +
32575
			"5. ERROR in X.java (at line 24)\n" +
32537
			"4. ERROR in X.java (at line 24)\n" +
32576
			"	l3 = l4;\n" +
32538
			"	l3 = l4;\n" +
32577
			"	     ^^\n" +
32539
			"	     ^^\n" +
32578
			"Type mismatch: cannot convert from List<X<String>> to List<X>\n" +
32540
			"Type mismatch: cannot convert from List<X<String>> to List<X>\n" +
Lines 36767-36796 Link Here
36767
			"	      ^\n" +
36729
			"	      ^\n" +
36768
			"The nested type T is hiding the type parameter T of type Y<T>\n" +
36730
			"The nested type T is hiding the type parameter T of type Y<T>\n" +
36769
			"----------\n" +
36731
			"----------\n" +
36770
			"4. WARNING in X.java (at line 11)\n" +
36732
			"4. WARNING in X.java (at line 12)\n" +
36771
			"	class T {}; // hiding warning\n" +
36772
			"	      ^\n" +
36773
			"The type T is never used locally\n" +
36774
			"----------\n" +
36775
			"5. WARNING in X.java (at line 12)\n" +
36776
			"	class Local {};\n" +
36733
			"	class Local {};\n" +
36777
			"	      ^^^^^\n" +
36734
			"	      ^^^^^\n" +
36778
			"The type Local is hiding the type Y<T>.Local\n" +
36735
			"The type Local is hiding the type Y<T>.Local\n" +
36779
			"----------\n" +
36780
			"6. WARNING in X.java (at line 12)\n" +
36781
			"	class Local {};\n" +
36782
			"	      ^^^^^\n" +
36783
			"The type Local is never used locally\n" +
36784
			"----------\n" +
36785
			"7. WARNING in X.java (at line 15)\n" +
36786
			"	class T {}; // no hiding warning\n" +
36787
			"	      ^\n" +
36788
			"The type T is never used locally\n" +
36789
			"----------\n" +
36790
			"8. WARNING in X.java (at line 16)\n" +
36791
			"	class Local {}; // no hiding warning\n" +
36792
			"	      ^^^^^\n" +
36793
			"The type Local is never used locally\n" +
36794
			"----------\n");
36736
			"----------\n");
36795
}
36737
}
36796
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=165679 - variation
36738
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=165679 - variation
Lines 38111-38137 Link Here
38111
			"}", // =================
38053
			"}", // =================
38112
		},
38054
		},
38113
		"----------\n" +
38055
		"----------\n" +
38114
		"1. WARNING in X.java (at line 7)\n" +
38056
		"1. WARNING in X.java (at line 13)\n" +
38115
		"	private final T theGenericThing;\n" +
38116
		"	                ^^^^^^^^^^^^^^^\n" +
38117
		"The field X<T>.theGenericThing is never read locally\n" +
38118
		"----------\n" +
38119
		"2. WARNING in X.java (at line 13)\n" +
38120
		"	public static class InnerClassThatShowsBug extends X {\n" +
38057
		"	public static class InnerClassThatShowsBug extends X {\n" +
38121
		"	                                                   ^\n" +
38058
		"	                                                   ^\n" +
38122
		"X is a raw type. References to generic type X<T> should be parameterized\n" +
38059
		"X is a raw type. References to generic type X<T> should be parameterized\n" +
38123
		"----------\n" +
38060
		"----------\n" +
38124
		"3. WARNING in X.java (at line 15)\n" +
38061
		"2. WARNING in X.java (at line 15)\n" +
38125
		"	super(null);\n" +
38062
		"	super(null);\n" +
38126
		"	^^^^^^^^^^^^\n" +
38063
		"	^^^^^^^^^^^^\n" +
38127
		"Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
38064
		"Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
38128
		"----------\n" +
38065
		"----------\n" +
38129
		"4. WARNING in X.java (at line 15)\n" +
38066
		"3. WARNING in X.java (at line 15)\n" +
38130
		"	super(null);\n" +
38067
		"	super(null);\n" +
38131
		"	^^^^^^^^^^^^\n" +
38068
		"	^^^^^^^^^^^^\n" +
38132
		"Access to enclosing constructor X<T>(T) is emulated by a synthetic accessor method\n" +
38069
		"Access to enclosing constructor X<T>(T) is emulated by a synthetic accessor method\n" +
38133
		"----------\n" +
38070
		"----------\n" +
38134
		"5. ERROR in X.java (at line 19)\n" +
38071
		"4. ERROR in X.java (at line 19)\n" +
38135
		"	for (Map.Entry<String, String> entry : myMap().entrySet()) {\n" +
38072
		"	for (Map.Entry<String, String> entry : myMap().entrySet()) {\n" +
38136
		"	                                       ^^^^^^^^^^^^^^^^^^\n" +
38073
		"	                                       ^^^^^^^^^^^^^^^^^^\n" +
38137
		"Type mismatch: cannot convert from element type Object to Map.Entry<String,String>\n" +
38074
		"Type mismatch: cannot convert from element type Object to Map.Entry<String,String>\n" +
Lines 39571-39612 Link Here
39571
			"}\n", // =================
39508
			"}\n", // =================
39572
		},
39509
		},
39573
		"----------\n" +
39510
		"----------\n" +
39574
		"1. WARNING in X.java (at line 3)\n" +
39511
		"1. WARNING in X.java (at line 5)\n" +
39575
		"	private final Object mDependent = new Object() {\n" +
39576
		"	                     ^^^^^^^^^^\n" +
39577
		"The field X<T>.mDependent is never read locally\n" +
39578
		"----------\n" +
39579
		"2. WARNING in X.java (at line 5)\n" +
39580
		"	Object o1 = mObj;\n" +
39512
		"	Object o1 = mObj;\n" +
39581
		"	            ^^^^\n" +
39513
		"	            ^^^^\n" +
39582
		"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39514
		"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39583
		"----------\n" +
39515
		"----------\n" +
39584
		"3. ERROR in X.java (at line 5)\n" +
39516
		"2. ERROR in X.java (at line 5)\n" +
39585
		"	Object o1 = mObj;\n" +
39517
		"	Object o1 = mObj;\n" +
39586
		"	            ^^^^\n" +
39518
		"	            ^^^^\n" +
39587
		"The blank final field mObj may not have been initialized\n" +
39519
		"The blank final field mObj may not have been initialized\n" +
39588
		"----------\n" +
39520
		"----------\n" +
39589
		"4. WARNING in X.java (at line 7)\n" +
39521
		"3. WARNING in X.java (at line 7)\n" +
39590
		"	Object o2 = mObj;\n" +
39591
		"	       ^^\n" +
39592
		"The field new Object(){}.o2 is never read locally\n" +
39593
		"----------\n" +
39594
		"5. WARNING in X.java (at line 7)\n" +
39595
		"	Object o2 = mObj;\n" +
39522
		"	Object o2 = mObj;\n" +
39596
		"	            ^^^^\n" +
39523
		"	            ^^^^\n" +
39597
		"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39524
		"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39598
		"----------\n" +
39525
		"----------\n" +
39599
		"6. ERROR in X.java (at line 7)\n" +
39526
		"4. ERROR in X.java (at line 7)\n" +
39600
		"	Object o2 = mObj;\n" +
39527
		"	Object o2 = mObj;\n" +
39601
		"	            ^^^^\n" +
39528
		"	            ^^^^\n" +
39602
		"The blank final field mObj may not have been initialized\n" +
39529
		"The blank final field mObj may not have been initialized\n" +
39603
		"----------\n" +
39530
		"----------\n" +
39604
		"7. WARNING in X.java (at line 8)\n" +
39531
		"5. WARNING in X.java (at line 9)\n" +
39605
		"	void foo() {\n" +
39606
		"	     ^^^^^\n" +
39607
		"The method foo() from the type new Object(){} is never used locally\n" +
39608
		"----------\n" +
39609
		"8. WARNING in X.java (at line 9)\n" +
39610
		"	Object o3 = mObj;\n" +
39532
		"	Object o3 = mObj;\n" +
39611
		"	            ^^^^\n" +
39533
		"	            ^^^^\n" +
39612
		"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39534
		"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
Lines 39636-39697 Link Here
39636
			"}\n"
39558
			"}\n"
39637
		},
39559
		},
39638
		"----------\n" +
39560
		"----------\n" +
39639
		"1. WARNING in X.java (at line 3)\n" +
39561
		"1. WARNING in X.java (at line 5)\n" +
39640
		"	private final Object mDependent = new Object() {\n" +
39641
		"	                     ^^^^^^^^^^\n" +
39642
		"The field X<T>.mDependent is never read locally\n" +
39643
		"----------\n" +
39644
		"2. WARNING in X.java (at line 5)\n" +
39645
		"	Object o1 = mObj;\n" +
39562
		"	Object o1 = mObj;\n" +
39646
		"	            ^^^^\n" +
39563
		"	            ^^^^\n" +
39647
		"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39564
		"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39648
		"----------\n" +
39565
		"----------\n" +
39649
		"3. ERROR in X.java (at line 5)\n" +
39566
		"2. ERROR in X.java (at line 5)\n" +
39650
		"	Object o1 = mObj;\n" +
39567
		"	Object o1 = mObj;\n" +
39651
		"	            ^^^^\n" +
39568
		"	            ^^^^\n" +
39652
		"The blank final field mObj may not have been initialized\n" +
39569
		"The blank final field mObj may not have been initialized\n" +
39653
		"----------\n" +
39570
		"----------\n" +
39654
		"4. WARNING in X.java (at line 6)\n" +
39571
		"3. WARNING in X.java (at line 6)\n" +
39655
		"	mObj = \"1\";\n" +
39572
		"	mObj = \"1\";\n" +
39656
		"	^^^^\n" +
39573
		"	^^^^\n" +
39657
		"Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39574
		"Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39658
		"----------\n" +
39575
		"----------\n" +
39659
		"5. ERROR in X.java (at line 6)\n" +
39576
		"4. ERROR in X.java (at line 6)\n" +
39660
		"	mObj = \"1\";\n" +
39577
		"	mObj = \"1\";\n" +
39661
		"	^^^^\n" +
39578
		"	^^^^\n" +
39662
		"The final field X<T>.mObj cannot be assigned\n" +
39579
		"The final field X<T>.mObj cannot be assigned\n" +
39663
		"----------\n" +
39580
		"----------\n" +
39664
		"6. WARNING in X.java (at line 8)\n" +
39581
		"5. WARNING in X.java (at line 8)\n" +
39665
		"	Object o2 = mObj = \"2\";\n" +
39666
		"	       ^^\n" +
39667
		"The field new Object(){}.o2 is never read locally\n" +
39668
		"----------\n" +
39669
		"7. WARNING in X.java (at line 8)\n" +
39670
		"	Object o2 = mObj = \"2\";\n" +
39582
		"	Object o2 = mObj = \"2\";\n" +
39671
		"	            ^^^^\n" +
39583
		"	            ^^^^\n" +
39672
		"Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39584
		"Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39673
		"----------\n" +
39585
		"----------\n" +
39674
		"8. ERROR in X.java (at line 8)\n" +
39586
		"6. ERROR in X.java (at line 8)\n" +
39675
		"	Object o2 = mObj = \"2\";\n" +
39587
		"	Object o2 = mObj = \"2\";\n" +
39676
		"	            ^^^^\n" +
39588
		"	            ^^^^\n" +
39677
		"The final field X<T>.mObj cannot be assigned\n" +
39589
		"The final field X<T>.mObj cannot be assigned\n" +
39678
		"----------\n" +
39590
		"----------\n" +
39679
		"9. WARNING in X.java (at line 9)\n" +
39591
		"7. WARNING in X.java (at line 10)\n" +
39680
		"	void foo() {\n" +
39681
		"	     ^^^^^\n" +
39682
		"The method foo() from the type new Object(){} is never used locally\n" +
39683
		"----------\n" +
39684
		"10. WARNING in X.java (at line 10)\n" +
39685
		"	Object o3 = mObj;\n" +
39592
		"	Object o3 = mObj;\n" +
39686
		"	            ^^^^\n" +
39593
		"	            ^^^^\n" +
39687
		"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39594
		"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39688
		"----------\n" +
39595
		"----------\n" +
39689
		"11. WARNING in X.java (at line 11)\n" +
39596
		"8. WARNING in X.java (at line 11)\n" +
39690
		"	mObj = \"3\";\n" +
39597
		"	mObj = \"3\";\n" +
39691
		"	^^^^\n" +
39598
		"	^^^^\n" +
39692
		"Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39599
		"Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
39693
		"----------\n" +
39600
		"----------\n" +
39694
		"12. ERROR in X.java (at line 11)\n" +
39601
		"9. ERROR in X.java (at line 11)\n" +
39695
		"	mObj = \"3\";\n" +
39602
		"	mObj = \"3\";\n" +
39696
		"	^^^^\n" +
39603
		"	^^^^\n" +
39697
		"The final field X<T>.mObj cannot be assigned\n" +
39604
		"The final field X<T>.mObj cannot be assigned\n" +
Lines 41031-41037 Link Here
41031
	String[] sources =
40938
	String[] sources =
41032
		new String[] {
40939
		new String[] {
41033
			"X.java",
40940
			"X.java",
41034
			"class X extends Y {\n" +
40941
			"public class X extends Y {\n" +
41035
			"	public static void main(String[] args) {\n" +
40942
			"	public static void main(String[] args) {\n" +
41036
			"		String s = \"\";\n" +
40943
			"		String s = \"\";\n" +
41037
			"		new X().<String> a(s);\n" + // fails before 7
40944
			"		new X().<String> a(s);\n" + // fails before 7
Lines 41113-41119 Link Here
41113
	String[] sources =
41020
	String[] sources =
41114
		new String[] {
41021
		new String[] {
41115
			"X.java",
41022
			"X.java",
41116
			"class X implements I {\n" +
41023
			"public class X implements I {\n" +
41117
			"	public static void main(String[] args) {\n" +
41024
			"	public static void main(String[] args) {\n" +
41118
			"		String s = \"\";\n" +
41025
			"		String s = \"\";\n" +
41119
			"		new X().<String> a(s);\n" + // fails before 7
41026
			"		new X().<String> a(s);\n" + // fails before 7
Lines 41580-41591 Link Here
41580
		"The type A.P is not visible\n" +
41487
		"The type A.P is not visible\n" +
41581
		"----------\n" +
41488
		"----------\n" +
41582
		"----------\n" +
41489
		"----------\n" +
41583
		"1. WARNING in p\\A.java (at line 9)\n" +
41490
		"1. WARNING in p\\A.java (at line 18)\n" +
41584
		"	public int pval;\n" +
41585
		"	           ^^^^\n" +
41586
		"The field A.P.pval is never read locally\n" +
41587
		"----------\n" +
41588
		"2. WARNING in p\\A.java (at line 18)\n" +
41589
		"	this.box.set(new P());\n" +
41491
		"	this.box.set(new P());\n" +
41590
		"	             ^^^^^^^\n" +
41492
		"	             ^^^^^^^\n" +
41591
		"Access to enclosing constructor A.P() is emulated by a synthetic accessor method\n" +
41493
		"Access to enclosing constructor A.P() is emulated by a synthetic accessor method\n" +
Lines 42618-42628 Link Here
42618
		"	public class X<T extends Secondary.Private> {\n" +
42520
		"	public class X<T extends Secondary.Private> {\n" +
42619
		"	                         ^^^^^^^^^^^^^^^^^\n" +
42521
		"	                         ^^^^^^^^^^^^^^^^^\n" +
42620
		"The type Secondary.Private is not visible\n" +
42522
		"The type Secondary.Private is not visible\n" +
42621
		"----------\n" +
42622
		"2. WARNING in X.java (at line 4)\n" + 
42623
		"	static private class Private {}\n" + 
42624
		"	                     ^^^^^^^\n" + 
42625
		"The type Secondary.Private is never used locally\n" + 
42626
		"----------\n");
42523
		"----------\n");
42627
}
42524
}
42628
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation
42525
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation
Lines 46336-46342 Link Here
46336
			"done");
46233
			"done");
46337
}
46234
}
46338
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422
46235
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422
46339
public void _test1357() {
46236
public void test1357() {
46340
	this.runNegativeTest(
46237
	this.runNegativeTest(
46341
			new String[] {
46238
			new String[] {
46342
				"X.java", // =================
46239
				"X.java", // =================
Lines 46358-46367 Link Here
46358
				"	private static interface SecondaryPrivate {}\n" + 
46255
				"	private static interface SecondaryPrivate {}\n" + 
46359
				"}\n", // =================
46256
				"}\n", // =================
46360
			},
46257
			},
46361
			"done");
46258
			"----------\n" + 
46259
			"1. ERROR in X.java (at line 8)\n" + 
46260
			"	public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" + 
46261
			"	                                       ^^^^^^^^^\n" + 
46262
			"The type X.Private is not visible\n" + 
46263
			"----------\n" + 
46264
			"2. ERROR in X.java (at line 8)\n" + 
46265
			"	public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" + 
46266
			"	                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
46267
			"The type Secondary.SecondaryPrivate is not visible\n" + 
46268
			"----------\n");
46362
}
46269
}
46363
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 - variation
46270
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 - variation
46364
public void _test1358() {
46271
public void test1358() {
46365
	this.runNegativeTest(
46272
	this.runNegativeTest(
46366
			new String[] {
46273
			new String[] {
46367
				"X.java", // =================
46274
				"X.java", // =================
Lines 46376-46382 Link Here
46376
				"	Inter.Private field;\n" + 
46283
				"	Inter.Private field;\n" + 
46377
				"}\n", // =================
46284
				"}\n", // =================
46378
			},
46285
			},
46379
			"done");
46286
			"----------\n" + 
46287
			"1. ERROR in X.java (at line 2)\n" + 
46288
			"	public abstract class X implements List<X.Inter.Private> {\n" + 
46289
			"	                                        ^^^^^^^^^^^^^^^\n" + 
46290
			"The type X.Inter.Private is not visible\n" + 
46291
			"----------\n");
46380
}
46292
}
46381
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 - variation
46293
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 - variation
46382
public void test1359() {
46294
public void test1359() {
Lines 50500-50511 Link Here
50500
			"interface IReferencedInterface extends IRecursiveInterface<IReferencedInterface> {}\n"
50412
			"interface IReferencedInterface extends IRecursiveInterface<IReferencedInterface> {}\n"
50501
		},
50413
		},
50502
		"----------\n" + 
50414
		"----------\n" + 
50503
		"1. WARNING in AnotherClass.java (at line 3)\n" + 
50415
		"1. ERROR in AnotherClass.java (at line 5)\n" + 
50504
		"	private AnotherClass<IReferencedInterface> m_var;\n" + 
50505
		"	                                           ^^^^^\n" + 
50506
		"The field ImplementingClass.m_var is never read locally\n" + 
50507
		"----------\n" + 
50508
		"2. ERROR in AnotherClass.java (at line 5)\n" + 
50509
		"	m_var = a;\n" + 
50416
		"	m_var = a;\n" + 
50510
		"	        ^\n" + 
50417
		"	        ^\n" + 
50511
		"Type mismatch: cannot convert from AnotherClass<capture#1-of ? extends IReferencedInterface> to AnotherClass<IReferencedInterface>\n" + 
50418
		"Type mismatch: cannot convert from AnotherClass<capture#1-of ? extends IReferencedInterface> to AnotherClass<IReferencedInterface>\n" + 
(-)src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java (-272 / +46 lines)
Lines 11-16 Link Here
11
package org.eclipse.jdt.core.tests.compiler.regression;
11
package org.eclipse.jdt.core.tests.compiler.regression;
12
12
13
import java.io.File;
13
import java.io.File;
14
import java.util.Map;
14
15
15
import junit.framework.Test;
16
import junit.framework.Test;
16
17
Lines 31-36 Link Here
31
public InnerEmulationTest(String name) {
32
public InnerEmulationTest(String name) {
32
	super(name);
33
	super(name);
33
}
34
}
35
protected Map getCompilerOptions() {
36
	Map options = super.getCompilerOptions();
37
	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
38
	options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
39
	options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE);
40
	options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
41
	return options;
42
}
34
public static Test suite() {
43
public static Test suite() {
35
	return buildAllCompliancesTestSuite(testClass());
44
	return buildAllCompliancesTestSuite(testClass());
36
}
45
}
Lines 1460-1478 Link Here
1460
		"1. WARNING in p1\\A2.java (at line 18)\n" +
1469
		"1. WARNING in p1\\A2.java (at line 18)\n" +
1461
		"	private class C extends B {	\n" +
1470
		"	private class C extends B {	\n" +
1462
		"	              ^\n" +
1471
		"	              ^\n" +
1463
		"The type A2.C is never used locally\n" +
1464
		"----------\n" +
1465
		"2. WARNING in p1\\A2.java (at line 18)\n" +
1466
		"	private class C extends B {	\n" +
1467
		"	              ^\n" +
1468
		"Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" +
1472
		"Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" +
1469
		"----------\n" +
1473
		"----------\n" +
1470
		"3. WARNING in p1\\A2.java (at line 19)\n" +
1474
		"2. ERROR in p1\\A2.java (at line 20)\n" +
1471
		"	public void foo() {	\n" +
1472
		"	            ^^^^^\n" +
1473
		"The method foo() from the type A2.C is never used locally\n" +
1474
		"----------\n" +
1475
		"4. ERROR in p1\\A2.java (at line 20)\n" +
1476
		"	(new D.E(null, null, null, new F(get()) {}) {}).execute();	\n" +
1475
		"	(new D.E(null, null, null, new F(get()) {}) {}).execute();	\n" +
1477
		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
1476
		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
1478
		"No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" +
1477
		"No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" +
Lines 1553-1571 Link Here
1553
		"1. WARNING in p1\\A2.java (at line 18)\n" +
1552
		"1. WARNING in p1\\A2.java (at line 18)\n" +
1554
		"	private class C extends B {	\n" +
1553
		"	private class C extends B {	\n" +
1555
		"	              ^\n" +
1554
		"	              ^\n" +
1556
		"The type A2.C is never used locally\n" +
1557
		"----------\n" +
1558
		"2. WARNING in p1\\A2.java (at line 18)\n" +
1559
		"	private class C extends B {	\n" +
1560
		"	              ^\n" +
1561
		"Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" +
1555
		"Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" +
1562
		"----------\n" +
1556
		"----------\n" +
1563
		"3. WARNING in p1\\A2.java (at line 19)\n" +
1557
		"2. ERROR in p1\\A2.java (at line 20)\n" +
1564
		"	public void foo() {	\n" +
1565
		"	            ^^^^^\n" +
1566
		"The method foo() from the type A2.C is never used locally\n" +
1567
		"----------\n" +
1568
		"4. ERROR in p1\\A2.java (at line 20)\n" +
1569
		"	(new D.E(null, null, null, new F(get()) {})).execute();	\n" +
1558
		"	(new D.E(null, null, null, new F(get()) {})).execute();	\n" +
1570
		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
1559
		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
1571
		"No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" +
1560
		"No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" +
Lines 2990-3007 Link Here
2990
				"} 	\n"
2979
				"} 	\n"
2991
			},
2980
			},
2992
			"----------\n" +
2981
			"----------\n" +
2993
			"1. WARNING in X.java (at line 7)\n" +
2982
			"1. ERROR in X.java (at line 9)\n" +
2994
			"	class B extends X {	\n" +
2995
			"	      ^\n" +
2996
			"The type B is never used locally\n" +
2997
			"----------\n" +
2998
			"2. ERROR in X.java (at line 9)\n" +
2999
			"	super(new A(){	\n" +
2983
			"	super(new A(){	\n" +
3000
			"				});	\n" +
2984
			"				});	\n" +
3001
			"	      ^^^^^^^^^^^^^^^\n" +
2985
			"	      ^^^^^^^^^^^^^^^\n" +
3002
			"No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
2986
			"No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
3003
			"----------\n" +
2987
			"----------\n" +
3004
			"3. WARNING in X.java (at line 9)\n" +
2988
			"2. WARNING in X.java (at line 9)\n" +
3005
			"	super(new A(){	\n" +
2989
			"	super(new A(){	\n" +
3006
			"	          ^^^\n" +
2990
			"	          ^^^\n" +
3007
			"Access to enclosing constructor A() is emulated by a synthetic accessor method\n" +
2991
			"Access to enclosing constructor A() is emulated by a synthetic accessor method\n" +
Lines 3028-3039 Link Here
3028
				"} 	\n"
3012
				"} 	\n"
3029
			},
3013
			},
3030
			"----------\n" +
3014
			"----------\n" +
3031
			"1. WARNING in X.java (at line 7)\n" +
3015
			"1. ERROR in X.java (at line 9)\n" +
3032
			"	class B extends X {	\n" +
3033
			"	      ^\n" +
3034
			"The type B is never used locally\n" +
3035
			"----------\n" +
3036
			"2. ERROR in X.java (at line 9)\n" +
3037
			"	super(new A(){	\n" +
3016
			"	super(new A(){	\n" +
3038
			"				});	\n" +
3017
			"				});	\n" +
3039
			"	      ^^^^^^^^^^^^^^^\n" +
3018
			"	      ^^^^^^^^^^^^^^^\n" +
Lines 3120-3148 Link Here
3120
				"} 	\n"
3099
				"} 	\n"
3121
			},
3100
			},
3122
			"----------\n" +
3101
			"----------\n" +
3123
			"1. WARNING in X.java (at line 7)\n" +
3102
			"1. ERROR in X.java (at line 9)\n" +
3124
			"	class B extends X {	\n" +
3125
			"	      ^\n" +
3126
			"The type B is never used locally\n" +
3127
			"----------\n" +
3128
			"2. ERROR in X.java (at line 9)\n" +
3129
			"	super(new A(){	\n" +
3103
			"	super(new A(){	\n" +
3130
			"					void foo() { System.out.println(X.this);	} \n" +
3104
			"					void foo() { System.out.println(X.this);	} \n" +
3131
			"				});	\n" +
3105
			"				});	\n" +
3132
			"	      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
3106
			"	      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
3133
			"No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
3107
			"No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
3134
			"----------\n" +
3108
			"----------\n" +
3135
			"3. WARNING in X.java (at line 9)\n" +
3109
			"2. WARNING in X.java (at line 9)\n" +
3136
			"	super(new A(){	\n" +
3110
			"	super(new A(){	\n" +
3137
			"	          ^^^\n" +
3111
			"	          ^^^\n" +
3138
			"Access to enclosing constructor A() is emulated by a synthetic accessor method\n" +
3112
			"Access to enclosing constructor A() is emulated by a synthetic accessor method\n" +
3139
			"----------\n" +
3113
			"----------\n" +
3140
			"4. WARNING in X.java (at line 10)\n" +
3114
			"3. ERROR in X.java (at line 10)\n" +
3141
			"	void foo() { System.out.println(X.this);	} \n" +
3142
			"	     ^^^^^\n" +
3143
			"The method foo() from the type new A(){} is never used locally\n" +
3144
			"----------\n" +
3145
			"5. ERROR in X.java (at line 10)\n" +
3146
			"	void foo() { System.out.println(X.this);	} \n" +
3115
			"	void foo() { System.out.println(X.this);	} \n" +
3147
			"	                                ^^^^^^\n" +
3116
			"	                                ^^^^^^\n" +
3148
			"No enclosing instance of the type X is accessible in scope\n" +
3117
			"No enclosing instance of the type X is accessible in scope\n" +
Lines 3170-3193 Link Here
3170
				"} 	\n"
3139
				"} 	\n"
3171
			},
3140
			},
3172
			"----------\n" +
3141
			"----------\n" +
3173
			"1. WARNING in X.java (at line 7)\n" +
3142
			"1. ERROR in X.java (at line 9)\n" +
3174
			"	class B extends X {	\n" +
3175
			"	      ^\n" +
3176
			"The type B is never used locally\n" +
3177
			"----------\n" +
3178
			"2. ERROR in X.java (at line 9)\n" +
3179
			"	super(new A(){	\n" +
3143
			"	super(new A(){	\n" +
3180
			"					void foo() { System.out.println(X.this);	} \n" +
3144
			"					void foo() { System.out.println(X.this);	} \n" +
3181
			"				});	\n" +
3145
			"				});	\n" +
3182
			"	      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
3146
			"	      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
3183
			"No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
3147
			"No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
3184
			"----------\n" +
3148
			"----------\n" +
3185
			"3. WARNING in X.java (at line 10)\n" +
3149
			"2. ERROR in X.java (at line 10)\n" +
3186
			"	void foo() { System.out.println(X.this);	} \n" +
3187
			"	     ^^^^^\n" +
3188
			"The method foo() from the type new A(){} is never used locally\n" +
3189
			"----------\n" +
3190
			"4. ERROR in X.java (at line 10)\n" +
3191
			"	void foo() { System.out.println(X.this);	} \n" +
3150
			"	void foo() { System.out.println(X.this);	} \n" +
3192
			"	                                ^^^^^^\n" +
3151
			"	                                ^^^^^^\n" +
3193
			"No enclosing instance of the type X is accessible in scope\n" +
3152
			"No enclosing instance of the type X is accessible in scope\n" +
Lines 3385-3396 Link Here
3385
				"}	\n"
3344
				"}	\n"
3386
			},
3345
			},
3387
		"----------\n" +
3346
		"----------\n" +
3388
		"1. WARNING in X.java (at line 10)\n" +
3347
		"1. ERROR in X.java (at line 10)\n" +
3389
		"	X x = X.this; 	\n" +
3390
		"	  ^\n" +
3391
		"The field new B(){}.x is never read locally\n" +
3392
		"----------\n" +
3393
		"2. ERROR in X.java (at line 10)\n" +
3394
		"	X x = X.this; 	\n" +
3348
		"	X x = X.this; 	\n" +
3395
		"	      ^^^^^^\n" +
3349
		"	      ^^^^^^\n" +
3396
		"No enclosing instance of the type X is accessible in scope\n" +
3350
		"No enclosing instance of the type X is accessible in scope\n" +
Lines 3938-3949 Link Here
3938
			"} ",
3892
			"} ",
3939
		},
3893
		},
3940
		"----------\n" +
3894
		"----------\n" +
3941
		"1. WARNING in X.java (at line 9)\n" +
3895
		"1. ERROR in X.java (at line 11)\n" +
3942
		"	private static class B extends X.Y implements X.Z { \n" +
3943
		"	                     ^\n" +
3944
		"The type A.B is never used locally\n" +
3945
		"----------\n" +
3946
		"2. ERROR in X.java (at line 11)\n" +
3947
		"	super(B.this); \n" +
3896
		"	super(B.this); \n" +
3948
		"	      ^^^^^^\n" +
3897
		"	      ^^^^^^\n" +
3949
		"Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
3898
		"Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
Lines 3967-3978 Link Here
3967
				"}",
3916
				"}",
3968
			},
3917
			},
3969
			"----------\n" +
3918
			"----------\n" +
3970
			"1. WARNING in X.java (at line 5)\n" +
3919
			"1. ERROR in X.java (at line 5)\n" +
3971
			"	class Local2 extends Local1 {\n" +
3972
			"	      ^^^^^^\n" +
3973
			"The type Local2 is never used locally\n" +
3974
			"----------\n" +
3975
			"2. ERROR in X.java (at line 5)\n" +
3976
			"	class Local2 extends Local1 {\n" +
3920
			"	class Local2 extends Local1 {\n" +
3977
			"	      ^^^^^^\n" +
3921
			"	      ^^^^^^\n" +
3978
			"No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
3922
			"No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
Lines 4020-4041 Link Here
4020
				"}"
3964
				"}"
4021
			},
3965
			},
4022
			"----------\n" +
3966
			"----------\n" +
4023
			"1. WARNING in X.java (at line 4)\n" +
3967
			"1. ERROR in X.java (at line 13)\n" +
4024
			"	public void foo() {\n" +
4025
			"	            ^^^^^\n" +
4026
			"The method foo() from the type C is never used locally\n" +
4027
			"----------\n" +
4028
			"2. WARNING in X.java (at line 9)\n" +
4029
			"	public void foo() {\n" +
4030
			"	            ^^^^^\n" +
4031
			"The method foo() from the type new X(){} is never used locally\n" +
4032
			"----------\n" +
4033
			"3. WARNING in X.java (at line 13)\n" +
4034
			"	class D extends C {\n" +
4035
			"	      ^\n" +
4036
			"The type D is never used locally\n" +
4037
			"----------\n" +
4038
			"4. ERROR in X.java (at line 13)\n" +
4039
			"	class D extends C {\n" +
3968
			"	class D extends C {\n" +
4040
			"	      ^\n" +
3969
			"	      ^\n" +
4041
			"No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
3970
			"No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
Lines 4319-4329 Link Here
4319
		"	bar();\n" +
4248
		"	bar();\n" +
4320
		"	^^^\n" +
4249
		"	^^^\n" +
4321
		"Cannot refer to an instance method while explicitly invoking a constructor\n" +
4250
		"Cannot refer to an instance method while explicitly invoking a constructor\n" +
4322
		"----------\n" +
4323
		"2. WARNING in X.java (at line 22)\n" +
4324
		"	void baz() {\n" +
4325
		"	     ^^^^^\n" +
4326
		"The method baz() from the type new Object(){} is never used locally\n" +
4327
		"----------\n");
4251
		"----------\n");
4328
}
4252
}
4329
public void test119() {
4253
public void test119() {
Lines 4380-4400 Link Here
4380
			"	foo(\"0\");\n" +
4304
			"	foo(\"0\");\n" +
4381
			"	^^^^^^^^\n" +
4305
			"	^^^^^^^^\n" +
4382
			"No enclosing instance of the type X is accessible in scope\n" +
4306
			"No enclosing instance of the type X is accessible in scope\n" +
4383
			"----------\n" +
4384
			"2. WARNING in X.java (at line 13)\n" +
4385
			"	void baz() {\n" +
4386
			"	     ^^^^^\n" +
4387
			"The method baz() from the type new Object(){} is never used locally\n" +
4388
			"----------\n" +
4389
			"3. WARNING in X.java (at line 18)\n" +
4390
			"	void baz() {\n" +
4391
			"	     ^^^^^\n" +
4392
			"The method baz() from the type Local is never used locally\n" +
4393
			"----------\n" +
4394
			"4. WARNING in X.java (at line 35)\n" +
4395
			"	void baz() {\n" +
4396
			"	     ^^^^^\n" +
4397
			"The method baz() from the type new Object(){} is never used locally\n" +
4398
			"----------\n");
4307
			"----------\n");
4399
		return;
4308
		return;
4400
	}
4309
	}
Lines 4493-4537 Link Here
4493
				"}\n",
4402
				"}\n",
4494
			},
4403
			},
4495
		"----------\n" +
4404
		"----------\n" +
4496
		"1. WARNING in X.java (at line 7)\n" +
4405
		"1. ERROR in X.java (at line 10)\n" +
4497
		"	void baz() {\n" +
4498
		"	     ^^^^^\n" +
4499
		"The method baz() from the type new Object(){} is never used locally\n" +
4500
		"----------\n" +
4501
		"2. WARNING in X.java (at line 9)\n" +
4502
		"	void baz() {\n" +
4503
		"	     ^^^^^\n" +
4504
		"The method baz() from the type new Object(){} is never used locally\n" +
4505
		"----------\n" +
4506
		"3. ERROR in X.java (at line 10)\n" +
4507
		"	foo(); //0\n" +
4406
		"	foo(); //0\n" +
4508
		"	^^^^^\n" +
4407
		"	^^^^^\n" +
4509
		"No enclosing instance of the type X is accessible in scope\n" +
4408
		"No enclosing instance of the type X is accessible in scope\n" +
4510
		"----------\n" +
4409
		"----------\n" +
4511
		"4. WARNING in X.java (at line 14)\n" +
4410
		"2. ERROR in X.java (at line 15)\n" +
4512
		"	void baz() {\n" +
4513
		"	     ^^^^^\n" +
4514
		"The method baz() from the type Local is never used locally\n" +
4515
		"----------\n" +
4516
		"5. ERROR in X.java (at line 15)\n" +
4517
		"	foo(); //1\n" +
4411
		"	foo(); //1\n" +
4518
		"	^^^^^\n" +
4412
		"	^^^^^\n" +
4519
		"No enclosing instance of the type X is accessible in scope\n" +
4413
		"No enclosing instance of the type X is accessible in scope\n" +
4520
		"----------\n" +
4414
		"----------\n" +
4521
		"6. ERROR in X.java (at line 19)\n" +
4415
		"3. ERROR in X.java (at line 19)\n" +
4522
		"	foo();//2\n" +
4416
		"	foo();//2\n" +
4523
		"	^^^^^\n" +
4417
		"	^^^^^\n" +
4524
		"No enclosing instance of the type X is accessible in scope\n" +
4418
		"No enclosing instance of the type X is accessible in scope\n" +
4525
		"----------\n" +
4526
		"7. WARNING in X.java (at line 23)\n" +
4527
		"	void baz() {\n" +
4528
		"	     ^^^^^\n" +
4529
		"The method baz() from the type new Object(){} is never used locally\n" +
4530
		"----------\n" +
4531
		"8. WARNING in X.java (at line 32)\n" +
4532
		"	void baz() {\n" +
4533
		"	     ^^^^^\n" +
4534
		"The method baz() from the type new Object(){} is never used locally\n" +
4535
		"----------\n");
4419
		"----------\n");
4536
		return;
4420
		return;
4537
	}
4421
	}
Lines 4574-4603 Link Here
4574
			"}\n",
4458
			"}\n",
4575
		},
4459
		},
4576
		"----------\n" +
4460
		"----------\n" +
4577
		"1. WARNING in X.java (at line 7)\n" +
4461
		"1. ERROR in X.java (at line 10)\n" +
4578
		"	void baz() {\n" +
4579
		"	     ^^^^^\n" +
4580
		"The method baz() from the type new Object(){} is never used locally\n" +
4581
		"----------\n" +
4582
		"2. WARNING in X.java (at line 9)\n" +
4583
		"	void baz() {\n" +
4584
		"	     ^^^^^\n" +
4585
		"The method baz() from the type Local is never used locally\n" +
4586
		"----------\n" +
4587
		"3. ERROR in X.java (at line 10)\n" +
4588
		"	foo(); //1\n" +
4462
		"	foo(); //1\n" +
4589
		"	^^^^^\n" +
4463
		"	^^^^^\n" +
4590
		"No enclosing instance of the type X is accessible in scope\n" +
4464
		"No enclosing instance of the type X is accessible in scope\n" +
4591
		"----------\n" +
4592
		"4. WARNING in X.java (at line 18)\n" +
4593
		"	void baz() {\n" +
4594
		"	     ^^^^^\n" +
4595
		"The method baz() from the type new Object(){} is never used locally\n" +
4596
		"----------\n" +
4597
		"5. WARNING in X.java (at line 27)\n" +
4598
		"	void baz() {\n" +
4599
		"	     ^^^^^\n" +
4600
		"The method baz() from the type new Object(){} is never used locally\n" +
4601
		"----------\n");
4465
		"----------\n");
4602
}
4466
}
4603
public void test121() {
4467
public void test121() {
Lines 5338-5367 Link Here
5338
			"}", // =================
5202
			"}", // =================
5339
		},
5203
		},
5340
		"----------\n" +
5204
		"----------\n" +
5341
		"1. WARNING in X.java (at line 3)\n" +
5205
		"1. WARNING in X.java (at line 6)\n" +
5342
		"	class Local {}\n" +
5343
		"	      ^^^^^\n" +
5344
		"The type Local is never used locally\n" +
5345
		"----------\n" +
5346
		"2. WARNING in X.java (at line 4)\n" +
5347
		"	class Foo {\n" +
5348
		"	      ^^^\n" +
5349
		"The type Foo is never used locally\n" +
5350
		"----------\n" +
5351
		"3. WARNING in X.java (at line 5)\n" +
5352
		"	void foo() {\n" +
5353
		"	     ^^^^^\n" +
5354
		"The method foo() from the type Foo is never used locally\n" +
5355
		"----------\n" +
5356
		"4. WARNING in X.java (at line 6)\n" +
5357
		"	class Local {}\n" +
5206
		"	class Local {}\n" +
5358
		"	      ^^^^^\n" +
5207
		"	      ^^^^^\n" +
5359
		"The type Local is hiding the type Local\n" +
5208
		"The type Local is hiding the type Local\n" +
5360
		"----------\n" +
5361
		"5. WARNING in X.java (at line 6)\n" +
5362
		"	class Local {}\n" +
5363
		"	      ^^^^^\n" +
5364
		"The type Local is never used locally\n" +
5365
		"----------\n",
5209
		"----------\n",
5366
		"",
5210
		"",
5367
		"",
5211
		"",
Lines 5568-5579 Link Here
5568
			"}", // =================,
5412
			"}", // =================,
5569
		},
5413
		},
5570
		"----------\n" +
5414
		"----------\n" +
5571
		"1. WARNING in p\\X.java (at line 5)\n" +
5415
		"1. ERROR in p\\X.java (at line 11)\n" +
5572
		"	String variable = \"my testing\";\n" +
5573
		"	       ^^^^^^^^\n" +
5574
		"The field X.Outer.Inner.variable is never read locally\n" + 
5575
		"----------\n" +
5576
		"2. ERROR in p\\X.java (at line 11)\n" +
5577
		"	Zork z;\n" +
5416
		"	Zork z;\n" +
5578
		"	^^^^\n" +
5417
		"	^^^^\n" +
5579
		"Zork cannot be resolved to a type\n" +
5418
		"Zork cannot be resolved to a type\n" +
Lines 5627-5638 Link Here
5627
			"}", // =================,
5466
			"}", // =================,
5628
		},
5467
		},
5629
		"----------\n" +
5468
		"----------\n" +
5630
		"1. WARNING in p\\X.java (at line 4)\n" + 
5469
		"1. ERROR in p\\X.java (at line 12)\n" +
5631
		"	String variable = \"my testing\";\n" +
5632
		"	       ^^^^^^^^\n" + 
5633
		"The field X.Outer.Inner.variable is never read locally\n" + 
5634
		"----------\n" +
5635
		"2. ERROR in p\\X.java (at line 12)\n" +
5636
		"	Zork z;\n" +
5470
		"	Zork z;\n" +
5637
		"	^^^^\n" +
5471
		"	^^^^\n" +
5638
		"Zork cannot be resolved to a type\n" +
5472
		"Zork cannot be resolved to a type\n" +
Lines 6077-6118 Link Here
6077
					"}", // =================
5911
					"}", // =================
6078
				},
5912
				},
6079
				"----------\n" +
5913
				"----------\n" +
6080
				"1. WARNING in X.java (at line 6)\n" +
5914
				"1. ERROR in X.java (at line 15)\n" +
6081
				"	private static class B2F extends X { }\n" +
6082
				"	                     ^^^\n" +
6083
				"The type X.B2F is never used locally\n" +
6084
				"----------\n" +
6085
				"2. WARNING in X.java (at line 7)\n" +
6086
				"	private static class F2B extends X { }\n" +
6087
				"	                     ^^^\n" +
6088
				"The type X.F2B is never used locally\n" +
6089
				"----------\n" +
6090
				"3. WARNING in X.java (at line 13)\n" +
6091
				"	private static class B2F extends Key {\n" +
6092
				"	                     ^^^\n" +
6093
				"The type X.Key.B2F is never used locally\n" +
6094
				"----------\n" +
6095
				"4. WARNING in X.java (at line 14)\n" +
6096
				"	private static B2F create() { return new B2F(); }\n" +
6097
				"	                   ^^^^^^^^\n" +
6098
				"The method create() from the type X.Key.B2F is never used locally\n" +
6099
				"----------\n" +
6100
				"5. ERROR in X.java (at line 15)\n" +
6101
				"	public Key flip() { return F2B.create(); }\n" +
5915
				"	public Key flip() { return F2B.create(); }\n" +
6102
				"	                           ^^^\n" +
5916
				"	                           ^^^\n" +
6103
				"The type F2B is defined in an inherited type and an enclosing scope\n" +
5917
				"The type F2B is defined in an inherited type and an enclosing scope\n" +
6104
				"----------\n" +
5918
				"----------\n" +
6105
				"6. WARNING in X.java (at line 18)\n" +
5919
				"2. ERROR in X.java (at line 20)\n" +
6106
				"	private static class F2B extends Key {\n" +
6107
				"	                     ^^^\n" +
6108
				"The type X.Key.F2B is never used locally\n" +
6109
				"----------\n" +
6110
				"7. WARNING in X.java (at line 19)\n" +
6111
				"	private static F2B create() { return new F2B(); }\n" +
6112
				"	                   ^^^^^^^^\n" +
6113
				"The method create() from the type X.Key.F2B is never used locally\n" +
6114
				"----------\n" +
6115
				"8. ERROR in X.java (at line 20)\n" +
6116
				"	public Key flip() { return B2F.create(); }\n" +
5920
				"	public Key flip() { return B2F.create(); }\n" +
6117
				"	                           ^^^\n" +
5921
				"	                           ^^^\n" +
6118
				"The type B2F is defined in an inherited type and an enclosing scope\n" +
5922
				"The type B2F is defined in an inherited type and an enclosing scope\n" +
Lines 6211-6232 Link Here
6211
					"}", // =================
6015
					"}", // =================
6212
				},
6016
				},
6213
				"----------\n" +
6017
				"----------\n" +
6214
				"1. WARNING in X.java (at line 14)\n" +
6018
				"1. ERROR in X.java (at line 15)\n" +
6215
				"	private static B2F create() { return new B2F(); }\n" +
6216
				"	                   ^^^^^^^^\n" +
6217
				"The method create() from the type X.Key.B2F is never used locally\n" +
6218
				"----------\n" +
6219
				"2. ERROR in X.java (at line 15)\n" +
6220
				"	public Key flip() { return F2B.create(); }\n" +
6019
				"	public Key flip() { return F2B.create(); }\n" +
6221
				"	                           ^^^\n" +
6020
				"	                           ^^^\n" +
6222
				"The type F2B is defined in an inherited type and an enclosing scope\n" +
6021
				"The type F2B is defined in an inherited type and an enclosing scope\n" +
6223
				"----------\n" +
6022
				"----------\n" +
6224
				"3. WARNING in X.java (at line 19)\n" +
6023
				"2. ERROR in X.java (at line 20)\n" +
6225
				"	private static F2B create() { return new F2B(); }\n" +
6226
				"	                   ^^^^^^^^\n" +
6227
				"The method create() from the type X.Key.F2B is never used locally\n" +
6228
				"----------\n" +
6229
				"4. ERROR in X.java (at line 20)\n" +
6230
				"	public Key flip() { return B2F.create(); }\n" +
6024
				"	public Key flip() { return B2F.create(); }\n" +
6231
				"	                           ^^^\n" +
6025
				"	                           ^^^\n" +
6232
				"The type B2F is defined in an inherited type and an enclosing scope\n" +
6026
				"The type B2F is defined in an inherited type and an enclosing scope\n" +
Lines 6324-6355 Link Here
6324
					"}", // =================
6118
					"}", // =================
6325
				},
6119
				},
6326
				"----------\n" +
6120
				"----------\n" +
6327
				"1. WARNING in X.java (at line 11)\n" +
6121
				"1. ERROR in X.java (at line 16)\n" +
6328
				"	private class Test5 {\n" +
6329
				"	              ^^^^^\n" +
6330
				"The type X.Test5 is never used locally\n" +
6331
				"----------\n" +
6332
				"2. WARNING in X.java (at line 12)\n" +
6333
				"	private class Test4 extends Test2 {\n" +
6334
				"	              ^^^^^\n" +
6335
				"The type X.Test5.Test4 is never used locally\n" +
6336
				"----------\n" +
6337
				"3. ERROR in X.java (at line 16)\n" +
6338
				"	System.out.println(X.this.var1.trim());\n" +
6122
				"	System.out.println(X.this.var1.trim());\n" +
6339
				"	                   ^^^^^^\n" +
6123
				"	                   ^^^^^^\n" +
6340
				"No enclosing instance of the type X is accessible in scope\n" +
6124
				"No enclosing instance of the type X is accessible in scope\n" +
6341
				"----------\n" +
6125
				"----------\n" +
6342
				"4. WARNING in X.java (at line 16)\n" +
6126
				"2. WARNING in X.java (at line 16)\n" +
6343
				"	System.out.println(X.this.var1.trim());\n" +
6127
				"	System.out.println(X.this.var1.trim());\n" +
6344
				"	                          ^^^^\n" +
6128
				"	                          ^^^^\n" +
6345
				"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" +
6129
				"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" +
6346
				"----------\n" +
6130
				"----------\n" +
6347
				"5. WARNING in X.java (at line 17)\n" +
6131
				"3. WARNING in X.java (at line 17)\n" +
6348
				"	System.out.println(var1.trim());\n" +
6132
				"	System.out.println(var1.trim());\n" +
6349
				"	                   ^^^^\n" +
6133
				"	                   ^^^^\n" +
6350
				"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" +
6134
				"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" +
6351
				"----------\n" +
6135
				"----------\n" +
6352
				"6. ERROR in X.java (at line 17)\n" +
6136
				"4. ERROR in X.java (at line 17)\n" +
6353
				"	System.out.println(var1.trim());\n" +
6137
				"	System.out.println(var1.trim());\n" +
6354
				"	                   ^^^^\n" +
6138
				"	                   ^^^^\n" +
6355
				"No enclosing instance of the type X is accessible in scope\n" +
6139
				"No enclosing instance of the type X is accessible in scope\n" +
Lines 6417-6443 Link Here
6417
					"}", // =================
6201
					"}", // =================
6418
				},
6202
				},
6419
				"----------\n" +
6203
				"----------\n" +
6420
				"1. WARNING in X.java (at line 12)\n" +
6204
				"1. ERROR in X.java (at line 16)\n" +
6421
				"	private class Test4 extends Test2 {\n" +
6422
				"	              ^^^^^\n" +
6423
				"The type X.Test4 is never used locally\n" +
6424
				"----------\n" +
6425
				"2. ERROR in X.java (at line 16)\n" +
6426
				"	System.out.println(X.this.var1.trim());\n" +
6205
				"	System.out.println(X.this.var1.trim());\n" +
6427
				"	                   ^^^^^^\n" +
6206
				"	                   ^^^^^^\n" +
6428
				"No enclosing instance of the type X is accessible in scope\n" +
6207
				"No enclosing instance of the type X is accessible in scope\n" +
6429
				"----------\n" +
6208
				"----------\n" +
6430
				"3. WARNING in X.java (at line 16)\n" +
6209
				"2. WARNING in X.java (at line 16)\n" +
6431
				"	System.out.println(X.this.var1.trim());\n" +
6210
				"	System.out.println(X.this.var1.trim());\n" +
6432
				"	                          ^^^^\n" +
6211
				"	                          ^^^^\n" +
6433
				"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" +
6212
				"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" +
6434
				"----------\n" +
6213
				"----------\n" +
6435
				"4. WARNING in X.java (at line 17)\n" +
6214
				"3. WARNING in X.java (at line 17)\n" +
6436
				"	System.out.println(var1.trim());\n" +
6215
				"	System.out.println(var1.trim());\n" +
6437
				"	                   ^^^^\n" +
6216
				"	                   ^^^^\n" +
6438
				"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" +
6217
				"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" +
6439
				"----------\n" +
6218
				"----------\n" +
6440
				"5. ERROR in X.java (at line 17)\n" +
6219
				"4. ERROR in X.java (at line 17)\n" +
6441
				"	System.out.println(var1.trim());\n" +
6220
				"	System.out.println(var1.trim());\n" +
6442
				"	                   ^^^^\n" +
6221
				"	                   ^^^^\n" +
6443
				"No enclosing instance of the type X is accessible in scope\n" +
6222
				"No enclosing instance of the type X is accessible in scope\n" +
Lines 7036-7062 Link Here
7036
			"}\n",
6815
			"}\n",
7037
		},
6816
		},
7038
		"----------\n" + 
6817
		"----------\n" + 
7039
		"1. WARNING in X.java (at line 4)\n" + 
6818
		"1. WARNING in X.java (at line 8)\n" + 
7040
		"	private void c() {}\n" + 
7041
		"	             ^^^\n" + 
7042
		"The method c() from the type X is never used locally\n" + 
7043
		"----------\n" + 
7044
		"2. WARNING in X.java (at line 8)\n" + 
7045
		"	a(null);\n" + 
6819
		"	a(null);\n" + 
7046
		"	^^^^^^^\n" + 
6820
		"	^^^^^^^\n" + 
7047
		"Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + 
6821
		"Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + 
7048
		"----------\n" + 
6822
		"----------\n" + 
7049
		"3. WARNING in X.java (at line 9)\n" + 
6823
		"2. WARNING in X.java (at line 9)\n" + 
7050
		"	c(null);\n" + 
6824
		"	c(null);\n" + 
7051
		"	^^^^^^^\n" + 
6825
		"	^^^^^^^\n" + 
7052
		"Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + 
6826
		"Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + 
7053
		"----------\n" + 
6827
		"----------\n" + 
7054
		"4. WARNING in X.java (at line 14)\n" + 
6828
		"3. WARNING in X.java (at line 14)\n" + 
7055
		"	a(null);\n" + 
6829
		"	a(null);\n" + 
7056
		"	^^^^^^^\n" + 
6830
		"	^^^^^^^\n" + 
7057
		"Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + 
6831
		"Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + 
7058
		"----------\n" + 
6832
		"----------\n" + 
7059
		"5. WARNING in X.java (at line 15)\n" + 
6833
		"4. WARNING in X.java (at line 15)\n" + 
7060
		"	c(null);\n" + 
6834
		"	c(null);\n" + 
7061
		"	^^^^^^^\n" + 
6835
		"	^^^^^^^\n" + 
7062
		"Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + 
6836
		"Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + 
(-)src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java (-1 / +27 lines)
Lines 34-40 Link Here
34
	static {
34
	static {
35
//		TESTS_PREFIX = "testBug95521";
35
//		TESTS_PREFIX = "testBug95521";
36
//		TESTS_NAMES = new String[] { "testBug83127a" };
36
//		TESTS_NAMES = new String[] { "testBug83127a" };
37
//		TESTS_NUMBERS = new int[] { 46 };
37
//		TESTS_NUMBERS = new int[] { 47 };
38
//		TESTS_RANGE = new int[] { 23 -1,};
38
//		TESTS_RANGE = new int[] { 23 -1,};
39
	}
39
	}
40
	public static Test suite() {
40
	public static Test suite() {
Lines 6522-6525 Link Here
6522
			true,
6522
			true,
6523
			customOptions);
6523
			customOptions);
6524
	}
6524
	}
6525
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=324848
6526
	public void test047() {
6527
		this.runNegativeTest(
6528
			new String[] {
6529
				"X.java",
6530
				"public class X {\n" + 
6531
				"	public static void test() {\n" + 
6532
				"		final boolean x = true;\n" + 
6533
				"		new Runnable() {\n" + 
6534
				"			@Override\n" + 
6535
				"			public void run() {\n" + 
6536
				"				synchronized (X.this) {\n" + 
6537
				"					System.out.println(x);\n" + 
6538
				"				}\n" + 
6539
				"			}\n" + 
6540
				"		};\n" + 
6541
				"	}\n" + 
6542
				"}"
6543
			},
6544
			"----------\n" + 
6545
			"1. ERROR in X.java (at line 7)\n" + 
6546
			"	synchronized (X.this) {\n" + 
6547
			"	              ^^^^^^\n" + 
6548
			"No enclosing instance of the type X is accessible in scope\n" + 
6549
			"----------\n");
6550
	}
6525
}
6551
}

Return to bug 324848