Update AbstractEntity.java

refactored setDynamicProperty code