Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
asm
asm
Commits
9d0bbe7f
Commit
9d0bbe7f
authored
Jan 27, 2021
by
Eric Bruneton
Browse files
Address code review comments.
parent
2efb6e08
Pipeline
#10869
passed with stage
in 8 minutes and 1 second
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
asm-commons/src/main/java/org/objectweb/asm/commons/AnnotationRemapper.java
View file @
9d0bbe7f
...
...
@@ -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
(
mapA
nnotationA
ttributeName
(
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
(
mapA
nnotationA
ttributeName
(
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
(
mapA
nnotationA
ttributeName
(
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
(
mapA
nnotationA
ttributeName
(
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
mapA
nnotationA
ttributeName
(
final
String
name
)
{
if
(
descriptor
==
null
)
{
return
name
;
}
return
remapper
.
mapAttributeName
(
descriptor
,
name
);
return
remapper
.
mapA
nnotationA
ttributeName
(
descriptor
,
name
);
}
}
asm-commons/src/main/java/org/objectweb/asm/commons/Remapper.java
View file @
9d0bbe7f
...
...
@@ -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
mapA
nnotationA
ttributeName
(
final
String
descriptor
,
final
String
name
)
{
return
name
;
}
...
...
asm-commons/src/main/java/org/objectweb/asm/commons/SimpleRemapper.java
View file @
9d0bbe7f
...
...
@@ -85,7 +85,7 @@ public class SimpleRemapper extends Remapper {
}
@Override
public
String
mapAttributeName
(
final
String
descriptor
,
final
String
name
)
{
public
String
mapA
nnotationA
ttributeName
(
final
String
descriptor
,
final
String
name
)
{
String
remappedName
=
map
(
descriptor
+
'.'
+
name
);
return
remappedName
==
null
?
name
:
remappedName
;
}
...
...
asm-commons/src/test/java/org/objectweb/asm/commons/ClassRemapperTest.java
View file @
9d0bbe7f
...
...
@@ -79,7 +79,7 @@ public class ClassRemapperTest extends AsmTest {
classNode
,
new
Remapper
()
{
@Override
public
String
mapAttributeName
(
final
String
descriptor
,
final
String
name
)
{
public
String
mapA
nnotationA
ttributeName
(
final
String
descriptor
,
final
String
name
)
{
if
(
"Lpkg/A;"
.
equals
(
descriptor
))
{
return
"new."
+
name
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment