mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8343881: java.lang.classfile.Attribute attributeName() method should return Utf8Entry
Reviewed-by: liach
This commit is contained in:
parent
75c651f859
commit
ba39321902
29 changed files with 415 additions and 45 deletions
|
@ -25,6 +25,7 @@
|
|||
package java.lang.classfile;
|
||||
|
||||
import java.lang.classfile.attribute.*;
|
||||
import java.lang.classfile.constantpool.Utf8Entry;
|
||||
|
||||
import jdk.internal.classfile.impl.BoundAttribute;
|
||||
import jdk.internal.classfile.impl.UnboundAttribute;
|
||||
|
@ -65,7 +66,7 @@ public sealed interface Attribute<A extends Attribute<A>>
|
|||
/**
|
||||
* {@return the name of the attribute}
|
||||
*/
|
||||
String attributeName();
|
||||
Utf8Entry attributeName();
|
||||
|
||||
/**
|
||||
* {@return the {@link AttributeMapper} associated with this attribute}
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
*/
|
||||
package java.lang.classfile;
|
||||
|
||||
import java.lang.classfile.constantpool.Utf8Entry;
|
||||
import jdk.internal.classfile.impl.TemporaryConstantPool;
|
||||
import jdk.internal.javac.PreviewFeature;
|
||||
|
||||
/**
|
||||
|
@ -55,8 +57,8 @@ public abstract non-sealed class CustomAttribute<T extends CustomAttribute<T>>
|
|||
}
|
||||
|
||||
@Override
|
||||
public final String attributeName() {
|
||||
return mapper.name();
|
||||
public Utf8Entry attributeName() {
|
||||
return TemporaryConstantPool.INSTANCE.utf8Entry(mapper.name());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue