Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Major
-
Resolution: Complete
-
Affects Version/s: 1.2.2.RELEASE
-
Fix Version/s: 1.2.3.RELEASE
-
Component/s: WEB MVC
-
Labels:
-
Environment:Ubuntu 12.04, JDK 1.0.6_33, Maven 3.0.4
Description
Generate a web mvc application and scaffold it with next script:
project --topLevelPackage org.gvnix.test
jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
entity jpa --class ~.domain.Car --identifierField car
field string --fieldName name
web mvc setup
web mvc all --package ~.web
When entity name and identifier field has the same name, a compilation error occurs:
[ERROR] /tmp/test/src/main/java/org/gvnix/test/web/CarController_Roo_Controller.aj:79:0::0 Duplicate local variable car [ERROR] error at Car car = Car.findCar(car);
This happens because method parameter and method local variable have same name:
@RequestMapping(value = "/{car}", method = RequestMethod.DELETE, produces = "text/html") public String CarController.delete(@PathVariable("car") Long car, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) { Car car = Car.findCar(car); ... }
I attach the example project.