From 4f295f23ea6b6e3d7921a938a622d45184e18046 Mon Sep 17 00:00:00 2001 From: Wagyourtail Date: Thu, 23 May 2024 16:17:18 -0500 Subject: [PATCH] downgrade types when getting descriptors/supertypes --- .../java/xyz/wagyourtail/jvmdg/version/VersionProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/xyz/wagyourtail/jvmdg/version/VersionProvider.java b/src/main/java/xyz/wagyourtail/jvmdg/version/VersionProvider.java index cdbdd05e..41af4ee0 100644 --- a/src/main/java/xyz/wagyourtail/jvmdg/version/VersionProvider.java +++ b/src/main/java/xyz/wagyourtail/jvmdg/version/VersionProvider.java @@ -715,7 +715,7 @@ public Set apply(Type o) throws IOException { members = new HashSet<>(); for (MethodNode method : ro.methods) { if ((method.access & (Opcodes.ACC_ABSTRACT | Opcodes.ACC_PRIVATE)) != 0) continue; - members.add(new MemberNameAndDesc(method.name, Type.getMethodType(method.desc))); + members.add(new MemberNameAndDesc(method.name, downgrader.stubClass(ro.version, Type.getMethodType(method.desc)))); } } } @@ -733,7 +733,7 @@ public List> apply(Type o) throws IOException { ClassNode ro = getReadOnly.apply(o.getInternalName()); if (ro != null) { types = new ArrayList<>(); - types.add(new Pair<>(Type.getObjectType(ro.superName), Boolean.FALSE)); + types.add(new Pair<>(downgrader.stubClass(ro.version, Type.getObjectType(ro.superName)), Boolean.FALSE)); for (String anInterface : ro.interfaces) { types.add(new Pair<>(Type.getObjectType(anInterface), Boolean.TRUE)); }