Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Replace CREATE OBJECT with NEW constructor" leads syntax error in Release 7.31 #119

Closed
DirkBor opened this issue Sep 28, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@DirkBor
Copy link

DirkBor commented Sep 28, 2023

In the ABAP Cleaner, 7.50 can be selected as the lowest ABAP release.
At the moment we are mainly working on a 7.31 release.
The rule "Replace CREATE OBJECT with NEW constructor" is used as default.
I have to switch off this rule, because otherwise this rule generates a statement, which leads to a syntax error in our release (7.31).

@jmgrassau jmgrassau self-assigned this Sep 30, 2023
@jmgrassau jmgrassau added the bug Something isn't working label Sep 30, 2023
@jmgrassau
Copy link
Member

Hi DirkBor,

thank you very much for reporting this! I now did some more research on when exactly the NEW operator was introduced (in 7.40 SP2), and whether further restrictions must be added for other cleanup rules. Looks like we're now fine down to version 7.02 = 7.0, EhP2. Cleanup rules that merely "react" on newer syntax such as ABAP Doc, VALUE constructors etc. are no problem; restrictions must only be defined for cleanup rules that introduce newer syntax to the code.

So, older releases starting from 7.02 were added on the UI …

image

… and a restriction was added to the rule "Replace CREATE OBJECT with NEW constructor"

image

… to automatically deactivate it if an older release was detected in the code, or selected on the UI.

With that, the issue should be fixed with the next ABAP cleaner release!

Kind regards,
Jörg-Michael

@jmgrassau
Copy link
Member

Hi DirkBor,

thanks again for opening this issue! Added support for ABAP 7.02…7.42 is now part of ABAP cleaner version 1.6.0, which was just released. I hope we now have all restrictions down to ABAP 7.02 defined correctly; if you encounter any new issues on ABAP 7.31, please let us know!

Kind regards,
Jörg-Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants