Details
Description
When running the clinic.roo sample script the following method will be generated for PetDataOnDemand:
public Pet PetDataOnDemand.getNewTransientPet(int index) { com.springsource.petclinic.domain.Pet obj = new com.springsource.petclinic.domain.Pet(); obj.setName("name_" + index); obj.setOwner(null); obj.setSendReminders(true); obj.setType(com.springsource.petclinic.reference.PetType.class.getEnumConstants()[0]); java.lang.Float weight = new Integer(index).floatValue(); if (weight < 0) { weight = 0; } obj.setWeight(weight); return obj; }
However, this gives error markers in STS for invalid type casting. A Integer type should be explicitly cast to Float:
weight = new Float(0);