JDK 12 RFR of JDK-8213299: runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java failed with java.lang.NoSuchMethodException

Joe Darcy joe.darcy at oracle.com
Fri Jan 11 06:13:43 UTC 2019


Hello,

Please review the changes to fix:

     JDK-8213299: 
runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java 
failed with java.lang.NoSuchMethodException
     http://cr.openjdk.java.net/~darcy/8213299.0/

For background, in the changes made for

     JDK-6304578: (reflect) toGenericString fails to print bounds of 
type variables on generic methods

the revised logic in methodToString which is used to build messages for 
exceptions mistakenly omits adding information about method parameters. 
The HotSpot test EmptyClassInBootClassPath.java examines information 
about the exception messages and fails due to this omission.

Thanks to Sergei Tsypanov for noticing the root cause of this issue.

Patch below.

Thanks,

-Joe

--- old/src/java.base/share/classes/java/lang/Class.java 2019-01-10 
21:28:40.586005000 -0800
+++ new/src/java.base/share/classes/java/lang/Class.java 2019-01-10 
21:28:40.338005000 -0800
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights 
reserved.
+ * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights 
reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
@@ -3420,8 +3420,8 @@
          StringBuilder sb = new StringBuilder();
          sb.append(getName() + "." + name + "(");
          if (argTypes != null) {
-            Stream.of(argTypes).map(c -> {return (c == null) ? "null" : 
c.getName();}).
-                collect(Collectors.joining(","));
+            sb.append(Stream.of(argTypes).map(c -> {return (c == null) 
? "null" : c.getName();}).
+              collect(Collectors.joining(",")));
          }
          sb.append(")");
          return sb.toString();
--- old/test/hotspot/jtreg/ProblemList.txt    2019-01-10 
21:28:41.210005000 -0800
+++ new/test/hotspot/jtreg/ProblemList.txt    2019-01-10 
21:28:40.954005000 -0800
@@ -85,7 +85,6 @@

  runtime/appcds/javaldr/GCSharedStringsDuringDump.java 8208778 macosx-x64
  runtime/appcds/javaldr/GCDuringDump.java 8208778 macosx-x64
-runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java 
8213299 generic-all
  runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all
  runtime/handshake/HandshakeWalkSuspendExitTest.java 8214174 generic-all
  runtime/RedefineTests/RedefineRunningMethods.java 8208778 macosx-x64



More information about the core-libs-dev mailing list