Skip to content

Commit

Permalink
Remove constructor injection from CheckerFactory for 2023.x compatibi…
Browse files Browse the repository at this point in the history
…lity (#604).
  • Loading branch information
jshiell committed Mar 12, 2023
1 parent 9a23049 commit 696e7da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# CheckStyle-IDEA Changelog

* **5.77.0** Fixed: Remove constructor injection from CheckerFactory for 2023.x compatibility (#604).
* **5.77.0** New: Now built against IDEA 2022.1.4 (was 2021.3.3).
* **5.77.0** New: Added Checkstyle 10.8.1.
* **5.76.0** New: Added Checkstyle 10.7.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class CheckerFactory {
private static final Logger LOG = Logger.getInstance(CheckerFactory.class);

private final Project project;
private final CheckstyleProjectService checkstyleProjectService;
private final CheckerFactoryCache cache;
private CheckstyleProjectService checkstyleProjectService;
private CheckerFactoryCache cache;

@SuppressWarnings("unused") // IDEA's DI
public CheckerFactory(@NotNull final Project project) {
Expand All @@ -42,18 +42,13 @@ public CheckerFactory(@NotNull final Project project) {
this.cache = project.getService(CheckerFactoryCache.class);
}

private CheckerFactory(@NotNull final Project project,
@NotNull final CheckstyleProjectService checkstyleProjectService,
@NotNull final CheckerFactoryCache cache) {
this.project = project;
this.checkstyleProjectService = checkstyleProjectService;
this.cache = cache;
}

public static CheckerFactory create(@NotNull final Project project,
@NotNull final CheckstyleProjectService checkstyleProjectService,
@NotNull final CheckerFactoryCache cache) {
return new CheckerFactory(project, checkstyleProjectService, cache);
@NotNull final CheckstyleProjectService checkstyleProjectService,
@NotNull final CheckerFactoryCache cache) {
CheckerFactory checkerFactory = new CheckerFactory(project);
checkerFactory.checkstyleProjectService = checkstyleProjectService;
checkerFactory.cache = cache;
return checkerFactory;
}

public void verify(final ConfigurationLocation location) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<change-notes>
<![CDATA[
<ul>
<li>5.77.0: Fixed: Remove constructor injection from CheckerFactory for 2023.x compatibility (#604).</li>
<li>5.77.0: New: Now built against IDEA 2022.1.4 (was 2021.3.3).</li>
<li>5.77.0: New: Added Checkstyle 10.8.1.</li>
<li>5.76.0: New: Added Checkstyle 10.7.0.</li>
Expand Down

0 comments on commit 696e7da

Please sign in to comment.