Hi all, I want to see the values of the created string objects in the system. To do so, I override the String.class by using Xbootclasspath option. In my new overriding class I modified constructors of String.class by adding the line System.out.println(value) to each, such that
public String() {
this.offset = 0;
this.count = 0;
this.value = new char[0];
System.out.println(value);
}
But I got the error,
Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
at java.lang.Runtime.loadLibrary0(Runtime.java:819)
at java.lang.System.loadLibrary(System.java:1030)
at java.lang.System.initializeSystemClass(System.java:1077)
Caused by: java.lang.NullPointerException
at java.lang.String.<init>(String.java:219)
at java.lang.StringBuilder.toString(StringBuilder.java:430)
at java.io.File.<clinit>(File.java:167)
at java.lang.Runtime.loadLibrary0(Runtime.java:819)
at java.lang.System.loadLibrary(System.java:1030)
at java.lang.System.initializeSystemClass(System.java:1077)
If anyone can point me on how to see the created string objects, I would be really glad.