Bug 66533 - [1.5] add a warning for 'enum' used as identifier
Summary: [1.5] add a warning for 'enum' used as identifier
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: 3.1 M2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-10 11:56 EDT by Adam Kiezun CLA
Modified: 2005-08-22 09:31 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2004-06-10 11:56:59 EDT
3.0rc1
(javac does that)

in 1.5 enum is a keyword - we should have an options warning on all lower 
levels saying that this is the case. (just like with 'assert')
Comment 1 Philipe Mulet CLA 2004-06-11 05:45:57 EDT
that was actually planned for all new 1.5 keywords, in 1.5 branch.
Comment 2 Adam Kiezun CLA 2004-06-11 09:30:48 EDT
what are the other keywords?
i thought it was just enum.
Comment 3 David Audel CLA 2004-09-06 11:33:04 EDT
Fixed and test added
  Compliance_1_3#test84()
  Compliance_1_4#test84()
  Compliance_1_5#test84()

The new compiler option is

* COMPILER / Reporting Usage of 'enum' Identifier
*    When enabled, the compiler will issue an error or a warning 
whenever 'enum' is 
*    used as an identifier (reserved keyword in 1.5)
*     - option 
id:         "org.eclipse.jdt.core.compiler.problem.enumIdentifier"
*     - possible values:   { "error", "warning", "ignore" }
*     - default:           "warning"

And added a new constant to JavaCore
  JavaCore#COMPILER_PB_ENUM_IDENTIFIER
Comment 4 David Audel CLA 2004-09-23 08:10:31 EDT
Verified in I200409240100.
Comment 5 Niall Smart CLA 2005-08-22 09:21:25 EDT
Is it possible to turn this warning off?
Comment 6 David Audel CLA 2005-08-22 09:31:13 EDT
Look at 'Preferences>Java>Compiler>JDK Compliance'.
Uncheck 'Use default compliance setting' and change the severity of 'Disallow
identifiers caller 'enum''.