Missing warning when using an instance main method

Jim Laskey james.laskey at oracle.com
Mon Sep 18 09:28:25 UTC 2023


The issue is that the preview runtime check relies on the use of preview classes. There are no preview classes involved here. 

File a bug for JDK 22. We can special case this situation. 

Cheers,

— Jim

📱

> On Sep 18, 2023, at 4:37 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> 
> Hello,
> I believe this code should emit a warning when compiled given it uses an instance main method
> 
> class MissingWarnings {
>  void main() {
>  }
> }
> 
> But the command
>  javac --enable-preview --source 21 MissingWarnings.java
> does not print a warning.
> 
> regards,
> Rémi


More information about the amber-dev mailing list