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

(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
2
 * Copyright (c) 2005, 2011 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 1221-1227 Link Here
1221
		"1. ERROR in p\\X.java (at line 4)\n" +
1221
		"1. ERROR in p\\X.java (at line 4)\n" +
1222
		"	public static String s;\n" +
1222
		"	public static String s;\n" +
1223
		"	                     ^\n" +
1223
		"	                     ^\n" +
1224
		"The field s cannot be declared static; static fields can only be declared in static or top level types\n" +
1224
		"The field s cannot be declared static in a non-static inner type, unless initialized with a constant expression\n" +
1225
		"----------\n" +
1225
		"----------\n" +
1226
		"2. ERROR in p\\X.java (at line 6)\n" +
1226
		"2. ERROR in p\\X.java (at line 6)\n" +
1227
		"	X.XX.s = s;    }\n" +
1227
		"	X.XX.s = s;    }\n" +
(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java (-1 / +1 lines)
Lines 1119-1125 Link Here
1119
		"1. ERROR in X.java (at line 4)\n" +
1119
		"1. ERROR in X.java (at line 4)\n" +
1120
		"	static final String notAConstant = null;\n" +
1120
		"	static final String notAConstant = null;\n" +
1121
		"	                    ^^^^^^^^^^^^\n" +
1121
		"	                    ^^^^^^^^^^^^\n" +
1122
		"The field notAConstant cannot be declared static; static fields can only be declared in static or top level types\n" +
1122
		"The field notAConstant cannot be declared static in a non-static inner type, unless initialized with a constant expression\n" +
1123
		"----------\n");
1123
		"----------\n");
1124
}
1124
}
1125
public void testAllConstants() {
1125
public void testAllConstants() {
(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java (-1 / +1 lines)
Lines 3761-3767 Link Here
3761
		"1. ERROR in X.java (at line 3)\n" +
3761
		"1. ERROR in X.java (at line 3)\n" +
3762
		"	static int bar;\n" +
3762
		"	static int bar;\n" +
3763
		"	           ^^^\n" +
3763
		"	           ^^^\n" +
3764
		"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 in a non-static inner type, unless initialized with a constant expression\n" +
3765
		"----------\n");
3765
		"----------\n");
3766
}
3766
}
3767
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=99428 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=99655
3767
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=99428 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=99655
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties (-1 / +1 lines)
Lines 289-295 Link Here
289
343 = Illegal modifier for the interface field {0}.{1}; only public, static & final are permitted
289
343 = Illegal modifier for the interface field {0}.{1}; only public, static & final are permitted
290
344 = The field {0} can only set one of public / protected / private
290
344 = The field {0} can only set one of public / protected / private
291
345 = The field {0} can be either final or volatile, not both
291
345 = The field {0} can be either final or volatile, not both
292
346 = The field {0} cannot be declared static; static fields can only be declared in static or top level types
292
346 = The field {0} cannot be declared static in a non-static inner type, unless initialized with a constant expression
293
293
294
###[obsolete] 350 = {2} cannot be resolved (or is not a valid type) for the field {1}.{0}
294
###[obsolete] 350 = {2} cannot be resolved (or is not a valid type) for the field {1}.{0}
295
###[obsolete] 351 = The type {2} is not visible for the field {1}.{0}
295
###[obsolete] 351 = The type {2} is not visible for the field {1}.{0}

Return to bug 343480