Skip to content

Commit

Permalink
Duplicate methods
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Mar 25, 2024
1 parent 1f1457f commit 4278611
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,35 +433,6 @@ private ASTNode convertMethodInAnnotationTypeDecl(JCMethodDecl javac, ASTNode pa
return res;
}

private String getNodeName(ASTNode node) {
if( node instanceof AbstractTypeDeclaration atd) {
return atd.getName().toString();
}
if( node instanceof EnumDeclaration ed) {
return ed.getName().toString();
}
return null;
}

private String getMethodDeclName(JCMethodDecl javac, ASTNode parent) {
String name = javac.getName().toString();
boolean javacIsConstructor = Objects.equals(javac.getName(), Names.instance(this.context).init);
if( javacIsConstructor) {
// sometimes javac mistakes a method with no return type as a constructor
String parentName = getNodeName(parent);
String tmpString1 = this.rawText.substring(javac.pos);
int openParen = tmpString1.indexOf("(");
if( openParen != -1 ) {
String methodName = tmpString1.substring(0, openParen).trim();
if( !methodName.equals(parentName)) {
return methodName;
}
}
return parentName;
}
return name;
}

private String getNodeName(ASTNode node) {
if( node instanceof AbstractTypeDeclaration atd) {
return atd.getName().toString();
Expand Down
Binary file modified org.eclipse.jdt.core/jdtCompilerAdapter.jar
Binary file not shown.

0 comments on commit 4278611

Please sign in to comment.