EMF, the single underscore, and newer versions of Java. #64
threadedblue
started this conversation in
General
Replies: 1 comment
-
|
When trying to form an identifier from the value You can set the compliance level to what you are actually targeting to avoid the problem. Better would be to add |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
I am looking for a workaround.
I have a large code base that I generate with EMF. Years ago I found it would not compile with versions of Java after 8. I have been using 8 ever since. But it would be good to be able to move on to new Java.
EMF is generating code that has a single underscore as a variable name. The situation occurs mostly in the generation of enums. I can find nothing in the xsd that I am using. It appears to be an EMF thing.
Generated code snippet:
`public enum FilterOperatorEnum implements Enumerator {
/**
* The '' literal object.
*
*
*
* Equals
*
* @see #__VALUE
* @generated
* @ordered
*/
(0, "", "="), // This happens all the time.
`
My original xsd simpletype:
What in here is provoking the single underscore?
''' <xs:simpleType name="FilterOperatorEnum">
<xs:restriction base="code-primitive">
<xs:enumeration value="=">
xs:annotation
<xs:documentation xml:lang="en">Equals</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="is-a">
xs:annotation
<xs:documentation xml:lang="en">Is A (by subsumption)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="descendent-of">
xs:annotation
<xs:documentation xml:lang="en">Descendent Of (by subsumption)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="is-not-a">
xs:annotation
<xs:documentation xml:lang="en">Not (Is A) (by subsumption)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="regex">
xs:annotation
<xs:documentation xml:lang="en">Regular Expression</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="in">
xs:annotation
<xs:documentation xml:lang="en">In Set</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="not-in">
xs:annotation
<xs:documentation xml:lang="en">Not in Set</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="generalizes">
xs:annotation
<xs:documentation xml:lang="en">Generalizes (by Subsumption)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="exists">
xs:annotation
<xs:documentation xml:lang="en">Exists</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
'''
``
Beta Was this translation helpful? Give feedback.
All reactions