summaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/lll/proxies
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-03-27 20:12:36 +0200
committer zaaarf <zaaarf@proton.me>2023-03-27 20:12:36 +0200
commitab7fbd3f6eeb9d8a6642d14f5b60b76fe6c48714 (patch)
treea4d8235219b7c710f5aa3e73ee5485a1c51dc04d /src/main/java/ftbsc/lll/proxies
parentac4ce489b7d3effb139d14b5872eb0c493397e4f (diff)
fix: broken composition of fully qualified name in TypeProxy
Diffstat (limited to 'src/main/java/ftbsc/lll/proxies')
-rw-r--r--src/main/java/ftbsc/lll/proxies/QualifiableProxy.java8
-rw-r--r--src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/ftbsc/lll/proxies/QualifiableProxy.java b/src/main/java/ftbsc/lll/proxies/QualifiableProxy.java
index d245124..91ebaa1 100644
--- a/src/main/java/ftbsc/lll/proxies/QualifiableProxy.java
+++ b/src/main/java/ftbsc/lll/proxies/QualifiableProxy.java
@@ -37,10 +37,10 @@ public abstract class QualifiableProxy extends AbstractProxy {
* @return the parent, or null if the parent was the root element
*/
protected static String extractParentFromFQN(String fqn) {
- String lastSeparator = fqn.contains("$") ? "\\$" : "\\.";
- String[] split = fqn.split(lastSeparator);
- if(split.length == 1) return null;
- return fqn.substring(0, split[split.length - 1].length() - 1);
+ String lastSeparator = fqn.contains("$") ? "$" : ".";
+ int pos = fqn.lastIndexOf(lastSeparator);
+ if(pos == -1) return null;
+ return fqn.substring(0, pos);
}
/**
diff --git a/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java b/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java
index 5782609..8001f06 100644
--- a/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java
+++ b/src/main/java/ftbsc/lll/proxies/impl/TypeProxy.java
@@ -29,7 +29,7 @@ public class TypeProxy extends QualifiableProxy {
* @param primitive whether the proxy is a primitive
*/
protected TypeProxy(String name, String descriptor, int modifiers, String parent, boolean primitive) {
- super(descriptor, modifiers, PackageProxy.from(parent), String.format("%s.%s", name, parent), ProxyType.TYPE);
+ super(descriptor, modifiers, PackageProxy.from(parent), String.format("%s.%s", parent, name), ProxyType.TYPE);
this.primitive = primitive;
}