mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8333749: Consolidate ConstantDesc conversion in java.base
Co-authored-by: Claes Redestad <redestad@openjdk.org> Reviewed-by: redestad, jvernee
This commit is contained in:
parent
a6fc2f839a
commit
8d2f9e57c3
13 changed files with 208 additions and 142 deletions
|
@ -70,6 +70,7 @@ import java.util.Optional;
|
|||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import jdk.internal.constant.ConstantUtils;
|
||||
import jdk.internal.javac.PreviewFeature;
|
||||
import jdk.internal.loader.BootLoader;
|
||||
import jdk.internal.loader.BuiltinClassLoader;
|
||||
|
@ -4709,7 +4710,7 @@ public final class Class<T> implements java.io.Serializable,
|
|||
public Optional<ClassDesc> describeConstable() {
|
||||
Class<?> c = isArray() ? elementType() : this;
|
||||
return c.isHidden() ? Optional.empty()
|
||||
: Optional.of(ClassDesc.ofDescriptor(descriptorString()));
|
||||
: Optional.of(ConstantUtils.classDesc(this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue