From gavin.bierman at oracle.com Thu Oct 10 13:09:09 2024 From: gavin.bierman at oracle.com (Gavin Bierman) Date: Thu, 10 Oct 2024 13:09:09 +0000 Subject: [module-imports] Improved Shadowing Behavior Message-ID: Dear experts, We are used to single type imports shadowing a type imported from a package import, i.e. import java.awt.*; import java.util.List; // Shadows the List from java.awt package The design intent is that the more specific import can shadow the less specific import. With module imports there is a new case that I think we should support, where a package import can shadow a module import, e.g. import module java.desktop; import java.util.*; // List is resolved to java.util.List This seems in spirit with the original design intent - the more specific import can shadow the less specific import - we probably should have had this in the first preview. This also helps users who have used package imports up to this point be robust against a future where a module import is added to their code. I have updated the draft JEP to reflect this change: https://openjdk.org/jeps/8335987 Please send any comments or suggestions to the list or to me directly. Many thanks, Gavin From forax at univ-mlv.fr Fri Oct 11 20:01:58 2024 From: forax at univ-mlv.fr (Remi Forax) Date: Fri, 11 Oct 2024 22:01:58 +0200 (CEST) Subject: [module-imports] Improved Shadowing Behavior In-Reply-To: References: Message-ID: <1239390863.34244553.1728676918380.JavaMail.zimbra@univ-eiffel.fr> ----- Original Message ----- > From: "Gavin Bierman" > To: "amber-spec-experts" > Sent: Thursday, October 10, 2024 3:09:09 PM > Subject: [module-imports] Improved Shadowing Behavior > Dear experts, > > We are used to single type imports shadowing a type imported from a package > import, i.e. > > import java.awt.*; > import java.util.List; // Shadows the List from java.awt package > > The design intent is that the more specific import can shadow the less specific > import. > > With module imports there is a new case that I think we should support, where a > package import can shadow a module import, e.g. > > import module java.desktop; > import java.util.*; > > // List is resolved to java.util.List > > This seems in spirit with the original design intent - the more specific import > can shadow the less specific import - we probably should have had this in the > first > preview. > > This also helps users who have used package imports up to this point be robust > against a future where a module import is added to their code. > > I have updated the draft JEP to reflect this change: > https://openjdk.org/jeps/8335987 > > Please send any comments or suggestions to the list or to me directly. > > Many thanks, > Gavin I agree, it should have been in the first preview :) R?mi From gavin.bierman at oracle.com Thu Oct 24 14:35:25 2024 From: gavin.bierman at oracle.com (Gavin Bierman) Date: Thu, 24 Oct 2024 14:35:25 +0000 Subject: New candidate JEP: 495: Simple Source Files and Instance Main Methods (Fourth Preview) In-Reply-To: <20241022153723.5B59777EFDC@eggemoggin.niobe.net> References: <20241022153723.5B59777EFDC@eggemoggin.niobe.net> Message-ID: <9F3736DC-8E65-4FE3-A446-877A9F7D2CAA@oracle.com> Dear experts: The first draft of a spec covering JEP 495: Simple Source Files and Instance Main Methods is available: https://cr.openjdk.org/~gbierman/jep495/latest/ Feel free to contact me directly or on this list with any comments. Thanks Gavin On 22 Oct 2024, at 16:37, Mark Reinhold wrote: https://openjdk.org/jeps/495 Summary: Evolve the Java programming language so that beginners can write their first programs without needing to understand language features designed for large programs. Far from using a separate dialect of the language, beginners can write streamlined declarations for single-class programs and then seamlessly expand their programs to use more advanced features as their skills grow. Experienced developers can likewise enjoy writing small programs succinctly, without the need for constructs intended for programming in the large. This is a preview language feature. - Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From gavin.bierman at oracle.com Thu Oct 24 14:37:15 2024 From: gavin.bierman at oracle.com (Gavin Bierman) Date: Thu, 24 Oct 2024 14:37:15 +0000 Subject: New candidate JEP: 494: Module Import Declarations (Second Preview) In-Reply-To: <20241022153719.21BC277EFDA@eggemoggin.niobe.net> References: <20241022153719.21BC277EFDA@eggemoggin.niobe.net> Message-ID: Dear experts: The first draft of a spec covering JEP 494: Module Import Declarations is available: https://cr.openjdk.org/~gbierman/jep494/latest/ Feel free to contact me directly or on this list with any comments. Thanks Gavin On 22 Oct 2024, at 16:37, Mark Reinhold wrote: https://openjdk.org/jeps/494 Summary: Enhance the Java programming language with the ability to succinctly import all of the packages exported by a module. This simplifies the reuse of modular libraries, but does not require the importing code to be in a module itself. This is a preview language feature. - Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From angelos.bimpoudis at oracle.com Fri Oct 25 14:51:00 2024 From: angelos.bimpoudis at oracle.com (Angelos Bimpoudis) Date: Fri, 25 Oct 2024 14:51:00 +0000 Subject: New candidate JEP: 488: Primitive Types in Patterns, instanceof, and switch (Second Preview) In-Reply-To: <20240930200335.1ECAC77CADA@eggemoggin.niobe.net> References: <20240930200335.1ECAC77CADA@eggemoggin.niobe.net> Message-ID: Dear experts: The first draft of the spec covering JEP 488: Primitive Types in Patterns, instanceof, and switch (Second Preview) is available: https://cr.openjdk.org/~abimpoudis/instanceof/jep488-20241014/specs/primitive-types-in-patterns-instanceof-switch-jls.html (also https://cr.openjdk.org/~abimpoudis/instanceof/latest/) Feel free to contact me directly or on this list with any comments. Thanks Angelos ________________________________ From: Mark Reinhold Sent: 30 September 2024 22:03 To: Angelos Bimpoudis Cc: amber-dev at openjdk.org ; jdk-dev at openjdk.org Subject: New candidate JEP: 488: Primitive Types in Patterns, instanceof, and switch (Second Preview) https://openjdk.org/jeps/488 Summary: Enhance pattern matching by allowing primitive types in all pattern contexts, and extend instanceof and switch to work with all primitive types. This is a preview language feature. - Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: