Bug 66533

Summary: [1.5] add a warning for 'enum' used as identifier
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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''.