< prev index next >
test/runtime/SharedArchiveFile/SharedStringsWb.java
Print this page
*** 36,45 ****
--- 36,50 ----
// The string below is known to be added to CDS archive
String s = "<init>";
String internedS = s.intern();
+ // Check that it's a valid string
+ if (s.getClass() != String.class || !(s instanceof String)) {
+ throw new RuntimeException("Shared string is not a valid String: FAIL");
+ }
+
if (wb.isShared(internedS)) {
System.out.println("Found shared string, result: PASS");
} else {
throw new RuntimeException("String is not shared, result: FAIL");
}
< prev index next >