From b62c2f056b21aea1f059947115478f331b71943d Mon Sep 17 00:00:00 2001 From: Jamie Shiell Date: Sun, 25 Aug 2024 15:41:22 +0100 Subject: [PATCH] Add Checkstyle 10.18.0 --- CHANGELOG.md | 1 + build.gradle.kts | 2 +- .../service/CheckstyleActionsImpl.java | 18 ++---------------- .../checkstyle/service/IgnoringResolver.java | 15 --------------- .../service/cmd/OpLoadConfiguration.java | 8 ++------ .../service/IgnoringResolverTest.java | 17 ----------------- .../service/cmd/OpLoadConfigurationTest.java | 11 +++++++++-- .../idea/checkstyle/CheckstylePluginApi.java | 1 - .../checkstyle/csapi/CheckstyleActions.java | 6 ------ .../importer/CheckStyleCodeStyleImporter.java | 2 +- .../model/ConfigurationLocation.java | 10 +++++++--- .../idea/checkstyle/util/ProjectFilePaths.java | 7 ++++++- .../idea/checkstyle/util/ProjectPaths.java | 7 ++++++- src/main/resources/META-INF/plugin.xml | 9 ++------- src/main/resources/checkstyle-idea.properties | 2 +- .../checkstyle/CheckstylePluginApiTest.java | 9 ++++++--- .../idea/checkstyle/config/DescriptorTest.java | 3 ++- .../ConfigurationLocationFactoryTest.java | 3 ++- .../model/ConfigurationLocationTest.java | 3 ++- 19 files changed, 50 insertions(+), 84 deletions(-) delete mode 100644 src/csaccess/java/org/infernus/idea/checkstyle/service/IgnoringResolver.java delete mode 100644 src/csaccessTest/java/org/infernus/idea/checkstyle/service/IgnoringResolverTest.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 273ded56..9d554c9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CheckStyle-IDEA Changelog +* **5.94.0** New: Added CheckStyle 10.18.0. * **5.93.5** Fixed: Improve fallback when the serialised Checkstyle version to use is absent (#648). * **5.93.4** Fixed: resolved case-sensitivity problem that was breaking builds on case-sensitive FSs (in particular, CI) (#646). * **5.93.3** WiP: test release to verify artefact generation on CI (#646). diff --git a/build.gradle.kts b/build.gradle.kts index d501248d..72dd12fe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ plugins { id("org.infernus.idea.checkstyle.build") } -version = "5.93.5" +version = "5.94.0." repositories { mavenCentral() diff --git a/src/csaccess/java/org/infernus/idea/checkstyle/service/CheckstyleActionsImpl.java b/src/csaccess/java/org/infernus/idea/checkstyle/service/CheckstyleActionsImpl.java index 77a0bfac..0755d209 100644 --- a/src/csaccess/java/org/infernus/idea/checkstyle/service/CheckstyleActionsImpl.java +++ b/src/csaccess/java/org/infernus/idea/checkstyle/service/CheckstyleActionsImpl.java @@ -80,15 +80,8 @@ public Map> scan(@NotNull final CheckstyleInternalObject @Override public CheckstyleInternalObject loadConfiguration(@NotNull final ConfigurationLocation inputFile, - final boolean ignoreVariables, @Nullable final Map variables) { - OpLoadConfiguration cmd; - if (ignoreVariables) { - cmd = new OpLoadConfiguration(inputFile, checkstyleProjectService); - } else { - cmd = new OpLoadConfiguration(inputFile, variables, checkstyleProjectService); - } - return executeCommand(cmd); + return executeCommand(new OpLoadConfiguration(inputFile, variables, checkstyleProjectService)); } @Override @@ -100,15 +93,8 @@ public CheckstyleInternalObject loadConfiguration(@NotNull final ConfigurationLo @Override public CheckstyleInternalObject loadConfiguration(@NotNull final VirtualFile inputFile, - final boolean ignoreVariables, @Nullable final Map variables) { - OpLoadConfiguration cmd; - if (ignoreVariables) { - cmd = new OpLoadConfiguration(inputFile, checkstyleProjectService); - } else { - cmd = new OpLoadConfiguration(inputFile, variables, checkstyleProjectService); - } - return executeCommand(cmd); + return executeCommand(new OpLoadConfiguration(inputFile, variables, checkstyleProjectService)); } @Override diff --git a/src/csaccess/java/org/infernus/idea/checkstyle/service/IgnoringResolver.java b/src/csaccess/java/org/infernus/idea/checkstyle/service/IgnoringResolver.java deleted file mode 100644 index db000837..00000000 --- a/src/csaccess/java/org/infernus/idea/checkstyle/service/IgnoringResolver.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.infernus.idea.checkstyle.service; - -import com.puppycrawl.tools.checkstyle.PropertyResolver; - -/** - * PropertyResolver that resolves everything to the empty String. - */ -public class IgnoringResolver implements PropertyResolver { - - @Override - public String resolve(final String pName) { - return ""; - } - -} diff --git a/src/csaccess/java/org/infernus/idea/checkstyle/service/cmd/OpLoadConfiguration.java b/src/csaccess/java/org/infernus/idea/checkstyle/service/cmd/OpLoadConfiguration.java index bd254c2b..28d4aaf0 100644 --- a/src/csaccess/java/org/infernus/idea/checkstyle/service/cmd/OpLoadConfiguration.java +++ b/src/csaccess/java/org/infernus/idea/checkstyle/service/cmd/OpLoadConfiguration.java @@ -12,7 +12,6 @@ import org.infernus.idea.checkstyle.CheckstyleProjectService; import org.infernus.idea.checkstyle.exception.CheckstyleServiceException; import org.infernus.idea.checkstyle.model.ConfigurationLocation; -import org.infernus.idea.checkstyle.service.IgnoringResolver; import org.infernus.idea.checkstyle.service.RulesContainer; import org.infernus.idea.checkstyle.service.RulesContainer.ConfigurationLocationRulesContainer; import org.infernus.idea.checkstyle.service.RulesContainer.ContentRulesContainer; @@ -32,6 +31,7 @@ import java.util.Map; import static java.lang.String.format; +import static java.util.Objects.requireNonNullElseGet; import static org.infernus.idea.checkstyle.CheckStyleBundle.message; import static org.infernus.idea.checkstyle.util.Notifications.showError; import static org.infernus.idea.checkstyle.util.Notifications.showWarning; @@ -108,11 +108,7 @@ private OpLoadConfiguration(final RulesContainer rulesContainer, this.module = module; this.checkstyleProjectService = checkstyleProjectService; - if (properties != null) { - resolver = new SimpleResolver(properties); - } else { - resolver = new IgnoringResolver(); - } + resolver = new SimpleResolver(requireNonNullElseGet(properties, Map::of)); } private static Map buildReplacementsMap() { diff --git a/src/csaccessTest/java/org/infernus/idea/checkstyle/service/IgnoringResolverTest.java b/src/csaccessTest/java/org/infernus/idea/checkstyle/service/IgnoringResolverTest.java deleted file mode 100644 index bcb23c96..00000000 --- a/src/csaccessTest/java/org/infernus/idea/checkstyle/service/IgnoringResolverTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.infernus.idea.checkstyle.service; - -import org.junit.Assert; -import org.junit.Test; - - -public class IgnoringResolverTest { - @Test - public void testResolve1() { - Assert.assertEquals("", new IgnoringResolver().resolve("key")); - } - - @Test - public void testResolveNull() { - Assert.assertEquals("", new IgnoringResolver().resolve(null)); - } -} diff --git a/src/csaccessTest/java/org/infernus/idea/checkstyle/service/cmd/OpLoadConfigurationTest.java b/src/csaccessTest/java/org/infernus/idea/checkstyle/service/cmd/OpLoadConfigurationTest.java index 248d144c..ad4977c8 100644 --- a/src/csaccessTest/java/org/infernus/idea/checkstyle/service/cmd/OpLoadConfigurationTest.java +++ b/src/csaccessTest/java/org/infernus/idea/checkstyle/service/cmd/OpLoadConfigurationTest.java @@ -30,6 +30,7 @@ import java.net.URISyntaxException; import java.net.URL; import java.net.URLClassLoader; +import java.util.Map; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; @@ -404,7 +405,10 @@ public void testLoadBundledSunChecks() { when(projectService.underlyingClassLoader()).thenReturn(getClass().getClassLoader()); CheckstyleInternalObject csConfig = new CheckstyleActionsImpl(PROJECT, projectService) - .loadConfiguration(clf.create(BundledConfig.SUN_CHECKS, TestHelper.mockProject()), true, null); + .loadConfiguration(clf.create(BundledConfig.SUN_CHECKS, TestHelper.mockProject()), Map.of( + "org.checkstyle.sun.suppressionfilter.config", "", + "org.checkstyle.sun.suppressionxpathfilter.config", "" + )); Assert.assertNotNull(csConfig); } @@ -415,7 +419,10 @@ public void testLoadBundledGoogleChecks() { CheckstyleProjectService projectService = mock(CheckstyleProjectService.class); when(projectService.underlyingClassLoader()).thenReturn(getClass().getClassLoader()); CheckstyleInternalObject csConfig = new CheckstyleActionsImpl(PROJECT, projectService) - .loadConfiguration(clf.create(BundledConfig.GOOGLE_CHECKS, TestHelper.mockProject()), true, null); + .loadConfiguration(clf.create(BundledConfig.GOOGLE_CHECKS, TestHelper.mockProject()), Map.of( + "org.checkstyle.google.suppressionfilter.config", "", + "org.checkstyle.google.suppressionxpathfilter.config", "" + )); Assert.assertNotNull(csConfig); } } diff --git a/src/main/java/org/infernus/idea/checkstyle/CheckstylePluginApi.java b/src/main/java/org/infernus/idea/checkstyle/CheckstylePluginApi.java index 517a22aa..e3d0d587 100644 --- a/src/main/java/org/infernus/idea/checkstyle/CheckstylePluginApi.java +++ b/src/main/java/org/infernus/idea/checkstyle/CheckstylePluginApi.java @@ -38,7 +38,6 @@ public void visitCurrentConfiguration(@NotNull final ConfigurationVisitor visito checkstyleInstance.peruseConfiguration( checkstyleInstance.loadConfiguration( it, - true, new HashMap<>()), module -> visitor.accept(it.getDescription(), module)); }); diff --git a/src/main/java/org/infernus/idea/checkstyle/csapi/CheckstyleActions.java b/src/main/java/org/infernus/idea/checkstyle/csapi/CheckstyleActions.java index ea4fad9d..245a6128 100644 --- a/src/main/java/org/infernus/idea/checkstyle/csapi/CheckstyleActions.java +++ b/src/main/java/org/infernus/idea/checkstyle/csapi/CheckstyleActions.java @@ -81,13 +81,10 @@ Map> scan(@NotNull CheckstyleInternalObject checkerWithCo * Load a Checkstyle configuration file. * * @param inputFile the file to load - * @param ignoreVariables if true, all variables in the config file wil be replaced with the empty - * String; if false, the variables will be filled from the given map * @param variables variables to substitute in the loaded config file * @return a Checkstyle configuration object */ CheckstyleInternalObject loadConfiguration(@NotNull ConfigurationLocation inputFile, - boolean ignoreVariables, @Nullable Map variables); /** @@ -106,13 +103,10 @@ CheckstyleInternalObject loadConfiguration(@NotNull ConfigurationLocation inputF * Load a Checkstyle configuration file. * * @param inputFile the file to load - * @param ignoreVariables if true, all variables in the config file wil be replaced with the empty - * String; if false, the variables will be filled from the given map * @param variables variables to substitute in the loaded config file * @return a Checkstyle configuration object */ CheckstyleInternalObject loadConfiguration(@NotNull VirtualFile inputFile, - boolean ignoreVariables, @Nullable Map variables); /** diff --git a/src/main/java/org/infernus/idea/checkstyle/importer/CheckStyleCodeStyleImporter.java b/src/main/java/org/infernus/idea/checkstyle/importer/CheckStyleCodeStyleImporter.java index 8a1d847a..fb147ee6 100644 --- a/src/main/java/org/infernus/idea/checkstyle/importer/CheckStyleCodeStyleImporter.java +++ b/src/main/java/org/infernus/idea/checkstyle/importer/CheckStyleCodeStyleImporter.java @@ -79,7 +79,7 @@ private CheckstyleInternalObject loadConfiguration(@NotNull final Project projec @NotNull final VirtualFile selectedFile) { return checkstyleProjectService(project) .getCheckstyleInstance() - .loadConfiguration(selectedFile, true, null); + .loadConfiguration(selectedFile, null); } diff --git a/src/main/java/org/infernus/idea/checkstyle/model/ConfigurationLocation.java b/src/main/java/org/infernus/idea/checkstyle/model/ConfigurationLocation.java index 0e05c2dc..337d1362 100644 --- a/src/main/java/org/infernus/idea/checkstyle/model/ConfigurationLocation.java +++ b/src/main/java/org/infernus/idea/checkstyle/model/ConfigurationLocation.java @@ -4,7 +4,6 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; -import com.intellij.openapi.project.ProjectUtil; import com.intellij.openapi.roots.ContentEntry; import com.intellij.openapi.roots.ModuleRootManager; import com.intellij.openapi.vfs.VirtualFile; @@ -14,6 +13,7 @@ import org.infernus.idea.checkstyle.checker.CheckerFactoryCache; import org.infernus.idea.checkstyle.util.CheckStyleEntityResolver; import org.infernus.idea.checkstyle.util.Objects; +import org.infernus.idea.checkstyle.util.ProjectPaths; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -323,7 +323,7 @@ private File checkRelativeToRulesFile(final String fileName) { } private File checkProjectBaseDir(final String fileName) { - VirtualFile baseDir = ProjectUtil.guessProjectDir(project); + VirtualFile baseDir = projectPaths().projectPath(project); if (baseDir != null) { final File projectRelativePath = new File(baseDir.getPath(), fileName); if (projectRelativePath.exists()) { @@ -335,7 +335,7 @@ private File checkProjectBaseDir(final String fileName) { private File checkModuleFile(final Module module, final String fileName) { - VirtualFile moduleDir = ProjectUtil.guessModuleDir(module); + VirtualFile moduleDir = projectPaths().modulePath(module); if (moduleDir != null) { final File moduleRelativePath = new File(moduleDir.getPath(), fileName); if (moduleRelativePath.exists()) { @@ -463,6 +463,10 @@ private int compareStrings(@Nullable final String pStr1, @Nullable final String return result; } + @NotNull + protected ProjectPaths projectPaths() { + return getProject().getService(ProjectPaths.class); + } public synchronized boolean isBlocked() { return blockedUntil > currentTimeMillis(); diff --git a/src/main/java/org/infernus/idea/checkstyle/util/ProjectFilePaths.java b/src/main/java/org/infernus/idea/checkstyle/util/ProjectFilePaths.java index 8e2f4785..c46a4018 100644 --- a/src/main/java/org/infernus/idea/checkstyle/util/ProjectFilePaths.java +++ b/src/main/java/org/infernus/idea/checkstyle/util/ProjectFilePaths.java @@ -24,7 +24,12 @@ public class ProjectFilePaths { private final Function absolutePathOf; public ProjectFilePaths(@NotNull final Project project) { - this(project, File.separatorChar, File::getAbsolutePath, new ProjectPaths()); + this(project, File.separatorChar, File::getAbsolutePath, project.getService(ProjectPaths.class)); + } + + public ProjectFilePaths(@NotNull final Project project, + @NotNull final ProjectPaths projectPaths) { + this(project, File.separatorChar, File::getAbsolutePath, projectPaths); } public ProjectFilePaths(@NotNull final Project project, diff --git a/src/main/java/org/infernus/idea/checkstyle/util/ProjectPaths.java b/src/main/java/org/infernus/idea/checkstyle/util/ProjectPaths.java index 34cd263c..dfdeeb93 100644 --- a/src/main/java/org/infernus/idea/checkstyle/util/ProjectPaths.java +++ b/src/main/java/org/infernus/idea/checkstyle/util/ProjectPaths.java @@ -1,10 +1,10 @@ package org.infernus.idea.checkstyle.util; +import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectUtil; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; - import org.jetbrains.annotations.Nullable; public class ProjectPaths { @@ -15,4 +15,9 @@ public VirtualFile projectPath(@NotNull final Project project) { return ProjectUtil.guessProjectDir(project); } + @Nullable + public VirtualFile modulePath(@NotNull final Module module) { + return ProjectUtil.guessModuleDir(module); + } + } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index fbbdf082..9eb9533c 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -25,6 +25,7 @@ +
  • 5.94.0: New: Added Checkstyle 10.18.0.
  • 5.93.5: Fixed: Improve fallback when the serialised Checkstyle version to use is absent (#648).
  • 5.93.4: Fixed: resolved case-sensitivity problem that was breaking builds on case-sensitive FSs (in particular, CI) (#646).
  • 5.93.3: WiP: test release to verify artefact generation on CI (#646).
  • @@ -48,13 +49,6 @@
  • 5.86.0: New: Added Checkstyle 10.13.0, 10.12.7.
  • 5.85.1: Fixed: EDT access error in commit dialogue (#626).
  • 5.85.0: New: Added Checkstyle 10.12.5.
  • -
  • 5.84.0: New: Added Checkstyle 10.12.4.
  • -
  • 5.83.0: New: New: Add ability to add bundled rules via the `BundledConfigProvider` interface (#622) - thanks to @rhierlmeier.
  • -
  • 5.83.0: New: Added Checkstyle 10.12.3.
  • -
  • 5.82.0: New: Added Checkstyle 10.12.2.
  • -
  • 5.81.0: New: Added Checkstyle 10.12.1.
  • -
  • 5.80.1: Fixed: Skip changelist & module checks to ensure update action is fast enough on toolbar actions (#612, #615).
  • -
  • 5.80.0: New: Added Checkstyle 10.12.0.
  • For older changes please see the changelog.
  • ]]> @@ -73,6 +67,7 @@ + diff --git a/src/main/resources/checkstyle-idea.properties b/src/main/resources/checkstyle-idea.properties index 078138ff..8e520b77 100644 --- a/src/main/resources/checkstyle-idea.properties +++ b/src/main/resources/checkstyle-idea.properties @@ -3,7 +3,7 @@ checkstyle.versions.supported = \ 9.0.1, 9.1, 9.2.1, 9.3, \ 10.0, 10.1, 10.2, 10.3.4, 10.4, 10.5.0, 10.6.0, 10.7.0, 10.8.1, 10.9.3, \ - 10.10.0, 10.12.7, 10.13.0, 10.14.2, 10.15.0, 10.16.0, 10.17.0 + 10.10.0, 10.12.7, 10.13.0, 10.14.2, 10.15.0, 10.16.0, 10.17.0, 10.18.0 # The "base version" must be one of the versions listed above. The sources are compiled against this version, so it is diff --git a/src/test/java/org/infernus/idea/checkstyle/CheckstylePluginApiTest.java b/src/test/java/org/infernus/idea/checkstyle/CheckstylePluginApiTest.java index 6f832f0d..1f542d3e 100644 --- a/src/test/java/org/infernus/idea/checkstyle/CheckstylePluginApiTest.java +++ b/src/test/java/org/infernus/idea/checkstyle/CheckstylePluginApiTest.java @@ -6,6 +6,7 @@ import org.infernus.idea.checkstyle.config.PluginConfigurationManager; import org.infernus.idea.checkstyle.csapi.ConfigurationModule; import org.infernus.idea.checkstyle.model.*; +import org.infernus.idea.checkstyle.util.ProjectPaths; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -16,7 +17,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.infernus.idea.checkstyle.csapi.BundledConfig.GOOGLE_CHECKS; - import static org.junit.Assert.fail; import static org.mockito.Mockito.*; @@ -73,6 +73,9 @@ public void currentConfigurationCanBeVisited() { BundledConfigurationLocation googleChecks = new ConfigurationLocationFactory().create(GOOGLE_CHECKS, project); TreeSet locations = new TreeSet<>(); locations.add(googleChecks); + ProjectPaths projectPaths = mock(ProjectPaths.class); + when(projectPaths.projectPath(project)).thenReturn(null); + when(project.getService(ProjectPaths.class)).thenReturn(projectPaths); when(pluginConfigManager.getCurrent()) .thenReturn(PluginConfigurationBuilder .testInstance(CHECKSTYLE_VERSION) @@ -92,7 +95,7 @@ public void currentConfigurationCanBeVisited() { verify(visitor, atLeastOnce()).accept(eq("Google Checks"), configModuleCaptor.capture()); assertThat(configModuleCaptor.getValue(), is(not(nullValue()))); - assertThat(configModuleCaptor.getValue().getName(), is("SuppressionXpathFilter")); - + // note that SuppressionXpathFilter is filtered out as there's no valid suppressions file found + assertThat(configModuleCaptor.getValue().getName(), is("CommentsIndentation")); } } diff --git a/src/test/java/org/infernus/idea/checkstyle/config/DescriptorTest.java b/src/test/java/org/infernus/idea/checkstyle/config/DescriptorTest.java index d0e57480..eeaa4671 100644 --- a/src/test/java/org/infernus/idea/checkstyle/config/DescriptorTest.java +++ b/src/test/java/org/infernus/idea/checkstyle/config/DescriptorTest.java @@ -7,6 +7,7 @@ import org.infernus.idea.checkstyle.model.ConfigurationLocation; import org.infernus.idea.checkstyle.model.ConfigurationLocationFactory; import org.infernus.idea.checkstyle.util.ProjectFilePaths; +import org.infernus.idea.checkstyle.util.ProjectPaths; import org.junit.Before; import org.junit.Test; @@ -22,7 +23,7 @@ public class DescriptorTest { @Before public void setUp() { when(project.getService(ConfigurationLocationFactory.class)).thenReturn(new ConfigurationLocationFactory()); - when(project.getService(ProjectFilePaths.class)).thenReturn(new ProjectFilePaths(project)); + when(project.getService(ProjectFilePaths.class)).thenReturn(new ProjectFilePaths(project, new ProjectPaths())); } @Test diff --git a/src/test/java/org/infernus/idea/checkstyle/model/ConfigurationLocationFactoryTest.java b/src/test/java/org/infernus/idea/checkstyle/model/ConfigurationLocationFactoryTest.java index 9e9568e0..a2da0fb4 100644 --- a/src/test/java/org/infernus/idea/checkstyle/model/ConfigurationLocationFactoryTest.java +++ b/src/test/java/org/infernus/idea/checkstyle/model/ConfigurationLocationFactoryTest.java @@ -5,6 +5,7 @@ import org.infernus.idea.checkstyle.TestHelper; import org.infernus.idea.checkstyle.csapi.BundledConfig; import org.infernus.idea.checkstyle.util.ProjectFilePaths; +import org.infernus.idea.checkstyle.util.ProjectPaths; import org.junit.Before; import org.junit.Test; @@ -24,7 +25,7 @@ public class ConfigurationLocationFactoryTest { @Before public void setUp() { when(project.getService(ConfigurationLocationFactory.class)).thenReturn(underTest); - when(project.getService(ProjectFilePaths.class)).thenReturn(new ProjectFilePaths(project)); + when(project.getService(ProjectFilePaths.class)).thenReturn(new ProjectFilePaths(project, new ProjectPaths())); } @Test diff --git a/src/test/java/org/infernus/idea/checkstyle/model/ConfigurationLocationTest.java b/src/test/java/org/infernus/idea/checkstyle/model/ConfigurationLocationTest.java index 5aaabd6f..592939bf 100644 --- a/src/test/java/org/infernus/idea/checkstyle/model/ConfigurationLocationTest.java +++ b/src/test/java/org/infernus/idea/checkstyle/model/ConfigurationLocationTest.java @@ -5,6 +5,7 @@ import org.infernus.idea.checkstyle.config.Descriptor; import org.infernus.idea.checkstyle.csapi.BundledConfig; import org.infernus.idea.checkstyle.util.ProjectFilePaths; +import org.infernus.idea.checkstyle.util.ProjectPaths; import org.jetbrains.annotations.NotNull; import org.junit.Before; import org.junit.Test; @@ -240,7 +241,7 @@ public Object clone() { @Test public void testSorting() { final Project project = TestHelper.mockProject(); - when(project.getService(ProjectFilePaths.class)).thenReturn(new ProjectFilePaths(project)); + when(project.getService(ProjectFilePaths.class)).thenReturn(new ProjectFilePaths(project, new ProjectPaths())); List list = new ArrayList<>(); FileConfigurationLocation fcl = new FileConfigurationLocation(project, "id1", ConfigurationType.LOCAL_FILE);