fix: rename @Find's className as well

This commit is contained in:
zaaarf 2023-04-12 19:17:11 +02:00
parent 527cef56e6
commit ee12ab20c1
No known key found for this signature in database
GPG key ID: 82240E075E31FA4C
2 changed files with 2 additions and 3 deletions

View file

@ -34,7 +34,7 @@ public @interface Find {
* defaults to empty string (not an inner class) * defaults to empty string (not an inner class)
* @since 0.5.0 * @since 0.5.0
*/ */
String className() default ""; String innerName() default "";
/** /**
* For a {@link FieldProxy}, this is the name of the field to find. If omitted, * For a {@link FieldProxy}, this is the name of the field to find. If omitted,

View file

@ -10,7 +10,6 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic; import javax.tools.Diagnostic;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
import java.util.Arrays;
import java.util.function.Function; import java.util.function.Function;
import static ftbsc.lll.processor.tools.ASTUtils.*; import static ftbsc.lll.processor.tools.ASTUtils.*;
@ -125,7 +124,7 @@ public class ClassContainer {
*/ */
public static ClassContainer findOrFallback(ClassContainer fallback, Find f, ProcessingEnvironment env, ObfuscationMapper mapper) { public static ClassContainer findOrFallback(ClassContainer fallback, Find f, ProcessingEnvironment env, ObfuscationMapper mapper) {
if(f == null) return fallback; if(f == null) return fallback;
ClassContainer cl = ClassContainer.from(f, Find::value, f.className(), env, mapper); ClassContainer cl = ClassContainer.from(f, Find::value, f.innerName(), env, mapper);
return cl.fqn.equals("java.lang.Object") return cl.fqn.equals("java.lang.Object")
? fallback ? fallback
: cl; : cl;