[lworld] RFR: 8245584: [lworld] LW3 core reflection update

Mandy Chung mchung at openjdk.java.net
Fri May 22 20:10:29 UTC 2020


On Fri, 22 May 2020 16:46:24 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/org/objectweb/asm/Type.java line 674:
>> 
>>> 673:             } else {
>>> 674:                 stringBuilder.append('L');
>>> 675:             }
>> 
>> This could be:
>> `stringBuilder.append(IsInlineClass(currentClass) ? 'Q' : 'L');`
>> 
>> There may be a usefor a utility function that  returns Q or L as appropriate, it appears a few time.
>
> `Class::descriptorString` should be used for the cases when it has a `Class` object.
> 
> `ProxyGenerator` and `AccessorGenerator` should be updated to use `Class::descriptorString` and `TypeDescriptor` API
> where it's appropriate.  I suggest to update these classes in jdk/jdk.  I will file a JBS issue to track this.

updated per your suggestion.

diff --git a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Type.java
b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Type.java index 680e764fb4c..b03c201e23e 100644
--- a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Type.java
+++ b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Type.java
@@ -667,12 +667,8 @@ public final class Type {
             }
             stringBuilder.append(descriptor);
         } else {
+            stringBuilder.append(isInlineClass(currentClass) ? 'Q' : 'L');
             String name = currentClass.getName();
-            if (isInlineClass(currentClass)) {
-                stringBuilder.append('Q');
-            } else {
-                stringBuilder.append('L');
-            }
             int nameLength = name.length();
             for (int i = 0; i < nameLength; ++i) {
                 char car = name.charAt(i);

-------------

PR: https://git.openjdk.java.net/valhalla/pull/53


More information about the valhalla-dev mailing list