André C. Silva
André C. Silva
Moving statements may make their associated comments disappear from LexicalPreservingPrinter output. An example: ```java String code = """ class A{ void f(){ // first comment int a = 1; //...
Despite the recommendation from the associated sonar rule to replace: ```java List numbers = someStream.collect(Collectors.toList()); ``` ```java List numbers = someStream.toList(); ``` These are not the same. The second one...
Consider the following snippet: ```java String code = """ import java.nio.file.Files; import java.io.File; import java.io.BufferedWriter; class A{ void f(File f){ // first comment BufferedWriter writer = Files.newBufferedWriter(f.toPath()); // second comment...
Using JavaParser 3.24.7 Consider the following MWE and its output: ```java public class LexicalBugMWE{ public static void main(String[] args) { CompilationUnit cu = StaticJavaParser.parse("class A {\n" + " void foo()...
\close #work