Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 204279 Details for
Bug 343480
[compiler] Incorrect/confusing error message on inner class static field declaration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed fix
HEAD--Fixed-bug-343480-compiler-Incorrect-confusing-.patch (text/plain), 4.22 KB, created by
Ayushman Jain
on 2011-09-29 06:10:43 EDT
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2011-09-29 06:10:43 EDT
Size:
4.22 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java >index 42ccda4..72307e8 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2010 IBM Corporation and others. >+ * Copyright (c) 2005, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -1221,7 +1221,7 @@ > "1. ERROR in p\\X.java (at line 4)\n" + > " public static String s;\n" + > " ^\n" + >- "The field s cannot be declared static; static fields can only be declared in static or top level types\n" + >+ "The field s cannot be declared static in a non-static inner type, unless initialized with a constant expression\n" + > "----------\n" + > "2. ERROR in p\\X.java (at line 6)\n" + > " X.XX.s = s; }\n" + >diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java >index 66eeb0d..f63a060 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java >@@ -1119,7 +1119,7 @@ > "1. ERROR in X.java (at line 4)\n" + > " static final String notAConstant = null;\n" + > " ^^^^^^^^^^^^\n" + >- "The field notAConstant cannot be declared static; static fields can only be declared in static or top level types\n" + >+ "The field notAConstant cannot be declared static in a non-static inner type, unless initialized with a constant expression\n" + > "----------\n"); > } > public void testAllConstants() { >diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java >index b9f580f..aa4d472 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java >@@ -3761,7 +3761,7 @@ > "1. ERROR in X.java (at line 3)\n" + > " static int bar;\n" + > " ^^^\n" + >- "The field bar cannot be declared static; static fields can only be declared in static or top level types\n" + >+ "The field bar cannot be declared static in a non-static inner type, unless initialized with a constant expression\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99428 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=99655 >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >index d62074b..9db1ba2 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >@@ -289,7 +289,7 @@ > 343 = Illegal modifier for the interface field {0}.{1}; only public, static & final are permitted > 344 = The field {0} can only set one of public / protected / private > 345 = The field {0} can be either final or volatile, not both >-346 = The field {0} cannot be declared static; static fields can only be declared in static or top level types >+346 = The field {0} cannot be declared static in a non-static inner type, unless initialized with a constant expression > > ###[obsolete] 350 = {2} cannot be resolved (or is not a valid type) for the field {1}.{0} > ###[obsolete] 351 = The type {2} is not visible for the field {1}.{0}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 343480
: 204279