|
19 | 19 | package net.fabricmc.tinyremapper.extension.mixin.soft.annotation.injection; |
20 | 20 |
|
21 | 21 | import java.util.Objects; |
22 | | -import java.util.Optional; |
23 | 22 |
|
24 | 23 | import org.objectweb.asm.AnnotationVisitor; |
25 | 24 | import org.objectweb.asm.tree.AnnotationNode; |
26 | 25 |
|
27 | | -import net.fabricmc.tinyremapper.api.TrMember; |
28 | 26 | import net.fabricmc.tinyremapper.extension.mixin.common.IMappable; |
29 | | -import net.fabricmc.tinyremapper.extension.mixin.common.ResolveUtility; |
30 | 27 | import net.fabricmc.tinyremapper.extension.mixin.common.data.Annotation; |
31 | 28 | import net.fabricmc.tinyremapper.extension.mixin.common.data.AnnotationElement; |
32 | 29 | import net.fabricmc.tinyremapper.extension.mixin.common.data.CommonData; |
33 | 30 | import net.fabricmc.tinyremapper.extension.mixin.common.data.Constant; |
34 | | -import net.fabricmc.tinyremapper.extension.mixin.common.data.Message; |
35 | 31 | import net.fabricmc.tinyremapper.extension.mixin.soft.data.MemberInfo; |
36 | 32 |
|
37 | 33 | /** |
@@ -87,7 +83,7 @@ public void visit(String name, Object value) { |
87 | 83 | if (this.value.equals("NEW")) { |
88 | 84 | value = new AtConstructorMappable(data, info).result().toString(); |
89 | 85 | } else { |
90 | | - value = new AtMethodMappable(data, info).result().toString(); |
| 86 | + value = new AtMemberMappable(data, info).result().toString(); |
91 | 87 | } |
92 | 88 | } |
93 | 89 | } |
@@ -122,36 +118,6 @@ public void visit(String name, Object value) { |
122 | 118 | } |
123 | 119 | } |
124 | 120 |
|
125 | | - private static class AtMethodMappable implements IMappable<MemberInfo> { |
126 | | - private final CommonData data; |
127 | | - private final MemberInfo info; |
128 | | - |
129 | | - AtMethodMappable(CommonData data, MemberInfo info) { |
130 | | - this.data = Objects.requireNonNull(data); |
131 | | - this.info = Objects.requireNonNull(info); |
132 | | - } |
133 | | - |
134 | | - @Override |
135 | | - public MemberInfo result() { |
136 | | - if (!info.isFullyQualified()) { |
137 | | - data.getLogger().warn(Message.NOT_FULLY_QUALIFIED, info); |
138 | | - return info; |
139 | | - } |
140 | | - |
141 | | - Optional<TrMember> resolved = data.resolver.resolveMember(info.getOwner(), info.getName(), info.getDesc(), ResolveUtility.FLAG_UNIQUE | ResolveUtility.FLAG_RECURSIVE); |
142 | | - |
143 | | - if (resolved.isPresent()) { |
144 | | - String newOwner = data.mapper.asTrRemapper().map(info.getOwner()); |
145 | | - String newName = data.mapper.mapName(resolved.get()); |
146 | | - String newDesc = data.mapper.mapDesc(resolved.get()); |
147 | | - |
148 | | - return new MemberInfo(newOwner, newName, info.getQuantifier(), newDesc); |
149 | | - } else { |
150 | | - return info; |
151 | | - } |
152 | | - } |
153 | | - } |
154 | | - |
155 | 121 | private static class AtConstructorMappable implements IMappable<MemberInfo> { |
156 | 122 | private final CommonData data; |
157 | 123 | private final MemberInfo info; |
|
0 commit comments