Fwd: [JBS] {New} (JDK-8222721) [lworld] Javac generates 'Q' arrays for V.box[] and V?[]

Tobias Hartmann tobias.hartmann at oracle.com
Thu Apr 18 11:18:11 UTC 2019


Hi Srikanth,

you are right. I'll move the bug to core-libs.

Thanks,
Tobias

On 18.04.19 13:06, Srikanth wrote:
> Hi Tobias,
> 
> This does not look like a javac defect to me: Here is the local variable table from javap output:
> 
>  LocalVariableTable:
>         Start  Length  Slot  Name   Signature
>             0      77     0  args   [Ljava/lang/String;
>             6      71     1  vbox   [LTest$V;
>            12      65     2    vq   [LTest$V;
> 
> I think the reflection elements are at fault.
> 
> Srikanth
> 
> 
> 
> 
> -------- Forwarded Message --------
> Subject: 	[JBS] {New} (JDK-8222721) [lworld] Javac generates 'Q' arrays for V.box[] and V?[]
> Date: 	Thu, 18 Apr 2019 07:16:02 +0000 (UTC)
> From: 	Tobias Hartmann (JBS) <do-not-reply at openjdk.java.net>
> To: 	srikanth.adayapalam at oracle.com
> 
> 
> 
> Message Title
> 	Tobias Hartmann <https://bugs.openjdk.java.net/secure/ViewProfile.jspa?name=thartmann> *created* an
> issue
> 
>  
> JDK <https://bugs.openjdk.java.net/browse/JDK> / Bug
> <https://bugs.openjdk.java.net/browse/JDK-8222721> JDK-8222721
> <https://bugs.openjdk.java.net/browse/JDK-8222721>
> [lworld] Javac generates 'Q' arrays for V.box[] and V?[]
> <https://bugs.openjdk.java.net/browse/JDK-8222721>
> 
> Issue Type: 	Bug Bug
> Affects Versions: 	repo-valhalla
> Assignee: 	Srikanth Adayapalam <https://bugs.openjdk.java.net/secure/ViewProfile.jspa?name=sadayapalam>
> Components: 	hotspot
> Subcomponent: 	compiler
> Created: 	2019-04-18 00:15
> Priority: 	P2 P2
> Reporter: 	Tobias Hartmann <https://bugs.openjdk.java.net/secure/ViewProfile.jspa?name=thartmann>
> 
> public class Test {
> 
>    value class V {
>        int f;
>        V(int ff) {
>          f = ff;
>        }
>    }
> 
>    public static void main(String[] args) {
>        V.box[] vbox = new V.box[16];
>        V?[] vq = new V?[16];
>        System.out.println("V.box="+vbox.getClass().getName()+";
> "+vbox.getClass().getComponentType().getName());
>        System.out.println("V?="+vq.getClass().getName()+";
> "+vq.getClass().getComponentType().getName());
>        vbox[0] = null;
>        vq[0] = null;
>    }
> }
> 
> Output:
> 
> V.box=[QTest$V;; Test$V
> V?=[QTest$V;; Test$V
> Exception in thread "main" java.lang.NullPointerException
> at Test.main(Test.java:15)
> 
> Add Comment <https://bugs.openjdk.java.net/browse/JDK-8222721#add-comment> 	Add Comment
> <https://bugs.openjdk.java.net/browse/JDK-8222721#add-comment>
> 
>  
> 
> This message was sent by Atlassian Jira (v7.13.0#713000-sha1:fbf4068) 	
> Atlassian logo
> 



More information about the valhalla-dev mailing list