Skip to content

Commit 6db4dc2

Browse files
committed
Fixed class loading for compiled Java plugins. -Bibl
1 parent ff7bd34 commit 6db4dc2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/the/bytecode/club/bytecodeviewer/plugin/strategies/CompiledJavaPluginLaunchStrategy.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ public LoadingClassLoader(LoadedNodeData data, Set<LoadedNodeData> set) throws T
136136
ccache = new HashMap<String, Class<?>>();
137137

138138
for(LoadedNodeData d: set) {
139-
if(d != data) {
140-
cache.put(d.node.name, d);
141-
}
139+
cache.put(d.node.name, d);
142140
}
143141

144142
@SuppressWarnings("unchecked")
@@ -152,15 +150,17 @@ public LoadingClassLoader(LoadedNodeData data, Set<LoadedNodeData> set) throws T
152150

153151
@Override
154152
public Class<?> findClass(String name) throws ClassNotFoundException {
155-
name = name.replace("/", ".");
153+
name = name.replace(".", "/");
154+
155+
System.out.println("finding " + name);
156156

157157
if(ccache.containsKey(name))
158158
return ccache.get(name);
159159

160160
LoadedNodeData data = cache.get(name);
161161
if(data != null) {
162162
byte[] bytes = data.bytes;
163-
Class<?> klass = defineClass(data.node.name, bytes, 0, bytes.length);
163+
Class<?> klass = defineClass(data.node.name.replace("/", "."), bytes, 0, bytes.length);
164164
ccache.put(name, klass);
165165
return klass;
166166
}

0 commit comments

Comments
 (0)