Skip to content

Commit

Permalink
Fix ambiguity in generated code.
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-schlichtherle committed Aug 18, 2023
1 parent 46cb0a4 commit efa924d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions java/src/main/java/bali/java/AnnotationProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,6 @@ ExecutableElement getMethodElement() {

abstract class ModuleMethod extends Method {

@Getter(lazy = true)
private final Name localMakeElementName =
getMakeElementPackage().equals(getPackageElement())
? getMakeElement().getSimpleName()
: ((QualifiedNameable) getMakeElement()).getQualifiedName();

@Getter(lazy = true)
private final String localMakeType =
getMakeElementPackage().equals(getPackageElement())
Expand All @@ -410,10 +404,13 @@ abstract class ModuleMethod extends Method {
private final Element makeElement = element(getMakeType());

@Getter(lazy = true)
private final Name makeElementSimpleName = getMakeElement().getSimpleName();
private final PackageElement makeElementPackage = packageOf(getMakeElement());

@Getter(lazy = true)
private final PackageElement makeElementPackage = packageOf(getMakeElement());
private final Name makeElementQualifiedName = ((QualifiedNameable) getMakeElement()).getQualifiedName();

@Getter(lazy = true)
private final Name makeElementSimpleName = getMakeElement().getSimpleName();

@Getter(lazy = true)
private final TypeMirror makeType = resolveMakeType();
Expand Down Expand Up @@ -563,7 +560,7 @@ private String resolveAccessedElementRef() {
return isParameterRef()
? getModuleParamName().toString()
: isSuperRef()
? (isMakeTypeInterface() ? getLocalMakeElementName() + "." : "") + "super." + getMethodName() + "(" + getMethodParametersWithoutTypesList() + ")"
? (isMakeTypeInterface() ? getMakeElementQualifiedName() + "." : "") + "super." + getMethodName() + "(" + getMethodParametersWithoutTypesList() + ")"
: getAccessedElement().map(Tuple2::getT1).orElseGet(ModuleInterface.this::getElement).getSimpleName()
+ (isStaticRef() ? "$" : "$.this")
+ (isModuleRef() ? "" : "." + (isFieldRef() ? getModuleFieldName() + "" : getModuleMethodName() + "(" + getMethodParametersWithoutTypesList() + ")"));
Expand Down

0 comments on commit efa924d

Please sign in to comment.