< prev index next >

test/jdk/java/util/Formatter/NullArg.java

Print this page

        

@@ -25,11 +25,10 @@
  * @test
  * @bug 8039390
  * @summary Basic test for null argument
  */
 
-import java.util.Formatter;
 import java.util.Locale;
 
 public class NullArg {
 
     public static void main(String [] args) {

@@ -50,14 +49,20 @@
             if (c == 't' || c == 'T') {
                 for (char ct : tcs) {
                     if (!String.format("%" + c + ct, null).equals(expected)) {
                         throw new RuntimeException("%t" + ct + "null check failed.");
                     }
+                    if (!JavacIntrinsicsSupport.stringFormat("%" + c + ct, null).equals(expected)) {
+                        throw new RuntimeException("%t" + ct + "null check failed. " + JavacIntrinsicsSupport.stringFormat("%" + c + ct, null) + " // " + expected);
+                    }
                 }
             } else {
                 if (!String.format("%" + c , null).equals(expected)) {
                     throw new RuntimeException("%" + c + "null check failed.");
                 }
+                if (!JavacIntrinsicsSupport.stringFormat("%" + c , null).equals(expected)) {
+                    throw new RuntimeException("%" + c + "null check failed. " + JavacIntrinsicsSupport.stringFormat("%" + c , null) + " // " + expected);
+                }
             }
         }
     }
 }
< prev index next >