mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[java] IDEA-354964 Migrate standard descriptors like JAVA_21 to TYPE_USE annotations
GitOrigin-RevId: d13187d41d214bd2ccadecb4cadc925f7d787d60
This commit is contained in:
committed by
intellij-monorepo-bot
parent
950fc76efd
commit
638393e895
@@ -93,10 +93,18 @@ public abstract class LightJavaCodeInsightTestCase extends LightPlatformCodeInsi
|
||||
|
||||
@Override
|
||||
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
|
||||
LanguageLevel languageLevel = getLanguageLevel();
|
||||
return new SimpleLightProjectDescriptor(getModuleTypeId(), getProjectJDK()) {
|
||||
@Override
|
||||
protected void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) {
|
||||
DefaultLightProjectDescriptor.addJetBrainsAnnotations(model);
|
||||
if (languageLevel.isAtLeast(LanguageLevel.JDK_1_8)) {
|
||||
//DefaultLightProjectDescriptor.addJetBrainsAnnotations(model);
|
||||
|
||||
DefaultLightProjectDescriptor.addJetBrainsAnnotationsJava8AndHigher(model);
|
||||
}
|
||||
else {
|
||||
DefaultLightProjectDescriptor.addJetBrainsAnnotations(model);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.testFramework.fixtures;
|
||||
|
||||
import com.intellij.openapi.module.Module;
|
||||
@@ -87,7 +73,11 @@ public class DefaultLightProjectDescriptor extends LightProjectDescriptor {
|
||||
return withRepositoryLibrary(JETBRAINS_ANNOTATIONS_COORDINATES);
|
||||
}
|
||||
|
||||
public static void addJetBrainsAnnotationsWithTypeUse(ModifiableRootModel model) {
|
||||
public DefaultLightProjectDescriptor withJetBrainsAnnotationsJava8AndHigher() {
|
||||
return withRepositoryLibrary(JETBRAINS_ANNOTATIONS_COORDINATES_JAVA_8);
|
||||
}
|
||||
|
||||
public static void addJetBrainsAnnotationsJava8AndHigher(ModifiableRootModel model) {
|
||||
MavenDependencyUtil.addFromMaven(model, JETBRAINS_ANNOTATIONS_COORDINATES_JAVA_8);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,12 @@ public abstract class LightJavaCodeInsightFixtureTestCase extends UsefulTestCase
|
||||
@Override
|
||||
public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) {
|
||||
model.getModuleExtension(LanguageLevelModuleExtension.class).setLanguageLevel(myLanguageLevel);
|
||||
addJetBrainsAnnotations(model);
|
||||
if (myLanguageLevel.isAtLeast(LanguageLevel.JDK_1_8)) {
|
||||
addJetBrainsAnnotationsJava8AndHigher(model);
|
||||
}
|
||||
else {
|
||||
addJetBrainsAnnotations(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user