< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java

Print this page
*** 228,10 ***
--- 228,12 ---
          CASE_NULL(JDK17, Fragments.FeatureCaseNull, DiagKind.NORMAL),
          PATTERN_SWITCH(JDK17, Fragments.FeaturePatternSwitch, DiagKind.PLURAL),
          REDUNDANT_STRICTFP(JDK17),
          UNCONDITIONAL_PATTERN_IN_INSTANCEOF(JDK19, Fragments.FeatureUnconditionalPatternsInInstanceof, DiagKind.PLURAL),
          RECORD_PATTERNS(JDK19, Fragments.FeatureDeconstructionPatterns, DiagKind.PLURAL),
+         PRIMITIVE_CLASSES(JDK19, Fragments.FeaturePrimitiveClasses, DiagKind.PLURAL),
+         VALUE_CLASSES(JDK19, Fragments.FeatureValueClasses, DiagKind.PLURAL),
          ;
  
          enum DiagKind {
              NORMAL,
              PLURAL;

*** 283,10 ***
--- 285,13 ---
                      Fragments.FeatureNotSupportedInSourcePlural(optFragment, sourceName, minLevel.name);
          }
  
          public Error error(String sourceName) {
              Assert.checkNonNull(optFragment);
+             if (this == PRIMITIVE_CLASSES) {
+                 return Errors.PrimitiveClassesNotSupported(minLevel.name);
+             }
              return optKind == DiagKind.NORMAL ?
                      Errors.FeatureNotSupportedInSource(optFragment, sourceName, minLevel.name) :
                      Errors.FeatureNotSupportedInSourcePlural(optFragment, sourceName, minLevel.name);
          }
      }
< prev index next >