changeset 52922:3486dd38dbda amber-demo

Automatic merge with datum
author mcimadamore
date Fri, 26 Oct 2018 19:05:30 +0200
parents 30e15200fb90 716341307709
children b49697bf259d
files
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/Class.java	Fri Oct 26 18:45:29 2018 +0200
+++ b/src/java.base/share/classes/java/lang/Class.java	Fri Oct 26 19:05:30 2018 +0200
@@ -3546,6 +3546,7 @@
 
     /**
      * Returns an array with the names of the components
+     *
      * @return an array with the names of the components
      * @since 1.12
      */
@@ -3564,6 +3565,27 @@
         }
     }
 
+    /**
+     * Returns an array with the types of the record parameters
+     *
+     * @return an array with the types of the record parameters
+     * @since 1.12
+     */
+    public Class<?>[] getRecordParameterTypes() {
+        if (isRecord()) {
+            Field[] recordParameters = getRecordParameters();
+            Class<?>[] types = new Class<?>[recordParameters.length];
+            int i = 0;
+            for (Field field : recordParameters) {
+                types[i] = field.getType();
+                i++;
+            }
+            return types;
+        } else {
+            return new Class<?>[0];
+        }
+    }
+
     // Fetches the factory for reflective objects
     private static ReflectionFactory getReflectionFactory() {
         if (reflectionFactory == null) {