From alex.buckley at oracle.com Fri Jun 10 16:49:34 2022 From: alex.buckley at oracle.com (Alex Buckley) Date: Fri, 10 Jun 2022 09:49:34 -0700 Subject: Omission of Record superclass In-Reply-To: References: Message-ID: Yes, 8.1.4 should mention Record. Filed https://bugs.openjdk.org/browse/JDK-8288228 On 1/2/2022 3:33 AM, Wolters, R.A. (Alexander) wrote: > To whom it may concern, > > In section 8.1.4 of the Java Language Standard, it is defined that "For an enum class E, the direct superclass type is Enum.", and this is referred back to in section 8.9. > However, section 8.10 also makes a similar reference, even though there is no mention of Record in the first itemized list of section 8.1.4, and that section would imply that the superclass of a record is Object, based on the second clause. > I suppose that this was an oversight when Records were added to the JLS, and consequently a new point should be inserted between the third and fourth point of the first list in section 8.1.4, worded something like "For a record class R, the direct superclass type is Record". > > Yours > > Alexander Wolters > Radboud University Nijmegen From alex.buckley at oracle.com Fri Jun 10 16:52:33 2022 From: alex.buckley at oracle.com (Alex Buckley) Date: Fri, 10 Jun 2022 09:52:33 -0700 Subject: JLS 17: expression statement or statement expression? In-Reply-To: <7d0a132c-68f6-3f94-ee36-12994b28c9fb@gmail.com> References: <7d0a132c-68f6-3f94-ee36-12994b28c9fb@gmail.com> Message-ID: Unfortunately, but unavoidably, the terminology is confusing. Best not to treat them as synonyms since a statement expression, being an expression, is evaluated, while its "enclosing" expression statement, being a statement, is executed. On 3/10/2022 10:45 AM, Khalid Azim Mughal wrote: > Hi. > > Both expression statement and statement expression refer to section 14.8. > Are these two terms synonyms? > Bit confused. > Any clarification is much appreciated. > Thank you. From alex.buckley at oracle.com Fri Jun 10 17:02:24 2022 From: alex.buckley at oracle.com (Alex Buckley) Date: Fri, 10 Jun 2022 10:02:24 -0700 Subject: Seemingly incorrect definite assignment rules regarding try-catch and try-catch-finally In-Reply-To: References: Message-ID: <5c1c4fba-fb64-cfaf-1e72-ca70fbe8612a@oracle.com> Filed https://bugs.openjdk.org/browse/JDK-8288230 On 5/4/2022 4:54 PM, Robbe Pincket wrote: > Hello all > > It seems that with moving around some sentences, some errors slipt in. > * In issue 3b, I mention ?issue 2 also applies ??. This is supposed to mention issue 3 > * The example for issue 3 is not correct, and doesn?t show the issue, here is a correct version: > > ```java > public void testIssue3(int x) { > int var7; > > while (true) { > try { > if(x > 0) { > break; > } > } finally { > var7 = 100; > } > } > > // according to the spec, var7 is not considered to be > // definite assigned, even though `var7 = 100` would > // have been executed > // javac does not give an error > System.out.println(var7); > } > ``` > > Greetings > Robbe > > From: Robbe Pincket > Sent: woensdag 4 mei 2022 19:46 > To: jls-jvms-spec-comments at openjdk.java.net > Subject: Seemingly incorrect definite assignment rules regarding try-catch and try-catch-finally > > Hello experts > > I was reading the specifications today regarding definite (un)assignment rules (Chapter 16), to confirm a mental image I had of the control flow logic while trying to fix bug in the java decompiler I help maintaining. However when checking the spec it seemed like my assumption were not correct. After checking whether the code I though should be valid, but should according to my interpretation of the spec, and seeing that in fact it does compile, I started reading the whole definite assignment specification a few times. > > It has happened before that I thought there was an error in the spec, but after rereading it again, or checking for other relevant specifications regarding the topic, I usually notice that I had misread, or just missed part of the specification. Sadly when doing this for the issue at hand, I seemed to only notice more issues with the relevant specs. > > So the issues I noticed: > 1. > Both the "unassigned before a catch" and the "unassigned before a finally" rule (16.2.15.) mention the following: >> V is definitely unassigned before every return statement that belongs to the try block. > However V could get assigned inside the expression of the return if there is such an expression > I think the following line should be added: >> V is definitely unassigned after e in every statement of the form return e that belongs to the try block. > The original line could get update to mention only returns without an expression, but this is not needed to be correct (I think) > > 2. > Both the "unassigned before a catch" and the "unassigned before a finally" rule (16.2.15.) seem to not take yield statements into consideration. > I think the following line should be added: >> V is definitely unassigned after e in every statement of the form yield e that belongs to the try block. > > 3. (the original issue) > All of the following: > * 16.2.5. Labeled Statements > * 16.2.9. switch Statements > * 16.2.10. while Statements > * 16.2.11. do Statements > * 16.2.12. for Statements > All mention something along the lines of >> V is [un]assigned before every break statement for which the ... statement is the break target. > However, this does not seem to take into account that a "break" (as 14.15. mentions) only "attempts to transfer control", because if the break "jumps" out of a try with a finally, that finally block gets run first. This finally block can assign values to variables, changing which variables should be considered definite assigned and which ones are definite unassigned. > It seems that javac understands this, even though this seems to be contradicting the specs. > > 3b. > issue 2 also applies to try Statements (16.2.15.) with a nested try finally with regards to definite unassignment, but with all statements that could break out of the try block/catch block (return, throw, assert, break, yield and continue) > > I have an example for each of these below. > If I made any errors in interpreting the specifications I?d be happy to hear it. > > Greetings > Robbe > > ```java > class Examples { > public int testIssue1(int x) { > final int var7; > > try { > return var7 = 8; > } finally { > // according to the spec, var7 is considered to be > // definite unassigned, even though `var7 = 8` could > // (and would) have been executed > // javac does give an error > var7 = 100; > } > } > > public void testIssue2(int x) { > final int var7; > > int y = switch(x) { > case 1 -> var7 = 0; > default -> { > try { > yield var7 = 8; > } finally { > // according to the spec, var7 is considered to be > // definite unassigned, even though `var7 = 8` could > // (and would) have been executed > // javac does give an error > var7 = 100; > } > } > }; > } > > public int testIssue3(int x) { > final int var7; > > while (true) { > try { > return var7 = 8; > } finally { > // according to the spec, var7 is considered to be > // definite unassigned, even though `var7 = 8` could > // (and would) have been executed > // javac does give an error > var7 = 100; > } > } > } > > public void testIssue3b(int x) { > final int var7; > > l: try { > try { > break l; > } finally { > var7 = 8; > } > } finally { > // according to the spec, var7 is considered to be > // definite unassigned, even though `var7 = 8` could > // (and would) have been executed > // javac does give an error > var7 = 100; > } > } > } > ``` > > From dmitricerkas at yahoo.com Thu Jun 9 08:29:56 2022 From: dmitricerkas at yahoo.com (Dmitri Cerkas) Date: Thu, 9 Jun 2022 08:29:56 +0000 (UTC) Subject: Deprecated method used in the "Example 4.3.1-1. Object Creation" of paragraph "4.3.1 Objects". Small "Java Language Specification" improvement. In-Reply-To: <1898621789.383077.1653032199736@mail.yahoo.com> References: <1757766371.1718648.1639987092110.ref@mail.yahoo.com> <1757766371.1718648.1639987092110@mail.yahoo.com> <1532D1DA-D282-4E31-B145-607EDD6BFDFF@oracle.com> <171d76e7-8905-efba-a4e4-c6b2239f76f3@oracle.com> <863494868.150043.1640101910322@mail.yahoo.com> <697375730.2277685.1641898612560@mail.yahoo.com> <218760773.184040.1642692467668@mail.yahoo.com> <1898621789.383077.1653032199736@mail.yahoo.com> Message-ID: <207614927.792786.1654763396726@mail.yahoo.com> Hello JLS Team, in the "Example 4.3.1-1. Object Creation" of paragraph "4.3.1 Objects" (page 64 of "The Java Language Specification Java SE 18 Edition") you can see:? ".............try {?? ? p = (Point)Class.forName("Point").newInstance();?} catch (Exception e) {?? ? System.out.println(e);?}?............" but if you view the JavaDoc comment to "newInstance()" method of "java.lang.Class" you can read: "........... at deprecated..........The call{@code clazz.newInstance()} can be replaced by {@code clazz.getDeclaredConstructor().newInstance()}.........." So the?"Example 4.3.1-1. Object Creation" of paragraph "4.3.1 Objects"?(page 64 of "The Java Language Specification Java SE 18 Edition") should become:? ".............try {?? ? p = (Point)Class.forName("Point").getDeclaredConstructor().newInstance();?} catch (Exception e) {?? ? System.out.println(e);?}?............" Thank you,Dmitri. On Friday, May 20, 2022, 09:36:39 AM GMT+2, Dmitri Cerkas wrote: Hello JLS Team, in the introduction block of Chapter 4 "Types, Values, and Variables" (page 53 of "The Java Language Specification Java SE 18 Edition") you can read:? "The reference types (?4.3) are class types, interface types, and array types. " so it seems that there are ONLY three kinds of reference types in Java, but in the paragraph "4.3 Reference Types and Values" you can read: "There are FOUR kinds of reference types: class types (?8.1), interface types (?9.1), type variables (?4.4), and array types (?10.1)." So the phrase in the?introduction block of Chapter 4 "Types, Values, and Variables" (page 53 of "The Java Language Specification Java SE 18 Edition") should be:? "The reference types (?4.3) are class types, interface types,?type variables, and array types. " Thank you,Dmitri. On Thursday, January 20, 2022, 04:27:47 PM GMT+1, Dmitri Cerkas wrote: Hello JLS Team, at the begining of the "3.10.2"?paragraph of Java Language Specification (starting from the version 6 and up) you can read:"A floating-point literal has the following parts: a whole-number part, a decimal or hexadecimal point (represented by an ASCII period character), a fraction part, an exponent, and a type suffix" So this implies that decimal floating-point literal has the following parts:1)?a whole-number part,2)?a decimal point,3)?a fraction part,4)?an exponent,5)?and a type suffix. and below in the same?"3.10.2"?paragraph you can read:"For decimal floating-point literals, at least one digit (in either the whole number orthe fraction part) and either a decimal point, an exponent, or a float type suffix arerequired. All other parts are optional. The exponent, if present, is indicated by theASCII letter e or E followed by an optionally signed integer." So parts that are required for decimal floating-point literals are:a)?at least one digit (in either the whole number or the fraction part)?? ? (this corresponds to "1)?a whole-number part" and "3)?a fraction part" above) b)?and either a decimal point? ? (this corresponds to "2)?a decimal point" above)?c)?an exponent? ? (this corresponds to "4)?an exponent" above)?d)?a float type suffix? ??(this corresponds to "5)?and a type suffix" above)? So the phrase "All other parts are optional." is wrong because all parts are already listed. I thing that the phrase?"All other parts are optional."?should be removed and description of what is required for decimal floating-point literals becomes:"For decimal floating-point literals, at least one digit (in either the whole number or the fraction part) and either a decimal point, an exponent, or a float type suffix are required.?The exponent, if present, is indicated by the ASCII letter e or E followed by an optionally signed integer." Thank you,Dmitri. On Tuesday, January 11, 2022, 11:56:52 AM GMT+1, Dmitri Cerkas wrote: Hello JLS Team, if you look at "Table of Contents" of the "Java Language Specification" and, in particular, at the structure of Chapter 4 "Types, Values, and Variables", you can see the following substructure: "4.2 Primitive Types and Values 54 4.2.1 Integral Types and Values 55 4.2.2 Integer Operations 55 4.2.3 Floating-Point Types and Values 57 4.2.4 Floating-Point Operations 59 4.2.5 The boolean Type and boolean Values 61" , where:? 1) "4.2.1 Integral Types and Values" contains info about possible values of 5 integral types,2) "4.2.2 Integer Operations" tells about possible operations on integral values,3) "4.2.3?Floating-Point Types and Values" ?contains info about possible values of 2 floating-point types,? 4) "4.2.4 Floating-Point Operations" tells about possible operations on?floating-point values. If you look, however, at the content of "4.2.5 The boolean Type and boolean Values" you can note that this paragraph speak both:?1) about?possible values of boolean type and?2)?about possible operations on?boolean type. I know this might sound too picky, but logically, the paragraph "4.2.5" should be: "4.2.5 The boolean Type, boolean Values?and?boolean operations." Thank you,Dmitri. On Tuesday, December 21, 2021, 07:05:19 PM GMT+1, Alex Buckley wrote: From your mention of pull requests, I presume you're thinking about the OpenJDK source code hosted at https://github.com/openjdk/jdk/ You can make pull requests against that repo to improve the Java API specs -- "the javadoc" -- which might be what you mean by "Java documentation". Here's a recent example of someone doing that: ? https://github.com/openjdk/jdk/pull/6076 To learn more about contributing to OpenJDK, please see: ? https://openjdk.java.net/guide/ You may wish to mail the `discuss` list at OpenJDK to ask for help getting started with changes to the API specs: ? https://mail.openjdk.java.net/mailman/listinfo/discuss The Java Language Specification and the JVM Specification are not part of OpenJDK. They are not hosted on Github.com and Oracle does not support making pull requests against them. Please use the list mentioned in the "Feedback" section to report technical errors in the JLS. Alex On 12/21/2021 7:51 AM, Dmitri Cerkas wrote: > Alex, thank you very much for quick response! > > I see on "https://jcp.org/en/participation/membership > " page that there is the > opportunity to become a member of JCP program (the same I'm member of > "Jakarta EE" Community). > > May be this solution is best - I found various imperfections carefully > reading "The Java Language Specification" and opening direct Pull > Requests as JCP member is more practical I think. In addition (as a > member) I could improve Java documentation in general, as I did and do > for "Jakarta EE". > > Thank you again! > > Have a nice day, > Dmitri. > > > > > On Monday, December 20, 2021, 06:10:24 PM GMT+1, Alex Buckley > wrote: > > > Dmitri, > > Please see JLS section 1.6 "Feedback": > > https://docs.oracle.com/javase/specs/jls/se17/html/jls-1.html#jls-1.6 > > > Alex > > On 12/20/2021 5:42 AM, Bernard Traversat wrote: >? > FYI, >? > >? > Cheers, >? > >? > B. >? > >? > On 12/20/21, 2:58 AM, "Dmitri Cerkas" >? > >> wrote: >? > >? > Hello Community, >? > >? > I have some small suggestions on "Java Language Specification" content >? > improvements. How can I communicate them to you? Do you have a >? > repository (GitHub, for example) where I could post an Issue or a Pull >? > Request? >? > >? > Thank you very much! >? > >? > Have a nice day, >? > >? > Dmitri. >? > From alex.buckley at oracle.com Fri Jun 10 17:14:47 2022 From: alex.buckley at oracle.com (Alex Buckley) Date: Fri, 10 Jun 2022 10:14:47 -0700 Subject: Deprecated method used in the "Example 4.3.1-1. Object Creation" of paragraph "4.3.1 Objects". Small "Java Language Specification" improvement. In-Reply-To: <207614927.792786.1654763396726@mail.yahoo.com> References: <1757766371.1718648.1639987092110.ref@mail.yahoo.com> <1757766371.1718648.1639987092110@mail.yahoo.com> <1532D1DA-D282-4E31-B145-607EDD6BFDFF@oracle.com> <171d76e7-8905-efba-a4e4-c6b2239f76f3@oracle.com> <863494868.150043.1640101910322@mail.yahoo.com> <697375730.2277685.1641898612560@mail.yahoo.com> <218760773.184040.1642692467668@mail.yahoo.com> <1898621789.383077.1653032199736@mail.yahoo.com> <207614927.792786.1654763396726@mail.yahoo.com> Message-ID: <2b81d4ea-2710-7069-8bdb-e1cb02b44ab8@oracle.com> Yes, a known issue: https://bugs.openjdk.org/browse/JDK-8280602 On 6/9/2022 1:29 AM, Dmitri Cerkas wrote: > Hello JLS Team, > in the "Example 4.3.1-1. Object Creation" of paragraph "4.3.1 Objects" (page 64 of "The Java Language Specification Java SE 18 Edition") you can see: > ".............try {?? ? p = (Point)Class.forName("Point").newInstance();?} catch (Exception e) {?? ? System.out.println(e);?}?............" > > but if you view the JavaDoc comment to "newInstance()" method of "java.lang.Class" you can read: > "........... at deprecated..........The call{@code > clazz.newInstance()} > can be replaced by > > {@code > clazz.getDeclaredConstructor().newInstance()}.........." > So the?"Example 4.3.1-1. Object Creation" of paragraph "4.3.1 Objects"?(page 64 of "The Java Language Specification Java SE 18 Edition") should become: > ".............try {?? ? p = (Point)Class.forName("Point").getDeclaredConstructor().newInstance();?} catch (Exception e) {?? ? System.out.println(e);?}?............" > > Thank you,Dmitri. > > > > > > On Friday, May 20, 2022, 09:36:39 AM GMT+2, Dmitri Cerkas wrote: > > Hello JLS Team, > in the introduction block of Chapter 4 "Types, Values, and Variables" (page 53 of "The Java Language Specification Java SE 18 Edition") you can read: > "The reference types (?4.3) are class types, interface types, and array types. > " > so it seems that there are ONLY three kinds of reference types in Java, but in the paragraph "4.3 Reference Types and Values" you can read: > "There are FOUR kinds of reference types: class types (?8.1), interface types (?9.1), type variables (?4.4), and array types (?10.1)." > So the phrase in the?introduction block of Chapter 4 "Types, Values, and Variables" (page 53 of "The Java Language Specification Java SE 18 Edition") should be: > "The reference types (?4.3) are class types, interface types,?type variables, and array types. > " > Thank you,Dmitri. > > > On Thursday, January 20, 2022, 04:27:47 PM GMT+1, Dmitri Cerkas wrote: > > Hello JLS Team, > at the begining of the "3.10.2"?paragraph of Java Language Specification (starting from the version 6 and up) you can read:"A floating-point literal has the following parts: a whole-number part, a decimal or hexadecimal point (represented by an ASCII period character), a fraction part, an exponent, and a type suffix" > So this implies that decimal floating-point literal has the following parts:1)?a whole-number part,2)?a decimal point,3)?a fraction part,4)?an exponent,5)?and a type suffix. > and below in the same?"3.10.2"?paragraph you can read:"For decimal floating-point literals, at least one digit (in either the whole number orthe fraction part) and either a decimal point, an exponent, or a float type suffix arerequired. All other parts are optional. The exponent, if present, is indicated by theASCII letter e or E followed by an optionally signed integer." > So parts that are required for decimal floating-point literals are:a)?at least one digit (in either the whole number or the fraction part)?? ? (this corresponds to "1)?a whole-number part" and "3)?a fraction part" above) > b)?and either a decimal point? ? (this corresponds to "2)?a decimal point" above)?c)?an exponent? ? (this corresponds to "4)?an exponent" above)?d)?a float type suffix? ??(this corresponds to "5)?and a type suffix" above) > So the phrase "All other parts are optional." is wrong because all parts are already listed. > I thing that the phrase?"All other parts are optional."?should be removed and description of what is required for decimal floating-point literals becomes:"For decimal floating-point literals, at least one digit (in either the whole number or the fraction part) and either a decimal point, an exponent, or a float type suffix are required.?The exponent, if present, is indicated by the ASCII letter e or E followed by an optionally signed integer." > Thank you,Dmitri. > > On Tuesday, January 11, 2022, 11:56:52 AM GMT+1, Dmitri Cerkas wrote: > > Hello JLS Team, > if you look at "Table of Contents" of the "Java Language Specification" and, in particular, at the structure of Chapter 4 "Types, Values, and Variables", you can see the following substructure: > "4.2 Primitive Types and Values 54 4.2.1 Integral Types and Values 55 4.2.2 Integer Operations 55 4.2.3 Floating-Point Types and Values 57 4.2.4 Floating-Point Operations 59 4.2.5 The boolean Type and boolean Values 61" > , where: > 1) "4.2.1 Integral Types and Values" contains info about possible values of 5 integral types,2) "4.2.2 Integer Operations" tells about possible operations on integral values,3) "4.2.3?Floating-Point Types and Values" ?contains info about possible values of 2 floating-point types, > 4) "4.2.4 Floating-Point Operations" tells about possible operations on?floating-point values. > If you look, however, at the content of "4.2.5 The boolean Type and boolean Values" you can note that this paragraph speak both:?1) about?possible values of boolean type and?2)?about possible operations on?boolean type. > I know this might sound too picky, but logically, the paragraph "4.2.5" should be: "4.2.5 The boolean Type, boolean Values?and?boolean operations." > > Thank you,Dmitri. > > > On Tuesday, December 21, 2021, 07:05:19 PM GMT+1, Alex Buckley wrote: > > From your mention of pull requests, I presume you're thinking about the > OpenJDK source code hosted at https://github.com/openjdk/jdk/ > > You can make pull requests against that repo to improve the Java API > specs -- "the javadoc" -- which might be what you mean by "Java > documentation". Here's a recent example of someone doing that: > > ? https://github.com/openjdk/jdk/pull/6076 > > To learn more about contributing to OpenJDK, please see: > > ? https://openjdk.java.net/guide/ > > You may wish to mail the `discuss` list at OpenJDK to ask for help > getting started with changes to the API specs: > > ? https://mail.openjdk.java.net/mailman/listinfo/discuss > > The Java Language Specification and the JVM Specification are not part > of OpenJDK. They are not hosted on Github.com and Oracle does not > support making pull requests against them. Please use the list mentioned > in the "Feedback" section to report technical errors in the JLS. > > Alex > > On 12/21/2021 7:51 AM, Dmitri Cerkas wrote: >> Alex, thank you very much for quick response! >> >> I see on "https://jcp.org/en/participation/membership >> " page that there is the >> opportunity to become a member of JCP program (the same I'm member of >> "Jakarta EE" Community). >> >> May be this solution is best - I found various imperfections carefully >> reading "The Java Language Specification" and opening direct Pull >> Requests as JCP member is more practical I think. In addition (as a >> member) I could improve Java documentation in general, as I did and do >> for "Jakarta EE". >> >> Thank you again! >> >> Have a nice day, >> Dmitri. >> >> >> >> >> On Monday, December 20, 2021, 06:10:24 PM GMT+1, Alex Buckley >> wrote: >> >> >> Dmitri, >> >> Please see JLS section 1.6 "Feedback": >> >> https://docs.oracle.com/javase/specs/jls/se17/html/jls-1.html#jls-1.6 >> >> >> Alex >> >> On 12/20/2021 5:42 AM, Bernard Traversat wrote: >> ? > FYI, >> ? > >> ? > Cheers, >> ? > >> ? > B. >> ? > >> ? > On 12/20/21, 2:58 AM, "Dmitri Cerkas" > >> ? > >> wrote: >> ? > >> ? > Hello Community, >> ? > >> ? > I have some small suggestions on "Java Language Specification" content >> ? > improvements. How can I communicate them to you? Do you have a >> ? > repository (GitHub, for example) where I could post an Issue or a Pull >> ? > Request? >> ? > >> ? > Thank you very much! >> ? > >> ? > Have a nice day, >> ? > >> ? > Dmitri. >> ? > > From hiramhunt at verizon.net Wed Jun 15 13:48:11 2022 From: hiramhunt at verizon.net (Hiram Hunt) Date: Wed, 15 Jun 2022 13:48:11 -0000 Subject: Possible oversight in JLS8 Section 16.2.15 Message-ID: <650b64f7-4eab-e978-bc0b-97c6f875a3f4@verizon.net> Hello, The last bulleted item of JLS8 Section 16.2.15 says ? V is definitely unassigned before the finally block iff all of the following are true: This is followed by seven items marked by dashes. The first of the seven items takes care of normal completion of the try block and the seventh item takes care of normal completion of any catch blocks. The five items in between take care of some (all, I hope) cases of abrupt completion of the try block, but I don't see anything that takes care of abrupt completion of any catch blocks. Although javac (reasonably) rejects the following code, I cannot justify it from the definite assignment description in the JLS because the return is in a catch block, not the try block: class DefAssign { final int blank; public DefAssign() { try { throw new Exception("Exception"); } catch (Exception e) { blank = 1; return; } finally { blank = 2; // Expected, but // undocumented(?), javac error. } } } -- Hiram Hunt (hiramhunt at verizon.net) From hiramhunt at verizon.net Wed Jun 15 13:48:20 2022 From: hiramhunt at verizon.net (Hiram Hunt) Date: Wed, 15 Jun 2022 13:48:20 -0000 Subject: Another issue in JLS8 section 16.2.15 Message-ID: <379918e0-df79-4e60-007e-3b7896682f9d@verizon.net> Hello, I think I see another issue in JLS8 section 16.2.15. The phrase ? V is definitely unassigned after every assert statement that occurs in the try block. occurs in two locations in 16.2.15 as part of a determination of whether V is definitely unassigned before a later block. The first case is for before catch blocks and the second case is for before the finally block. The problem is that even if V is definitely unassigned after the assert, V could still be assigned if the assert completes abruptly and this execution path will lead to a catch block (maybe) and to any finally block. The assignment could occur in either expression of the two expression form of assert. I have not carefully tried every combination of one and two expression asserts and try, catch and finally blocks, but javac did prevent double assignment in the cases I checked. -- Hiram Hunt (hiramhunt at verizon.net) From ookami1 at gmx.de Wed Jun 15 13:48:21 2022 From: ookami1 at gmx.de (Wolf Lammen) Date: Wed, 15 Jun 2022 13:48:21 -0000 Subject: =?UTF-8?Q?Fixing_=C2=A74=2E4=2C_type_variables?= Message-ID: Hi, I think, ?4.4 needs a review. It contains a questionable definiton, and is sometimes imprecise in its wording. This comment pertains to the Java Language Specification 8 and 9. I try to use the wording of the standard as much as possible. Such words are quoted in apostrophes, and are usually accompanied by a text reference to a relevant JLS9 section in parenthesis on first use. I presume, the idea of a 'type variable' is that of a compile-time variable (as opposed to a symbol with fixed semantics) taking on types, and being updated on instantiations of generic entities. At least, this springs to my mind when I read these words in the specification. This is how it is defined in the first sentence of section ?4.4: "A type variable is an unqualified identifier used as a type in class, interface, method, and constructor bodies." This is awkward in several respects. 1. The following example shows a particular shortcoming of this definition: class X // 'type parameter section' (?8.1.2) { T2 x; } // 'class body' (?8.6.1) The second occurrence of T1 is syntactically a 'nonterminal symbol' (?2.1) 'TypeVariable' (?4.3). However, its 'Identifier' (?3.8) "T1" does not appear in the 'ClassBody' (?8.6.1), so according to the definition above, it is formally not a 'type variable' (?4.4). I cannot see a reason, why "T2" is a 'type variable.' but "T1" not. 2. The 'Identifier' (?3.8) production rule allows no punctuation characters, hence an 'identifier' (?3.8) is never qualified. 'Names' (?6.2) can be qualified. This definition's 'identifier' is missing from the enumeration of identifier usage in ?6.2. 3. Throughout the document, 'type variable' is used as if it not just an 'identifier'. It is likely meant to be the program entity introduced by the 'type parameter' 'declaration' (?6.2), as expressed in the second sentence of ?4.4. As an example for the confusion this causes, look at another sentence in ?4.4: "The scope of a type variable declared as a type parameter is specified in ?6.3." A 'type variable' has no scope, since it is just an 'identifier'. There is no 'type variable' without a matching declaration in a 'type parameter', this is mandatory. It is the scope of a 'type parameter' that is meant here and is explained in ?6.3. It seems the author felt the need to connect this scope to the notion of 'type variable' for better understanding. I suggest to put the second sentence of ?4.4 to the front, and continue along the lines "A type variable appears elsewhere as an unqualified identifier used as a type within a generic class, interface, method, or constructor.", or similar. Adjust ?6.2 to cover type variable identifiers. Regards Wolf Lammen From jessevsilverman at gmail.com Wed Jun 15 13:48:22 2022 From: jessevsilverman at gmail.com (Jesse Silverman) Date: Wed, 15 Jun 2022 13:48:22 -0000 Subject: Definition of 'character' in JLS Message-ID: I had a question about the definition of the term 'character' in the JLS, more specifically in section 3.10.4 (I was apparently either confused or looking at a JLS version where the definitions were in 3.10.6 at the time)... We had a long, rambling discussion of the meaning of numerous terms in Java here: https://coderanch.com/t/743492/java/Java-Terminology-Charset Where I thought I was reading contradictory definitions of terms relating to 'character'. In that thread I say: I was confused about Java String Literals because of this confusing issue seen in 3.10.6 of the JLS: UnicodeInputCharacter: UnicodeEscape RawInputCharacter UnicodeEscape: \ UnicodeMarker HexDigit HexDigit HexDigit HexDigit RawInputCharacter: any Unicode character So, a "RawInputCharacter" can apparently be *any* valid Unicode character, but I had already seen that UnicodeEscape must be between \u0000 and \uFFFF, requiring surrogate pair encoding by hand for anything outside the BMP. So String literals are sort of Unicode, but if you are using escape sequences to represent anything, you must know that it is encoded as UTF-16 internally. I kept hitting that. I bring up similar stuff unsuccessfully a few more times, then mentioned this: Specifically the following should all map neatly, but they lose me at the end of the chain, which was true in UCS-2 and as far as I can tell, unless I am confused, this isn't true since they started supporting UTF-16: A character literal can be specified as a ' SingleCharacter ' which is any 'InputCharacter' except ' or \ (so far so good) which is any 'UnicodeInputCharacter' except CR or LF (I'm still nervously with them) which is any UnicodeEscape or RawInputCharacter (getting a little shaky, as UnicodeEscape is limited to either BMP or at least BMP or a single code unit of a UTF-16 surrogate pair, I am not sure which but let's keep going)... lastly they say a RawInputCharacter is "any Unicode character" and I am out, I fold, because we have just proved that 1 == 2. You can not shove a non-BMP Unicode character into a Java character literal, as much as I'd like to. It won't fit. I am not sure if it is legal or not to stick half of a surrogate pair encoding into a character literal, I see times I think I'd need to, but I know I can't stick both of them in there, it is literally like assigning an int to a short... I almost regretted bringing it up at all, but I wound up learning a LOT from that thread, but are the terms consistent and I am missing something, or does the JLS instead rather state that a character literal can be 'any Unicode character' which is untrue, as only BMP characters can be directly represented in a Java character literal? I do know the following for sure: A character literal is always of type char No non-BMP Unicode characters can be represented by a single value of type char. So how could a character literal ever represent arbitrary non-BMP Unicode characters? If it can't, then what is the meaning of "Any Unicode Character" within the JLS? I use the term to mean the union of all BMP and all non-BMP Unicode characters. Yours in Confusion, Jesse V. Silverman -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitricerkas at yahoo.com Wed Jun 15 13:48:22 2022 From: dmitricerkas at yahoo.com (Dmitri Cerkas) Date: Wed, 15 Jun 2022 13:48:22 -0000 Subject: Small "Java Language Specification" improvement. In-Reply-To: References: <1757766371.1718648.1639987092110.ref@mail.yahoo.com> <1757766371.1718648.1639987092110@mail.yahoo.com> <1532D1DA-D282-4E31-B145-607EDD6BFDFF@oracle.com> <171d76e7-8905-efba-a4e4-c6b2239f76f3@oracle.com> <863494868.150043.1640101910322@mail.yahoo.com> Message-ID: <697375730.2277685.1641898612560@mail.yahoo.com> Hello JLS Team, if you look at "Table of Contents" of the "Java Language Specification" and, in particular, at the structure of Chapter 4 "Types, Values, and Variables", you can see the following substructure: "4.2 Primitive Types and Values 54 4.2.1 Integral Types and Values 55 4.2.2 Integer Operations 55 4.2.3 Floating-Point Types and Values 57 4.2.4 Floating-Point Operations 59 4.2.5 The boolean Type and boolean Values 61" , where:? 1) "4.2.1 Integral Types and Values" contains info about possible values of 5 integral types,2) "4.2.2 Integer Operations" tells about possible operations on integral values,3) "4.2.3?Floating-Point Types and Values" ?contains info about possible values of 2 floating-point types,? 4) "4.2.4 Floating-Point Operations" tells about possible operations on?floating-point values. If you look, however, at the content of "4.2.5 The boolean Type and boolean Values" you can note that this paragraph speak both:?1) about?possible values of boolean type and?2)?about possible operations on?boolean type. I know this might sound too picky, but logically, the paragraph "4.2.5" should be: "4.2.5 The boolean Type, boolean Values?and?boolean operations." Thank you,Dmitri. On Tuesday, December 21, 2021, 07:05:19 PM GMT+1, Alex Buckley wrote: From your mention of pull requests, I presume you're thinking about the OpenJDK source code hosted at https://github.com/openjdk/jdk/ You can make pull requests against that repo to improve the Java API specs -- "the javadoc" -- which might be what you mean by "Java documentation". Here's a recent example of someone doing that: ? https://github.com/openjdk/jdk/pull/6076 To learn more about contributing to OpenJDK, please see: ? https://openjdk.java.net/guide/ You may wish to mail the `discuss` list at OpenJDK to ask for help getting started with changes to the API specs: ? https://mail.openjdk.java.net/mailman/listinfo/discuss The Java Language Specification and the JVM Specification are not part of OpenJDK. They are not hosted on Github.com and Oracle does not support making pull requests against them. Please use the list mentioned in the "Feedback" section to report technical errors in the JLS. Alex On 12/21/2021 7:51 AM, Dmitri Cerkas wrote: > Alex, thank you very much for quick response! > > I see on "https://jcp.org/en/participation/membership > " page that there is the > opportunity to become a member of JCP program (the same I'm member of > "Jakarta EE" Community). > > May be this solution is best - I found various imperfections carefully > reading "The Java Language Specification" and opening direct Pull > Requests as JCP member is more practical I think. In addition (as a > member) I could improve Java documentation in general, as I did and do > for "Jakarta EE". > > Thank you again! > > Have a nice day, > Dmitri. > > > > > On Monday, December 20, 2021, 06:10:24 PM GMT+1, Alex Buckley > wrote: > > > Dmitri, > > Please see JLS section 1.6 "Feedback": > > https://docs.oracle.com/javase/specs/jls/se17/html/jls-1.html#jls-1.6 > > > Alex > > On 12/20/2021 5:42 AM, Bernard Traversat wrote: >? > FYI, >? > >? > Cheers, >? > >? > B. >? > >? > On 12/20/21, 2:58 AM, "Dmitri Cerkas" >? > >> wrote: >? > >? > Hello Community, >? > >? > I have some small suggestions on "Java Language Specification" content >? > improvements. How can I communicate them to you? Do you have a >? > repository (GitHub, for example) where I could post an Issue or a Pull >? > Request? >? > >? > Thank you very much! >? > >? > Have a nice day, >? > >? > Dmitri. >? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitricerkas at yahoo.com Wed Jun 15 13:48:22 2022 From: dmitricerkas at yahoo.com (Dmitri Cerkas) Date: Wed, 15 Jun 2022 13:48:22 -0000 Subject: Wrong phrase in "3.10.2". Small "Java Language Specification" improvement. In-Reply-To: <697375730.2277685.1641898612560@mail.yahoo.com> References: <1757766371.1718648.1639987092110.ref@mail.yahoo.com> <1757766371.1718648.1639987092110@mail.yahoo.com> <1532D1DA-D282-4E31-B145-607EDD6BFDFF@oracle.com> <171d76e7-8905-efba-a4e4-c6b2239f76f3@oracle.com> <863494868.150043.1640101910322@mail.yahoo.com> <697375730.2277685.1641898612560@mail.yahoo.com> Message-ID: <218760773.184040.1642692467668@mail.yahoo.com> Hello JLS Team, at the begining of the "3.10.2"?paragraph of Java Language Specification (starting from the version 6 and up) you can read:"A floating-point literal has the following parts: a whole-number part, a decimal or hexadecimal point (represented by an ASCII period character), a fraction part, an exponent, and a type suffix" So this implies that decimal floating-point literal has the following parts:1)?a whole-number part,2)?a decimal point,3)?a fraction part,4)?an exponent,5)?and a type suffix. and below in the same?"3.10.2"?paragraph you can read:"For decimal floating-point literals, at least one digit (in either the whole number orthe fraction part) and either a decimal point, an exponent, or a float type suffix arerequired. All other parts are optional. The exponent, if present, is indicated by theASCII letter e or E followed by an optionally signed integer." So parts that are required for decimal floating-point literals are:a)?at least one digit (in either the whole number or the fraction part)?? ? (this corresponds to "1)?a whole-number part" and "3)?a fraction part" above) b)?and either a decimal point? ? (this corresponds to "2)?a decimal point" above)?c)?an exponent? ? (this corresponds to "4)?an exponent" above)?d)?a float type suffix? ??(this corresponds to "5)?and a type suffix" above)? So the phrase "All other parts are optional." is wrong because all parts are already listed. I thing that the phrase?"All other parts are optional."?should be removed and description of what is required for decimal floating-point literals becomes:"For decimal floating-point literals, at least one digit (in either the whole number or the fraction part) and either a decimal point, an exponent, or a float type suffix are required.?The exponent, if present, is indicated by the ASCII letter e or E followed by an optionally signed integer." Thank you,Dmitri. On Tuesday, January 11, 2022, 11:56:52 AM GMT+1, Dmitri Cerkas wrote: Hello JLS Team, if you look at "Table of Contents" of the "Java Language Specification" and, in particular, at the structure of Chapter 4 "Types, Values, and Variables", you can see the following substructure: "4.2 Primitive Types and Values 54 4.2.1 Integral Types and Values 55 4.2.2 Integer Operations 55 4.2.3 Floating-Point Types and Values 57 4.2.4 Floating-Point Operations 59 4.2.5 The boolean Type and boolean Values 61" , where:? 1) "4.2.1 Integral Types and Values" contains info about possible values of 5 integral types,2) "4.2.2 Integer Operations" tells about possible operations on integral values,3) "4.2.3?Floating-Point Types and Values" ?contains info about possible values of 2 floating-point types,? 4) "4.2.4 Floating-Point Operations" tells about possible operations on?floating-point values. If you look, however, at the content of "4.2.5 The boolean Type and boolean Values" you can note that this paragraph speak both:?1) about?possible values of boolean type and?2)?about possible operations on?boolean type. I know this might sound too picky, but logically, the paragraph "4.2.5" should be: "4.2.5 The boolean Type, boolean Values?and?boolean operations." Thank you,Dmitri. On Tuesday, December 21, 2021, 07:05:19 PM GMT+1, Alex Buckley wrote: From your mention of pull requests, I presume you're thinking about the OpenJDK source code hosted at https://github.com/openjdk/jdk/ You can make pull requests against that repo to improve the Java API specs -- "the javadoc" -- which might be what you mean by "Java documentation". Here's a recent example of someone doing that: ? https://github.com/openjdk/jdk/pull/6076 To learn more about contributing to OpenJDK, please see: ? https://openjdk.java.net/guide/ You may wish to mail the `discuss` list at OpenJDK to ask for help getting started with changes to the API specs: ? https://mail.openjdk.java.net/mailman/listinfo/discuss The Java Language Specification and the JVM Specification are not part of OpenJDK. They are not hosted on Github.com and Oracle does not support making pull requests against them. Please use the list mentioned in the "Feedback" section to report technical errors in the JLS. Alex On 12/21/2021 7:51 AM, Dmitri Cerkas wrote: > Alex, thank you very much for quick response! > > I see on "https://jcp.org/en/participation/membership > " page that there is the > opportunity to become a member of JCP program (the same I'm member of > "Jakarta EE" Community). > > May be this solution is best - I found various imperfections carefully > reading "The Java Language Specification" and opening direct Pull > Requests as JCP member is more practical I think. In addition (as a > member) I could improve Java documentation in general, as I did and do > for "Jakarta EE". > > Thank you again! > > Have a nice day, > Dmitri. > > > > > On Monday, December 20, 2021, 06:10:24 PM GMT+1, Alex Buckley > wrote: > > > Dmitri, > > Please see JLS section 1.6 "Feedback": > > https://docs.oracle.com/javase/specs/jls/se17/html/jls-1.html#jls-1.6 > > > Alex > > On 12/20/2021 5:42 AM, Bernard Traversat wrote: >? > FYI, >? > >? > Cheers, >? > >? > B. >? > >? > On 12/20/21, 2:58 AM, "Dmitri Cerkas" >? > >> wrote: >? > >? > Hello Community, >? > >? > I have some small suggestions on "Java Language Specification" content >? > improvements. How can I communicate them to you? Do you have a >? > repository (GitHub, for example) where I could post an Issue or a Pull >? > Request? >? > >? > Thank you very much! >? > >? > Have a nice day, >? > >? > Dmitri. >? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitricerkas at yahoo.com Wed Jun 15 13:48:22 2022 From: dmitricerkas at yahoo.com (Dmitri Cerkas) Date: Wed, 15 Jun 2022 13:48:22 -0000 Subject: One of the reference types missing in the "Introduction" of Chapter 4. Small "Java Language Specification" improvement. In-Reply-To: <218760773.184040.1642692467668@mail.yahoo.com> References: <1757766371.1718648.1639987092110.ref@mail.yahoo.com> <1757766371.1718648.1639987092110@mail.yahoo.com> <1532D1DA-D282-4E31-B145-607EDD6BFDFF@oracle.com> <171d76e7-8905-efba-a4e4-c6b2239f76f3@oracle.com> <863494868.150043.1640101910322@mail.yahoo.com> <697375730.2277685.1641898612560@mail.yahoo.com> <218760773.184040.1642692467668@mail.yahoo.com> Message-ID: <1898621789.383077.1653032199736@mail.yahoo.com> Hello JLS Team, in the introduction block of Chapter 4 "Types, Values, and Variables" (page 53 of "The Java Language Specification Java SE 18 Edition") you can read:? "The reference types (?4.3) are class types, interface types, and array types. " so it seems that there are ONLY three kinds of reference types in Java, but in the paragraph "4.3 Reference Types and Values" you can read: "There are FOUR kinds of reference types: class types (?8.1), interface types (?9.1), type variables (?4.4), and array types (?10.1)." So the phrase in the?introduction block of Chapter 4 "Types, Values, and Variables" (page 53 of "The Java Language Specification Java SE 18 Edition") should be:? "The reference types (?4.3) are class types, interface types,?type variables, and array types. " Thank you,Dmitri. On Thursday, January 20, 2022, 04:27:47 PM GMT+1, Dmitri Cerkas wrote: Hello JLS Team, at the begining of the "3.10.2"?paragraph of Java Language Specification (starting from the version 6 and up) you can read:"A floating-point literal has the following parts: a whole-number part, a decimal or hexadecimal point (represented by an ASCII period character), a fraction part, an exponent, and a type suffix" So this implies that decimal floating-point literal has the following parts:1)?a whole-number part,2)?a decimal point,3)?a fraction part,4)?an exponent,5)?and a type suffix. and below in the same?"3.10.2"?paragraph you can read:"For decimal floating-point literals, at least one digit (in either the whole number orthe fraction part) and either a decimal point, an exponent, or a float type suffix arerequired. All other parts are optional. The exponent, if present, is indicated by theASCII letter e or E followed by an optionally signed integer." So parts that are required for decimal floating-point literals are:a)?at least one digit (in either the whole number or the fraction part)?? ? (this corresponds to "1)?a whole-number part" and "3)?a fraction part" above) b)?and either a decimal point? ? (this corresponds to "2)?a decimal point" above)?c)?an exponent? ? (this corresponds to "4)?an exponent" above)?d)?a float type suffix? ??(this corresponds to "5)?and a type suffix" above)? So the phrase "All other parts are optional." is wrong because all parts are already listed. I thing that the phrase?"All other parts are optional."?should be removed and description of what is required for decimal floating-point literals becomes:"For decimal floating-point literals, at least one digit (in either the whole number or the fraction part) and either a decimal point, an exponent, or a float type suffix are required.?The exponent, if present, is indicated by the ASCII letter e or E followed by an optionally signed integer." Thank you,Dmitri. On Tuesday, January 11, 2022, 11:56:52 AM GMT+1, Dmitri Cerkas wrote: Hello JLS Team, if you look at "Table of Contents" of the "Java Language Specification" and, in particular, at the structure of Chapter 4 "Types, Values, and Variables", you can see the following substructure: "4.2 Primitive Types and Values 54 4.2.1 Integral Types and Values 55 4.2.2 Integer Operations 55 4.2.3 Floating-Point Types and Values 57 4.2.4 Floating-Point Operations 59 4.2.5 The boolean Type and boolean Values 61" , where:? 1) "4.2.1 Integral Types and Values" contains info about possible values of 5 integral types,2) "4.2.2 Integer Operations" tells about possible operations on integral values,3) "4.2.3?Floating-Point Types and Values" ?contains info about possible values of 2 floating-point types,? 4) "4.2.4 Floating-Point Operations" tells about possible operations on?floating-point values. If you look, however, at the content of "4.2.5 The boolean Type and boolean Values" you can note that this paragraph speak both:?1) about?possible values of boolean type and?2)?about possible operations on?boolean type. I know this might sound too picky, but logically, the paragraph "4.2.5" should be: "4.2.5 The boolean Type, boolean Values?and?boolean operations." Thank you,Dmitri. On Tuesday, December 21, 2021, 07:05:19 PM GMT+1, Alex Buckley wrote: From your mention of pull requests, I presume you're thinking about the OpenJDK source code hosted at https://github.com/openjdk/jdk/ You can make pull requests against that repo to improve the Java API specs -- "the javadoc" -- which might be what you mean by "Java documentation". Here's a recent example of someone doing that: ? https://github.com/openjdk/jdk/pull/6076 To learn more about contributing to OpenJDK, please see: ? https://openjdk.java.net/guide/ You may wish to mail the `discuss` list at OpenJDK to ask for help getting started with changes to the API specs: ? https://mail.openjdk.java.net/mailman/listinfo/discuss The Java Language Specification and the JVM Specification are not part of OpenJDK. They are not hosted on Github.com and Oracle does not support making pull requests against them. Please use the list mentioned in the "Feedback" section to report technical errors in the JLS. Alex On 12/21/2021 7:51 AM, Dmitri Cerkas wrote: > Alex, thank you very much for quick response! > > I see on "https://jcp.org/en/participation/membership > " page that there is the > opportunity to become a member of JCP program (the same I'm member of > "Jakarta EE" Community). > > May be this solution is best - I found various imperfections carefully > reading "The Java Language Specification" and opening direct Pull > Requests as JCP member is more practical I think. In addition (as a > member) I could improve Java documentation in general, as I did and do > for "Jakarta EE". > > Thank you again! > > Have a nice day, > Dmitri. > > > > > On Monday, December 20, 2021, 06:10:24 PM GMT+1, Alex Buckley > wrote: > > > Dmitri, > > Please see JLS section 1.6 "Feedback": > > https://docs.oracle.com/javase/specs/jls/se17/html/jls-1.html#jls-1.6 > > > Alex > > On 12/20/2021 5:42 AM, Bernard Traversat wrote: >? > FYI, >? > >? > Cheers, >? > >? > B. >? > >? > On 12/20/21, 2:58 AM, "Dmitri Cerkas" >? > >> wrote: >? > >? > Hello Community, >? > >? > I have some small suggestions on "Java Language Specification" content >? > improvements. How can I communicate them to you? Do you have a >? > repository (GitHub, for example) where I could post an Issue or a Pull >? > Request? >? > >? > Thank you very much! >? > >? > Have a nice day, >? > >? > Dmitri. >? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitricerkas at yahoo.com Wed Jun 15 13:48:22 2022 From: dmitricerkas at yahoo.com (Dmitri Cerkas) Date: Wed, 15 Jun 2022 13:48:22 -0000 Subject: The names of example's classes. Small "Java Language Specification" improvement. In-Reply-To: <207614927.792786.1654763396726@mail.yahoo.com> References: <1757766371.1718648.1639987092110.ref@mail.yahoo.com> <1757766371.1718648.1639987092110@mail.yahoo.com> <1532D1DA-D282-4E31-B145-607EDD6BFDFF@oracle.com> <171d76e7-8905-efba-a4e4-c6b2239f76f3@oracle.com> <863494868.150043.1640101910322@mail.yahoo.com> <697375730.2277685.1641898612560@mail.yahoo.com> <218760773.184040.1642692467668@mail.yahoo.com> <1898621789.383077.1653032199736@mail.yahoo.com> <207614927.792786.1654763396726@mail.yahoo.com> Message-ID: <1759526712.1626849.1655104878814@mail.yahoo.com> Hello JLS Team, maybe I allow myself too much, but don't you think that name "Test" of classes in the examples of JLS is not quite appropriate for the context and for the content they (examples) have?? Name "Test" is more for "Functional Testing" ("UnitTesting", ecc), "Non-Functional Testing", ecc, with assertions and special libraries for test software... Maybe its more appropriate "Explanation" as the name of?classes in the examples of JLS? Thank you very much and sorry for disturbing!Have a nice day,Dmitri. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitricerkas at yahoo.com Mon Jun 20 14:12:05 2022 From: dmitricerkas at yahoo.com (Dmitri Cerkas) Date: Mon, 20 Jun 2022 14:12:05 -0000 Subject: The structure of Chapter 4 (names and the sequence numbers of paragraphs). Small "Java Language Specification" improvement. References: <1741598286.3392751.1655734316482.ref@mail.yahoo.com> Message-ID: <1741598286.3392751.1655734316482@mail.yahoo.com> Hello JLS Team, here I would want to do some?observations about "Chapter 4" generic structure (and especially to?names and the sequence numbers of paragraphs). If you look at "Table of Contents" you can see the following substructure in "Chapter 4": "4.3 Reference Types and Values 52 4.3.1 Objects 53 4.3.2 The Class Object 56 4.3.3 The Class String 56 4.3.4 When Reference Types Are the Same 574.4 Type Variables 57" In the paragraph "4.3. Reference?Types?and?Values." you:? ?1) lists all kinds of reference?types?(class,?interface,?type variable, and?array)? ?2) describe?classes?and?interfaces?reference?types In the subparagraph "4.3.1 Objects" you explain what is the reference?value.Then subparagraphs "4.3.2" and "4.3.3" explain two important elements of reference?types?- classes "Object" and "String". "4.4?Type Variables" is another one paragraph that tells about the one the?of?four reference?types. So,?taking into account said above,?my suggestions about the names are:1) because "4.3. Reference?Types?and?Values." is about reference?Types?and?Values, i think that "4.3.1" should be: "4.3.1??Objects and Reference?values"2) because?type variables?are the one of the four kinds of reference type,?"4.4?Type Variables" should be included in?"4.3."?as subparagraph, so it become:?"4.3.5? ??Type Variables". Finalizing...??In the "Table of Contents", "Chapter 4" should have the?following substructure:"4.3 Reference Types and Values 52 4.3.1 Objects?and Reference Values?53 4.3.2 The Class Object 56 4.3.3 The Class String 56 4.3.4 When Reference Types Are the Same 57? ? ? ??4.3.5?Type Variables 57" Thank you very much and sorry for disturbing!Have a nice day,Dmitri. -------------- next part -------------- An HTML attachment was scrubbed... URL: