Skip to content

Commit 2830e48

Browse files
838: Fixed java.lang.NoClassDefFoundError for com.intellij.lang.jsgraphql.GraphQLIcons
1 parent a171a18 commit 2830e48

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ intellij {
4141
'properties',
4242
'CSS',
4343
'JavaScriptLanguage',
44-
'com.intellij.lang.jsgraphql:3.0.0',
44+
'com.intellij.lang.jsgraphql:3.1.2',
4545
'platform-images',
4646
'copyright'
4747
]
@@ -69,7 +69,7 @@ sourceSets {
6969
publishPlugin {
7070
token = System.getenv("MAGENTO_PHPSTORM_intellijPublishToken")
7171
if (Boolean.valueOf(System.getenv("MAGENTO_PHPSTORM_isAlpha"))) {
72-
channels 'alpha'
72+
channels = ['alpha']
7373
version = version + "-alpha-" + getDate()
7474
}
7575
}

src/com/magento/idea/magento2plugin/linemarker/php/GraphQlResolverUsageLineMarkerProvider.java

+18-17
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,51 @@
22
* Copyright © Magento, Inc. All rights reserved.
33
* See COPYING.txt for license details.
44
*/
5+
56
package com.magento.idea.magento2plugin.linemarker.php;
67

78
import com.intellij.codeInsight.daemon.LineMarkerInfo;
89
import com.intellij.codeInsight.daemon.LineMarkerProvider;
910
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder;
10-
import com.intellij.lang.jsgraphql.GraphQLIcons;
11+
import com.intellij.lang.jsgraphql.icons.GraphQLIcons;
1112
import com.intellij.psi.PsiElement;
1213
import com.intellij.psi.util.PsiTreeUtil;
1314
import com.jetbrains.php.lang.psi.elements.PhpClass;
1415
import com.magento.idea.magento2plugin.project.Settings;
1516
import com.magento.idea.magento2plugin.util.magento.graphql.GraphQlUsagesCollector;
1617
import com.magento.idea.magento2plugin.util.magento.graphql.GraphQlUtil;
17-
import org.jetbrains.annotations.NotNull;
18-
import org.jetbrains.annotations.Nullable;
19-
2018
import java.util.Collection;
2119
import java.util.List;
20+
import org.jetbrains.annotations.NotNull;
21+
import org.jetbrains.annotations.Nullable;
2222

2323
public class GraphQlResolverUsageLineMarkerProvider implements LineMarkerProvider {
24-
@Nullable
24+
2525
@Override
26-
public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement psiElement) {
26+
public @Nullable LineMarkerInfo<?> getLineMarkerInfo(final @NotNull PsiElement psiElement) {
2727
return null;
2828
}
2929

3030
@Override
31-
public void collectSlowLineMarkers(@NotNull List<? extends PsiElement> psiElements, @NotNull Collection<? super LineMarkerInfo<?>> collection) {
32-
if (psiElements.size() > 0) {
33-
if (!Settings.isEnabled(psiElements.get(0).getProject())) {
34-
return;
35-
}
31+
public void collectSlowLineMarkers(
32+
final @NotNull List<? extends PsiElement> psiElements,
33+
final @NotNull Collection<? super LineMarkerInfo<?>> collection
34+
) {
35+
if (!psiElements.isEmpty() && !Settings.isEnabled(psiElements.get(0).getProject())) {
36+
return;
3637
}
3738

38-
for (PsiElement psiElement : psiElements) {
39+
for (final PsiElement psiElement : psiElements) {
3940
if (psiElement instanceof PhpClass) {
40-
List<? extends PsiElement> results;
41-
4241
if (!GraphQlUtil.isResolver((PhpClass) psiElement)) {
4342
return;
4443
}
45-
GraphQlUsagesCollector collector = new GraphQlUsagesCollector();
46-
results = collector.getGraphQLUsages((PhpClass) psiElement);
44+
final GraphQlUsagesCollector collector = new GraphQlUsagesCollector();//NOPMD
45+
final List<? extends PsiElement> results = collector.getGraphQLUsages(
46+
(PhpClass) psiElement
47+
);
4748

48-
if (results.size() > 0 ) {
49+
if (!results.isEmpty()) {
4950
collection.add(NavigationGutterIconBuilder
5051
.create(GraphQLIcons.FILE)
5152
.setTargets(results)

0 commit comments

Comments
 (0)