My answer for – What is wrong with this code #02

A lot of things can be found in the snippet at “What is wrong with this code #02″. Here it is again: [sourcecode language=”java”] public MyObject { private String myField; … (imagine multiple fields) … public GenericObject toGenericObject() { GenericObjectFactory genericObjectFactory = GenericObjectFactory.getInstance(); GenericObject genericObject = genericObjectFactory.create("myObject"); genericObject.setField("myField", myField); // imagine multiple lines using genericObject.setField("field", […]