Skip to content

Commit

Permalink
correctly parse descriptors from internal names
Browse files Browse the repository at this point in the history
  • Loading branch information
Machine-Maker committed Jun 23, 2024
1 parent e3c2607 commit d441f4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/papermc/asm/util/DescriptorUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
import java.util.Set;
import java.util.function.Predicate;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.objectweb.asm.Type;

public final class DescriptorUtils {

public static ClassDesc fromOwner(final String owner) {
return ClassDesc.ofDescriptor("L" + owner + ";");
return ClassDesc.ofDescriptor(Type.getObjectType(owner).getDescriptor());
}

public static String toOwner(final ClassDesc desc) {
final String descriptor = desc.descriptorString();
return descriptor.substring(1, descriptor.length() - 1);
return Type.getType(desc.descriptorString()).getInternalName();
}

public static ClassDesc desc(final Class<?> clazz) {
Expand Down

0 comments on commit d441f4a

Please sign in to comment.