-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
Extra Parenthesis after Spoon getAssignment() #4807
Comments
Hi @slarse , Please let me know which spoon dependency do I need to take or update original one (v10.1.1) after this change ? |
Hi @algomaster99 , As you suggested will try changing my spoon version from 10.1.1 to 10.2.0-beta-12 and will test parenthesis issue also will wait for your green flag if the spoon changes got synced with maven central. |
@bhatnagar444 |
Following up on my conversation with @bhatnagar444 on LinkedIn, please try creating the launcher in your project like below before printing your code: Launcher launcher = new Launcher();
launcher.getEnvironment().setPrettyPrinterCreator(() -> {
DefaultJavaPrettyPrinter printer = new DefaultJavaPrettyPrinter(launcher.getEnvironment());
printer.setMinimizeRoundBrackets(true);
return printer;
}); You can use |
Since class RoundBracketMinimiser extends DefaultJavaPrettyPrinter {
public RoundBracketPrinter(Environment env) {
super(env);
this.setMinimizeRoundBrackets(true);
}
} I used this printed to print the types and it works. @slarse, have you considered making the setter in |
Not really. The DJPP is meant to above all else be correct. The round bracket minimization introduces some amount of risk for incorrectness (due to potential bugs), especially when going beyond the simple stuff of arithmetic expressions and you start venturing into casts and the like. Honestly, I can't quite recall why I implemented it in the DJPP to begin with. |
Hi Team,
I have an issue where I am getting extra parenthesis after getAssignment().
Below is the replication of the problem -
My code during build model
Input which I am giving
ResultSet rs1 = stmt.executeQuery(QUERY1 + getTableName() + QUERY2 + "id=" + javaFileName.getEmployeeId() + QUERY3);
And trying to extract what is inside executeQuery so the
Expected output - QUERY1 + getTableName() + QUERY2 + "id=" + javaFileName.getEmployeeId() + QUERY3
Output I am getting - ((((QUERY1 + getTableName()) + QUERY2) + "id=") + javaFileName.getEmployeeId()) + QUERY3
Please suggest how can I get rid of the extra parenthesis (Excluding parenthesis of methods like getTableName())...!!!
The text was updated successfully, but these errors were encountered: