Skip to content

Commit

Permalink
fix regression bug in printer
Browse files Browse the repository at this point in the history
regenerate meta-/model
  • Loading branch information
wadoon committed Nov 15, 2024
1 parent b89f51c commit 82e3e91
Show file tree
Hide file tree
Showing 657 changed files with 7,989 additions and 7,986 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ void insertComments(Node node, TreeSet<Comment> commentsToAttribute) {
2) be outside all children. They could be preceding nothing, a comment or a child.
If they preceed a child they are assigned to it, otherwise they remain "orphans"
*/
List<Node> children = node.getChildNodes().stream().// Never attribute comments to modifiers.
filter(n -> !(n instanceof Modifier)).collect(toList());
// Never attribute comments to modifiers.
List<Node> // Never attribute comments to modifiers.
children = node.getChildNodes().stream().filter(n -> !(n instanceof Modifier)).collect(toList());
boolean attributeToAnnotation = !(configuration.isIgnoreAnnotationsWhenAttributingComments());
for (Node child : children) {
TreeSet<Comment> commentsInsideChild = new TreeSet<>(NODE_BY_BEGIN_POSITION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* An object that can have a parent node.
*/
public interface HasParentNode<T> extends Observable {
public interface HasParentNode<T> extends Observable {

/**
* Returns true if the parent has a parent
Expand Down
92 changes: 46 additions & 46 deletions javaparser-core/src/main/java/com/github/javaparser/JavaParser.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import java.nio.file.Path;
import java.util.Objects;

public class JavaParserAdapter {
public class JavaParserAdapter {

/**
* Wraps the {@link JavaParser}.
Expand All @@ -56,11 +56,11 @@ public static JavaParserAdapter of(JavaParser parser) {

private final JavaParser parser;

public JavaParserAdapter(JavaParser parser) {
public JavaParserAdapter(JavaParser parser) {
this.parser = Objects.requireNonNull(parser, "A non-null parser should be provided.");
}

public JavaParser getParser() {
public JavaParser getParser() {
return parser;
}

Expand All @@ -80,119 +80,119 @@ private <T extends Node> T handleResult(ParseResult<T> result) {
throw new ParseProblemException(result.getProblems());
}

public ParserConfiguration getParserConfiguration() {
public ParserConfiguration getParserConfiguration() {
return parser.getParserConfiguration();
}

public CompilationUnit parse(InputStream in) {
public CompilationUnit parse(InputStream in) {
return handleResult(getParser().parse(in));
}

public CompilationUnit parse(File file) throws FileNotFoundException {
public CompilationUnit parse(File file) throws FileNotFoundException {
return handleResult(getParser().parse(file));
}

public CompilationUnit parse(Path path) throws IOException {
public CompilationUnit parse(Path path) throws IOException {
return handleResult(getParser().parse(path));
}

public CompilationUnit parse(Reader reader) {
public CompilationUnit parse(Reader reader) {
return handleResult(getParser().parse(reader));
}

public CompilationUnit parse(String code) {
public CompilationUnit parse(String code) {
return handleResult(getParser().parse(code));
}

public CompilationUnit parseResource(String path) throws IOException {
public CompilationUnit parseResource(String path) throws IOException {
return handleResult(getParser().parseResource(path));
}

public BlockStmt parseBlock(String blockStatement) {
public BlockStmt parseBlock(String blockStatement) {
return handleResult(getParser().parseBlock(blockStatement));
}

public Statement parseStatement(String statement) {
public Statement parseStatement(String statement) {
return handleResult(getParser().parseStatement(statement));
}

public ImportDeclaration parseImport(String importDeclaration) {
public ImportDeclaration parseImport(String importDeclaration) {
return handleResult(getParser().parseImport(importDeclaration));
}

public <T extends Expression> T parseExpression(String expression) {
public <T extends Expression> T parseExpression(String expression) {
return handleResult(getParser().parseExpression(expression));
}

public AnnotationExpr parseAnnotation(String annotation) {
public AnnotationExpr parseAnnotation(String annotation) {
return handleResult(getParser().parseAnnotation(annotation));
}

public BodyDeclaration<?> parseAnnotationBodyDeclaration(String body) {
public BodyDeclaration<?> parseAnnotationBodyDeclaration(String body) {
return handleResult(getParser().parseAnnotationBodyDeclaration(body));
}

public BodyDeclaration<?> parseBodyDeclaration(String body) {
public BodyDeclaration<?> parseBodyDeclaration(String body) {
return handleResult(getParser().parseBodyDeclaration(body));
}

public ClassOrInterfaceType parseClassOrInterfaceType(String type) {
public ClassOrInterfaceType parseClassOrInterfaceType(String type) {
return handleResult(getParser().parseClassOrInterfaceType(type));
}

public Type parseType(String type) {
public Type parseType(String type) {
return handleResult(getParser().parseType(type));
}

public VariableDeclarationExpr parseVariableDeclarationExpr(String declaration) {
public VariableDeclarationExpr parseVariableDeclarationExpr(String declaration) {
return handleResult(getParser().parseVariableDeclarationExpr(declaration));
}

public Javadoc parseJavadoc(String content) {
public Javadoc parseJavadoc(String content) {
return JavadocParser.parse(content);
}

public ExplicitConstructorInvocationStmt parseExplicitConstructorInvocationStmt(String statement) {
public ExplicitConstructorInvocationStmt parseExplicitConstructorInvocationStmt(String statement) {
return handleResult(getParser().parseExplicitConstructorInvocationStmt(statement));
}

public Name parseName(String qualifiedName) {
public Name parseName(String qualifiedName) {
return handleResult(getParser().parseName(qualifiedName));
}

public SimpleName parseSimpleName(String name) {
public SimpleName parseSimpleName(String name) {
return handleResult(getParser().parseSimpleName(name));
}

public Parameter parseParameter(String parameter) {
public Parameter parseParameter(String parameter) {
return handleResult(getParser().parseParameter(parameter));
}

public PackageDeclaration parsePackageDeclaration(String packageDeclaration) {
public PackageDeclaration parsePackageDeclaration(String packageDeclaration) {
return handleResult(getParser().parsePackageDeclaration(packageDeclaration));
}

public TypeDeclaration<?> parseTypeDeclaration(String typeDeclaration) {
public TypeDeclaration<?> parseTypeDeclaration(String typeDeclaration) {
return handleResult(getParser().parseTypeDeclaration(typeDeclaration));
}

public ModuleDeclaration parseModuleDeclaration(String moduleDeclaration) {
public ModuleDeclaration parseModuleDeclaration(String moduleDeclaration) {
return handleResult(getParser().parseModuleDeclaration(moduleDeclaration));
}

public ModuleDirective parseModuleDirective(String moduleDirective) {
public ModuleDirective parseModuleDirective(String moduleDirective) {
return handleResult(getParser().parseModuleDirective(moduleDirective));
}

public TypeParameter parseTypeParameter(String typeParameter) {
public TypeParameter parseTypeParameter(String typeParameter) {
return handleResult(getParser().parseTypeParameter(typeParameter));
}

public MethodDeclaration parseMethodDeclaration(String methodDeclaration) {
public MethodDeclaration parseMethodDeclaration(String methodDeclaration) {
return handleResult(getParser().parseMethodDeclaration(methodDeclaration));
}

public ArrayInitializerExpr parseArrayInitializerExpr(String arrayInitializerExpr) {
public ArrayInitializerExpr parseArrayInitializerExpr(String arrayInitializerExpr) {
return handleResult(getParser().parseArrayInitializerExpr(arrayInitializerExpr));
}
}
Loading

0 comments on commit 82e3e91

Please sign in to comment.