From c5bc52d9fde847d9346287e4e1ce79af1d99d313 Mon Sep 17 00:00:00 2001 From: Bart van Helvert Date: Thu, 28 Mar 2024 14:31:04 +0100 Subject: [PATCH] [java] Don't do forbidden API check for highest language level For the highest language level, no API should be forbidden. #IDEA-349722 Fixed GitOrigin-RevId: 4819e096b798d4cc4b328cc85671a7180851b219 --- .../src/com/intellij/openapi/module/LanguageLevelUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/java-analysis-api/src/com/intellij/openapi/module/LanguageLevelUtil.java b/java/java-analysis-api/src/com/intellij/openapi/module/LanguageLevelUtil.java index 9f68b872946a..6ce9f756be47 100644 --- a/java/java-analysis-api/src/com/intellij/openapi/module/LanguageLevelUtil.java +++ b/java/java-analysis-api/src/com/intellij/openapi/module/LanguageLevelUtil.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.module; import com.intellij.openapi.application.ApplicationManager; @@ -72,7 +72,7 @@ public final class LanguageLevelUtil { static { for (LanguageLevel level : LanguageLevel.values()) { - if (level.ordinal() > LanguageLevel.HIGHEST.ordinal()) break; + if (level.ordinal() >= LanguageLevel.HIGHEST.ordinal()) break; int feature = level.feature() + 1; ourPresentableShortMessage.put(level, feature >= 9 ? String.valueOf(feature) : "1." + feature); }