Skip to content

Commit

Permalink
Move ChangeListManager inside method
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitrii Lipiridi committed Aug 11, 2024
1 parent db9b955 commit 7ee602e
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ public class SpotlessCheckinHandler extends CheckinHandler {
private static final Logger LOGGER = Logger.getInstance(SpotlessCheckinHandler.class);
private final SpotlessApplierSettingsState spotlessSettings = SpotlessApplierSettingsState.getInstance();
private final Project project;
private final ChangeListManager changeListManager;

public SpotlessCheckinHandler(Project project) {
this.project = project;
changeListManager = ChangeListManager.getInstance(project);
}

@Override
Expand Down Expand Up @@ -74,6 +72,7 @@ private void handleError(Exception e) {
}

public Set<ModuleInfo> findAffectedModules() {
ChangeListManager changeListManager = ChangeListManager.getInstance(project);
List<VirtualFile> affectedFiles = changeListManager.getAllChanges().stream()
.filter(change -> change.getType() != Change.Type.DELETED)
.map(Change::getVirtualFile)
Expand Down

0 comments on commit 7ee602e

Please sign in to comment.