During developing PersistenceDelegate for java.lang.reflect.Field, I find
code duplication in many primitive type persistence delegate.

There are 8 primitiveType persistenceDelegate:
java_lang_BooleanPersistenceDelegate
java_lang_BytePersistenceDelegate
java_lang_CharacterPersistenceDelegate
java_lang_DoublePersistenceDelegate
java_lang_FloatPersistenceDelegate
java_lang_IntegerPersistenceDelegate
java_lang_LongPersistenceDelegate
java_lang_ShortPersistenceDelegate

Each of the 8 class has two method: instantiate & initialize, and the logic
of the 2 methods are similar.
IMO, we could use one PrimitiveTypePersistenceDelegate instead to reduce
code duplication.
--
Spark Shen
China Software Development Lab, IBM

Reply via email to