Commit 9d0bbe7f authored by Eric Bruneton's avatar Eric Bruneton
Browse files

Address code review comments.

parent 2efb6e08
Pipeline #10869 passed with stage
in 8 minutes and 1 second
......@@ -114,18 +114,18 @@ public class AnnotationRemapper extends AnnotationVisitor {
@Override
public void visit(final String name, final Object value) {
super.visit(mapAttributeName(name), remapper.mapValue(value));
super.visit(mapAnnotationAttributeName(name), remapper.mapValue(value));
}
@Override
public void visitEnum(final String name, final String descriptor, final String value) {
super.visitEnum(mapAttributeName(name), remapper.mapDesc(descriptor), value);
super.visitEnum(mapAnnotationAttributeName(name), remapper.mapDesc(descriptor), value);
}
@Override
public AnnotationVisitor visitAnnotation(final String name, final String descriptor) {
AnnotationVisitor annotationVisitor =
super.visitAnnotation(mapAttributeName(name), remapper.mapDesc(descriptor));
super.visitAnnotation(mapAnnotationAttributeName(name), remapper.mapDesc(descriptor));
if (annotationVisitor == null) {
return null;
} else {
......@@ -137,7 +137,7 @@ public class AnnotationRemapper extends AnnotationVisitor {
@Override
public AnnotationVisitor visitArray(final String name) {
AnnotationVisitor annotationVisitor = super.visitArray(mapAttributeName(name));
AnnotationVisitor annotationVisitor = super.visitArray(mapAnnotationAttributeName(name));
if (annotationVisitor == null) {
return null;
} else {
......@@ -185,8 +185,8 @@ public class AnnotationRemapper extends AnnotationVisitor {
* createAnnotationRemapper method.
* @return either this object, or the given one.
*/
AnnotationVisitor orDeprecatedValue(final AnnotationVisitor deprecatedAnnotationVisitor) {
if (deprecatedAnnotationVisitor.getClass().equals(getClass())) {
final AnnotationVisitor orDeprecatedValue(final AnnotationVisitor deprecatedAnnotationVisitor) {
if (deprecatedAnnotationVisitor.getClass() == getClass()) {
AnnotationRemapper deprecatedAnnotationRemapper =
(AnnotationRemapper) deprecatedAnnotationVisitor;
if (deprecatedAnnotationRemapper.api == api
......@@ -205,10 +205,10 @@ public class AnnotationRemapper extends AnnotationVisitor {
* @param name the name of the annotation attribute.
* @return the new name of the annotation attribute.
*/
private String mapAttributeName(final String name) {
private String mapAnnotationAttributeName(final String name) {
if (descriptor == null) {
return name;
}
return remapper.mapAttributeName(descriptor, name);
return remapper.mapAnnotationAttributeName(descriptor, name);
}
}
......@@ -244,7 +244,7 @@ public abstract class Remapper {
* @param name the name of the annotation attribute.
* @return the new name of the annotation attribute.
*/
public String mapAttributeName(final String descriptor, final String name) {
public String mapAnnotationAttributeName(final String descriptor, final String name) {
return name;
}
......
......@@ -85,7 +85,7 @@ public class SimpleRemapper extends Remapper {
}
@Override
public String mapAttributeName(final String descriptor, final String name) {
public String mapAnnotationAttributeName(final String descriptor, final String name) {
String remappedName = map(descriptor + '.' + name);
return remappedName == null ? name : remappedName;
}
......
......@@ -79,7 +79,7 @@ public class ClassRemapperTest extends AsmTest {
classNode,
new Remapper() {
@Override
public String mapAttributeName(final String descriptor, final String name) {
public String mapAnnotationAttributeName(final String descriptor, final String name) {
if ("Lpkg/A;".equals(descriptor)) {
return "new." + name;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment