Exception when running a pseuco programm with locks in methods
Hallo, when I try to run the code in the how to reproduce the bug section I get the following exception. In pseuco.com everythings works fine. This seems to happen every time when there is a lock statement in a method. This first appears in a programm using a monitor to implemented different locking options for the training sheet, so I tried to test why this happens and this is a small situation to reproduce the behavior.
Error message: java.lang.ClassNotFoundException: include.Main
How to reproduce the bug
int n;
lock guard_n;
void counter(){
for(int i = 0; i < 5; i++){
mylocker();
n++;
println(n);
myunlocker();
}
}
void myunlocker(){
unlock(guard_n);
}
void mylocker(){
lock(guard_n);
}
mainAgent {
agent a1 = start(counter());
agent a2 = start(counter());
join(a1);
join(a2);
}
Build information
Latest jar 2547
Environment
-
Operating system: Windows 10
-
Java version: 10
Stack trace
java.lang.ClassNotFoundException: include.Main
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:374)
at pseuco.javaCompiler.runner.PseuCoRunner.executeGeneratedJavaCode(PseuCoRunner.kt:54)
at pseuco.javaCompiler.PseuCoCompilerTask.run(PseuCoCompilerTask.kt:241)
at fxGui.main.MainPane$runPseuCoTask$4.invoke(MainPane.kt:746)
at fxGui.main.MainPane$runPseuCoTask$4.invoke(MainPane.kt:66)
at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)