Skip to content

Commit 515d5b3

Browse files
committed
Replace deprecated code with non deprecated alternatives
1 parent a0ed5e2 commit 515d5b3

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/main/java/org/mapstruct/intellij/util/MapstructUtil.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.util.function.Function;
1414
import java.util.stream.Stream;
1515

16+
import com.intellij.codeInsight.AnnotationUtil;
1617
import com.intellij.codeInsight.lookup.LookupElement;
1718
import com.intellij.codeInsight.lookup.LookupElementBuilder;
1819
import com.intellij.openapi.module.Module;
@@ -273,7 +274,7 @@ public static boolean isMappingTarget(PsiParameter psiParameter) {
273274
* @return {@code true} if the {@code psiClass} is annotated with {@link Mapper}, {@code false} otherwise
274275
*/
275276
public static boolean isMapper(PsiClass psiClass) {
276-
return isAnnotated( psiClass, MAPPER_ANNOTATION_FQN, false );
277+
return isAnnotated( psiClass, MAPPER_ANNOTATION_FQN, AnnotationUtil.CHECK_TYPE );
277278
}
278279

279280
/**
@@ -284,7 +285,7 @@ public static boolean isMapper(PsiClass psiClass) {
284285
* @return {@code true} if the {@code psiClass} is annotated with {@link MapperConfig}, {@code false} otherwise
285286
*/
286287
public static boolean isMapperConfig(PsiClass psiClass) {
287-
return isAnnotated( psiClass, MAPPER_CONFIG_ANNOTATION_FQN, false );
288+
return isAnnotated( psiClass, MAPPER_CONFIG_ANNOTATION_FQN, AnnotationUtil.CHECK_TYPE );
288289
}
289290

290291
/**
@@ -301,10 +302,10 @@ public static boolean isMapperConfig(PsiClass psiClass) {
301302
* @return
302303
*/
303304
public static boolean isMappingMethod(PsiMethod psiMethod) {
304-
return isAnnotated( psiMethod, MAPPING_ANNOTATION_FQN, false )
305-
|| isAnnotated( psiMethod, MAPPINGS_ANNOTATION_FQN, false )
306-
|| isAnnotated( psiMethod, VALUE_MAPPING_ANNOTATION_FQN, false )
307-
|| isAnnotated( psiMethod, VALUE_MAPPINGS_ANNOTATION_FQN, false );
305+
return isAnnotated( psiMethod, MAPPING_ANNOTATION_FQN, AnnotationUtil.CHECK_TYPE )
306+
|| isAnnotated( psiMethod, MAPPINGS_ANNOTATION_FQN, AnnotationUtil.CHECK_TYPE )
307+
|| isAnnotated( psiMethod, VALUE_MAPPING_ANNOTATION_FQN, AnnotationUtil.CHECK_TYPE )
308+
|| isAnnotated( psiMethod, VALUE_MAPPINGS_ANNOTATION_FQN, AnnotationUtil.CHECK_TYPE );
308309
}
309310

310311
/**

src/test/java/org/mapstruct/intellij/MapstructBaseCompletionTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected void setUp() throws Exception {
3838
super.setUp();
3939
final String mapstructLibPath = PathUtil.toSystemIndependentName( new File( BUILD_LIBS_DIRECTORY )
4040
.getAbsolutePath() );
41-
VfsRootAccess.allowRootAccess( mapstructLibPath );
41+
VfsRootAccess.allowRootAccess( getTestRootDisposable(), mapstructLibPath );
4242
PsiTestUtil.addLibrary(
4343
myFixture.getProjectDisposable(),
4444
myFixture.getModule(),

0 commit comments

Comments
 (0)