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 17436 Details for
Bug 83648
[1.5] Enum constructor cannot be public or protected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Apply on HEAD
patch_for_83648.txt (text/plain), 4.53 KB, created by
Olivier Thomann
on 2005-01-25 16:08:03 EST
(
hide
)
Description:
Apply on HEAD
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-01-25 16:08:03 EST
Size:
4.53 KB
patch
obsolete
>Index: compiler/org/eclipse/jdt/core/compiler/IProblem.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java,v >retrieving revision 1.133 >diff -u -r1.133 IProblem.java >--- compiler/org/eclipse/jdt/core/compiler/IProblem.java 14 Jan 2005 21:34:04 -0000 1.133 >+++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 25 Jan 2005 21:04:27 -0000 >@@ -1060,6 +1060,8 @@ > int EnumAbstractMethodMustBeImplemented = MethodRelated + 758; > /** @since 3.1 */ > int EnumSwitchCannotTargetField = FieldRelated + 759; >+ /** @since 3.1 */ >+ int IllegalModifierForEnumConstructor = MethodRelated + 760; > > /** > * Var args >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java,v >retrieving revision 1.44 >diff -u -r1.44 MethodScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java 29 Nov 2004 17:29:54 -0000 1.44 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java 25 Jan 2005 21:04:27 -0000 >@@ -84,7 +84,12 @@ > // check for abnormal modifiers > int unexpectedModifiers = > ~(AccPublic | AccPrivate | AccProtected | AccStrictfp); >- if ((realModifiers & unexpectedModifiers) != 0) >+ >+ if (methodBinding.declaringClass.isEnum()) { >+ unexpectedModifiers = ~AccPrivate; >+ if ((realModifiers & unexpectedModifiers) != 0) >+ problemReporter().illegalModifierForEnumConstructor((AbstractMethodDeclaration) referenceContext); >+ } else if ((realModifiers & unexpectedModifiers) != 0) > problemReporter().illegalModifierForMethod((AbstractMethodDeclaration) referenceContext); > else if ( > (((AbstractMethodDeclaration) referenceContext).modifiers & AccStrictfp) != 0) >Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v >retrieving revision 1.219 >diff -u -r1.219 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 14 Jan 2005 21:34:04 -0000 1.219 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 25 Jan 2005 21:04:27 -0000 >@@ -1590,6 +1590,14 @@ > type.sourceStart(), > type.sourceEnd()); > } >+public void illegalModifierForEnumConstructor(AbstractMethodDeclaration constructor) { >+ this.handle( >+ IProblem.IllegalModifierForEnumConstructor, >+ NoArgument, >+ NoArgument, >+ constructor.sourceStart, >+ constructor.sourceEnd); >+} > public void illegalModifierForLocalEnum(SourceTypeBinding type) { > String[] arguments = new String[] {new String(type.sourceName())}; > this.handle( >Index: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v >retrieving revision 1.161 >diff -u -r1.161 messages.properties >--- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 25 Jan 2005 13:04:22 -0000 1.161 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 25 Jan 2005 21:04:28 -0000 >@@ -271,7 +271,7 @@ > 355 = Duplicate method {0}({2}) in type {1} > 356 = Illegal modifier for parameter {0}; only final is permitted > 357 = Duplicate modifier for the method {1} in type {0} >-358 = Illegal modifier for the method {0}.{1}({2}) >+358 = Illegal modifier for the method {0}.{2}({1}) > 359 = Illegal modifier for the interface method {0}.{1}({2}); only public & abstract are permitted > 360 = The method {1} in type {0} can only set one of public / protected / private > 361 = The method {1} cannot be declared static; static methods can only be declared in a static or top level type >@@ -515,6 +515,7 @@ > 757 = Cannot invoke super constructor from enum constructor {0}({1}) > 758 = The enum {2} can only define the abstract method {0}({1}) if it also defines enum constants with corresponding implementations > 759 = The field {0}.{1} cannot be referenced from an enum case label; only enum constants can be used in enum switch >+760 = Illegal modifier for the enum constructor; only private is permitted. > > ### VARARGS > 800 = Extended dimensions are illegal for a variable argument
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 83648
: 17436