harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Spark Shen" <smallsmallor...@gmail.com>
Subject [classlib][beans] Code seems duplicate for primitive persistence delegate
Date Thu, 12 Jul 2007 03:12:38 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message