Skip to content

Commit

Permalink
Remove all Main methods, since there might be multiple main methods i…
Browse files Browse the repository at this point in the history
…n a java file, given different classes etc.
  • Loading branch information
sarpsahinalp committed May 3, 2024
1 parent a3a9288 commit 6a9e7c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/de/tum/in/test/api/ast/model/JavaFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private static void excludeMainMethod(CompilationUnit javaFileAST) {
.filter(method -> method.isStatic() && method.getNameAsString().equals("main")
&& method.getParameters().size() == 1 && method.getType().isVoidType()
&& method.getParameter(0).getTypeAsString().equals("String[]"))
.findAny().ifPresent(Node::remove);
.forEach(Node::remove);
}

public Path getJavaFilePath() {
Expand Down

0 comments on commit 6a9e7c2

Please sign in to comment.