Skip to content

Commit

Permalink
fix compat with 2020.1, so that we dont need to publish 2 version of …
Browse files Browse the repository at this point in the history
…plugin
  • Loading branch information
zhislin committed Dec 29, 2024
1 parent 25bf447 commit 015ea8d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.jaksonlin.pitestintellij.completion;
package com.github.jaksonlin.pitestintellij.completions;

import com.github.jaksonlin.pitestintellij.annotations.AnnotationFieldConfig;
import com.github.jaksonlin.pitestintellij.annotations.AnnotationSchema;
Expand All @@ -10,7 +10,6 @@
import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.patterns.PlatformPatterns;
import com.intellij.psi.PsiAnnotation;
import com.intellij.psi.PsiNameValuePair;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public void onRunHistoryChanged(Object eventObj) {
}
} else if (eventObj instanceof List) {
List<?> list = (List<?>) eventObj;
if (!list.isEmpty() && list.get(0) instanceof Pair) {
if (list.isEmpty()) {
initializeMutationTree(Collections.emptyList());
} else if (list.get(0) instanceof Pair) {
List<Pair<String, String>> nodeList = (List<Pair<String, String>>) list;
initializeMutationTree(nodeList);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.jaksonlin.pitestintellij.processor;
package com.github.jaksonlin.pitestintellij.processors;

import com.github.jaksonlin.pitestintellij.context.UnittestMethodContext;
import com.intellij.psi.PsiComment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import com.intellij.ui.content.ContentManager;
import com.intellij.ui.content.impl.ContentImpl; // Note the use of ContentImpl
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
Expand All @@ -14,9 +15,10 @@ public class MutationToolWindowFactory implements ToolWindowFactory {

@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
ContentFactory contentFactory = ContentFactory.getInstance();
Content content = contentFactory.createContent(createToolWindowPanel(project), "", false);
toolWindow.getContentManager().addContent(content);
JPanel toolWindowPanel = createToolWindowPanel(project);
ContentManager contentManager = toolWindow.getContentManager();
Content content = new ContentImpl(toolWindowPanel, "", false); // Directly create ContentImpl
contentManager.addContent(content);
}

private JPanel createToolWindowPanel(@NotNull Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.module.kotlin.KotlinModule;

import java.io.BufferedInputStream;
import java.io.File;
Expand All @@ -15,7 +14,6 @@ public class MutationReportParser {
private static final XmlMapper xmlMapper = new XmlMapper();

static {
xmlMapper.registerModule(new KotlinModule.Builder().build());
// Enable features that might improve performance
xmlMapper.enable(JsonParser.Feature.AUTO_CLOSE_SOURCE);
xmlMapper.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
/>
<completion.contributor
language="JAVA"
implementationClass="com.github.jaksonlin.pitestintellij.completion.AnnotationCompletionContributor"/>
implementationClass="com.github.jaksonlin.pitestintellij.completions.AnnotationCompletionContributor"/>

</extensions>

Expand Down

0 comments on commit 015ea8d

Please sign in to comment.