< prev index next >

test/jdk/java/lang/constant/boottest/java.base/java/lang/constant/ConstantUtilsTest.java

Print this page
rev 52749 : Bootstrap method consolidation
* clean up and simplify JDK support code for BSM invocation
* simplify JVM bootstrap handshake: use BootstrapCallInfo only
* remove unused JVM paths and data fields
* move bootstrap argument processing from MethodHandleNatives to ConstantPool
* remove ConstantGroup; merge argument access into BootstrapCallInfo
* adjust BSM argument access: remove copyArguments, add argumentRef API
* add metadata-free BSM modes, including symbolic arguments from CP


  51             // good
  52         }
  53 
  54         try {
  55             ConstantUtils.validateMemberName("");
  56             fail("");
  57         } catch (IllegalArgumentException e) {
  58             // good
  59         }
  60 
  61         List<String> badNames = List.of(".", ";", "[", "/", "<", ">");
  62         for (String n : badNames) {
  63             try {
  64                 ConstantUtils.validateMemberName(n);
  65                 fail(n);
  66             } catch (IllegalArgumentException e) {
  67                 // good
  68             }
  69         }
  70     }
  71 
  72     public void testSymbolizeHelper() {
  73         DirectMethodHandleDesc mh = MethodHandleDesc.of(DirectMethodHandleDesc.Kind.VIRTUAL, ConstantDescs.CR_String, "isEmpty", "()Z");
  74         try {
  75             ConstantUtils.symbolizeHelper(mh, null, "");
  76             fail("");
  77         } catch (NullPointerException e) {
  78             // good
  79         }
  80 
  81         try {
  82             ConstantUtils.symbolizeHelper(null, ConstantDescs.CR_ClassDesc, "");
  83             fail("");
  84         } catch (NullPointerException e) {
  85             // good
  86         }
  87 
  88         try {
  89             ConstantUtils.symbolizeHelper(null, null, "");
  90             fail("");
  91         } catch (NullPointerException e) {
  92             // good
  93         }
  94     }
  95 }


  51             // good
  52         }
  53 
  54         try {
  55             ConstantUtils.validateMemberName("");
  56             fail("");
  57         } catch (IllegalArgumentException e) {
  58             // good
  59         }
  60 
  61         List<String> badNames = List.of(".", ";", "[", "/", "<", ">");
  62         for (String n : badNames) {
  63             try {
  64                 ConstantUtils.validateMemberName(n);
  65                 fail(n);
  66             } catch (IllegalArgumentException e) {
  67                 // good
  68             }
  69         }
  70     }
























  71 }
< prev index next >