aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/lll/processor/containers/ClassContainer.java
diff options
context:
space:
mode:
author zaaarf <me@zaaarf.foo>2024-06-02 21:30:10 +0200
committer zaaarf <me@zaaarf.foo>2024-06-02 21:30:10 +0200
commitf93c7b9e169eedeaf6caaa860cbc45cd8f2ffb2a (patch)
tree65676f80261f476461138547c03aaee0e1dd2e15 /src/main/java/ftbsc/lll/processor/containers/ClassContainer.java
parent2d944f31c54e89f922f2a8d475a9d0c38cec5b8f (diff)
fix: map overridden methods using top-level's name0.6.4
Diffstat (limited to 'src/main/java/ftbsc/lll/processor/containers/ClassContainer.java')
-rw-r--r--src/main/java/ftbsc/lll/processor/containers/ClassContainer.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/ftbsc/lll/processor/containers/ClassContainer.java b/src/main/java/ftbsc/lll/processor/containers/ClassContainer.java
index f19c0c4..047bc47 100644
--- a/src/main/java/ftbsc/lll/processor/containers/ClassContainer.java
+++ b/src/main/java/ftbsc/lll/processor/containers/ClassContainer.java
@@ -6,7 +6,6 @@ import ftbsc.lll.processor.annotations.Find;
import ftbsc.lll.processor.annotations.Patch;
import ftbsc.lll.processor.ProcessorOptions;
-import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic;
import java.lang.annotation.Annotation;
@@ -26,11 +25,11 @@ public class ClassContainer {
public final ClassData data;
/**
- * The {@link Element} corresponding to the class.
+ * The {@link TypeElement} corresponding to the class.
* May only be null intentionally i.e. when the associated element is
* an anonymous class or a child of an anonymous class.
*/
- public final Element elem;
+ public final TypeElement elem;
/**
* Private constructor, called from {@link #from(Annotation, Function, String, ProcessorOptions)}.
@@ -40,7 +39,7 @@ public class ClassContainer {
*/
private ClassContainer(String fqn, String[] innerNames, ProcessorOptions options) {
//find and validate
- Element elem = options.env.getElementUtils().getTypeElement(fqn);
+ TypeElement elem = options.env.getElementUtils().getTypeElement(fqn);
if(elem == null)
throw new TargetNotFoundException("class", fqn);
@@ -71,6 +70,7 @@ public class ClassContainer {
.getEnclosedElements()
.stream()
.filter(e -> e instanceof TypeElement)
+ .map(e -> (TypeElement) e)
.filter(e -> e.getSimpleName().contentEquals(inner))
.findFirst()
.orElse(null);