Skip to content

Commit d0099bd

Browse files
committed
improve apply() change to handle String, Boolean and Integer
1 parent 4a956d1 commit d0099bd

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

utils/SolutionDriver/src/main/java/Changes/impl/AttributePropertyChangeImpl.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,24 @@ public String toString() {
215215

216216
@Override
217217
public void apply() {
218-
this.getAffectedElement().eSet(this.getFeature(), this.getNewValue());
218+
if (this.getNewValue() != null) {
219+
switch (this.getFeature().getEType().getName()) {
220+
case "EString":
221+
this.getAffectedElement().eSet(this.getFeature(), this.getNewValue());
222+
break;
223+
case "EInt":
224+
this.getAffectedElement().eSet(this.getFeature(), Integer.parseInt(this.getNewValue()));
225+
break;
226+
case "EBoolean":
227+
this.getAffectedElement().eSet(this.getFeature(), Boolean.parseBoolean(this.getNewValue()));
228+
break;
229+
default:
230+
break;
231+
}
232+
}
233+
else {
234+
this.getAffectedElement().eSet(this.getFeature(), null);
235+
}
219236
}
220237

221238
} //AttributePropertyChangeImpl

0 commit comments

Comments
 (0)