Bug 87432 - Enum methods "values" and "valueOf" are not marked as synthetic
Summary: Enum methods "values" and "valueOf" are not marked as synthetic
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-08 15:35 EST by Theodora Yeung CLA
Modified: 2005-10-31 11:12 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Theodora Yeung CLA 2005-03-08 15:35:49 EST
The modifiers for synthetic method bindings "value" and "valueOf" are not 
marked with "IConstants.AccSynthetic".
Comment 1 Olivier Thomann CLA 2005-03-08 16:05:24 EST
This would be trivial to add.
Comment 2 Philipe Mulet CLA 2005-03-08 18:13:05 EST
Though these are generated methods, neither the JLS or Javac consider theem as
synthetic.

Will not change our behavior unless proven wrong.
Comment 3 Olivier Thomann CLA 2005-03-08 20:00:42 EST
The JVM specs say:

The Synthetic attribute6 is a fixed-length attribute in the attributes table of
ClassFile
(§4.2), field_info (§4.6), and method_info (§4.7) structures. A class member
that does
not appear in the source code must be marked using a Synthetic attribute, or else it
must have its ACC_SYNTHETIC bit set. The only exceptions to this requirement
are for default constructors and the class initialization method.

But at a different location it says:
A class may be marked with the ACC_SYNTHETIC flag to
indicate that it was generated by the compiler and does not appear
in the source code.

So on one side we have "must be marked" and on the other side "may be marked".
This is clearly not the same meaning.
Comment 4 Philipe Mulet CLA 2005-03-09 03:44:44 EST
I also wish these were consistent. Interestingly the enum $values field is
tagged by both javac and us as synthetic.
In this very case, these methods are not coming from anywhere, they are
overriding Enum methods, and are part of the protocol. One could argue that
overriding an API method with a synthetic one feels a bit inconsistent...
Comment 5 Philipe Mulet CLA 2005-03-09 03:45:29 EST
closing for now