From javran.c at gmail.com Wed Mar 17 09:20:23 2021 From: javran.c at gmail.com (Javran Cheng) Date: Wed, 17 Mar 2021 09:20:23 -0000 Subject: A question regarding handling consecutive '>' characters in "3.2. Lexical Translations" Message-ID: Hello Java SE Spec authors, I'm recently reading Java SE 16 spec (this is also present in many other recent versions) and there is one part in "3.2. Lexical Translations" that I would want some clarification: > ... There is one exception: if lexical translation occurs in a type context (?4.11) and the input stream has two or more consecutive > characters ... Here I want to know how can I tell whether it is in a type context when the lexical analysis is not done - does this sentence just want to make sure readers are aware of this ambiguity when it comes to consecutive > characters (so how exactly this is done is up to implementor) or is there somewhere explained in the spec regarding how to tell a type context during lexical analysis? Thanks! Javran (Fang) Cheng From x4e_x4e at protonmail.com Fri Mar 12 12:33:23 2021 From: x4e_x4e at protonmail.com (x4e_x4e) Date: Fri, 12 Mar 2021 12:33:23 -0000 Subject: JVMS conflicting rules on interface methods Message-ID: Hello, JVMS 4.2.2 states: > Note that a field name or interface method name may be `` or ``, but no method invocation instruction may reference `` and only the invokespecial instruction (?invokespecial) may reference ``. (Interface's may have an method). This seems in contradiction with 2.9.1 which states: > In a class, any non-`void` method named `` is not an instance initialization method. In an interface, any method named `` is not an instance initialization method. Such methods cannot be invoked by any Java Virtual Machine instruction (?4.4.2, ?4.9.2) and are rejected by format checking (?4.6, ?4.8). ( methods in interfaces are rejected by format checking). I think it should be clarified whether an method is allowed in an interface classfile. Since Java 9 the verifier rejects an method in an interface, so it seems like 2.9.1 is the intended behaviour. Related links: https://bugs.openjdk.java.net/browse/JDK-8122940 https://bugs.openjdk.java.net/browse/JDK-8135265 Thanks, x4e