[ROO-3941] Avoid creation of @Autowired constructors for JSON and THYMELEAF controllers when there is already one in .java Created: 26/Oct/17  Updated: 11/Apr/18  Resolved: 26/Oct/17

Status: Resolved
Project: Spring Roo
Component/s: WEB MVC
Affects Version/s: 2.0.0.RC2
Fix Version/s: 2.0.0.RC3

Type: Bug Priority: Minor
Reporter: Sergio Clares Martínez Assignee: Jose Manuel Vivó ( Chema ) - DISID.
Resolution: Complete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When user adds a custom @Autowired constructor in any controller class, with different args that constructor managed by Roo, this constructor remains in the ITD with @Autowired so there are compilation problems.

Try to solve this by removing @Autowired on ITD constructor if already exists one in the .java.



 Comments   
Comment by Jose Manuel Vivó ( Chema ) - DISID. [ 26/Oct/17 ]

Fixed in c698f5e

For Thymeleaf and JSON controllers.

Comment by Jose Manuel Vivó ( Chema ) - DISID. [ 11/Apr/18 ]

Now if Roo detects a @Autowired constructor already declared in java file, in .aj file a constructor is generated but without @Autowired annotation.

This makes able to still use the .aj file constructor without push-in it.

Generated at Mon Aug 03 12:39:09 UTC 2020 using Jira 8.5.4#805004-sha1:0444eab799707f9ad7b248d69f858774aadfd250.