Fix #333
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 5m57s

This commit is contained in:
Daniel Holle 2024-05-17 10:49:45 +02:00
parent 2ded0c9044
commit 974582f7e5
3 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,11 @@
import java.lang.String;
public class Bug333 {
public static String Bar = "Bar";
}
class Bar {
public bar() {
String s = Bug333.Bar;
}
}

View File

@ -804,6 +804,7 @@ public class StatementGenerator {
// Check for Classname:
if (reg.contains(whole)) {
receiver = generateStaticClassName(whole, offset);
break;
}
whole += ".";
}

View File

@ -1108,4 +1108,11 @@ public class TestComplete {
var clazz = classFiles.get("Bug328");
var instance = clazz.getDeclaredConstructor().newInstance();
}
@Test
public void testBug333() throws Exception {
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug333.jav");
var clazz = classFiles.get("Bug333");
var instance = clazz.getDeclaredConstructor().newInstance();
}
}