Commit bc61facc authored by Marco Konersmann's avatar Marco Konersmann

Fixes naming of field types in JEE delegation

parent 9e52de87
Pipeline #3032 failed with stages
in 1 minute and 19 seconds
......@@ -124,14 +124,14 @@ public class ChildTypeTransformation
List<EObject> targets = Models.getTargetsAsList(modelElement, eReference);
for (EObject target : targets) {
String originalTargetName = getNameAttributeValue(target);
String targetName = originalTargetName;
targetName = Character.toLowerCase(targetName.charAt(0)) + targetName.substring(1);
String upperCaseName = Character.toUpperCase(originalTargetName.charAt(0)) + originalTargetName.substring(1);
String lowerCaseName = Character.toLowerCase(originalTargetName.charAt(0)) + originalTargetName.substring(1);
IType type = (IType) getIALHolder().getIALCodeElement();
IField field = type.getField(targetName);
IField field = type.getField(lowerCaseName);
if (field == null || !field.exists()) {
try {
String content = "@Inject\r";
content += "" + originalTargetName + " " + targetName + ";\r\r";
content += "" + upperCaseName + " " + lowerCaseName + ";\r\r";
type.createField(content, null, true, null);
} catch (JavaModelException e) {
e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment