Skip to content

Commit 6ee9378

Browse files
authored
Merge branch 'main' into add-buf-format
2 parents 78712ba + 6ef9878 commit 6ee9378

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

plugin-gradle/CHANGES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
44

55
## [Unreleased]
66
### Added
7-
* Added support for Protobuf formatting based on [Buf](https://buf.build/) (#1208).
7+
* Added support for Protobuf formatting based on [Buf](https://buf.build/) ([#1208](https://github.com/diffplug/spotless/pull/1208)).
8+
### Fixed
9+
* More daemon memory consumption fixes ([#1206](https://github.com/diffplug/spotless/pull/1198) fixes [#1194](https://github.com/diffplug/spotless/issues/1194))
810

911
## [6.6.0] - 2022-05-10
1012
### Added

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/JvmLocalCache.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@ static class LiveCacheKeyImpl<T> implements LiveCache<T>, Serializable {
5454

5555
@Override
5656
public void set(T value) {
57-
if (value instanceof LazyForwardingEquality) {
58-
// whenever we cache an instance of LazyForwardingEquality, we want to make sure that we give it
59-
// a chance to null-out its initialization lambda (see https://github.com/diffplug/spotless/issues/1194#issuecomment-1120744842)
60-
LazyForwardingEquality.unlazy((LazyForwardingEquality<?>) value);
61-
}
57+
58+
// whenever we cache an instance of LazyForwardingEquality, we want to make sure that we give it
59+
// a chance to null-out its initialization lambda (see https://github.com/diffplug/spotless/issues/1194#issuecomment-1120744842)
60+
LazyForwardingEquality.unlazy(value);
6261
daemonState.put(internalKey, value);
6362
}
6463

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessExtensionPredeclare.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 DiffPlug
2+
* Copyright 2021-2022 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,6 +21,8 @@
2121
import org.gradle.api.Action;
2222
import org.gradle.api.Project;
2323

24+
import com.diffplug.spotless.LazyForwardingEquality;
25+
2426
public class SpotlessExtensionPredeclare extends SpotlessExtension {
2527
private final SortedMap<String, FormatExtension> toSetup = new TreeMap<>();
2628

@@ -33,6 +35,8 @@ public SpotlessExtensionPredeclare(Project project, GradleProvisioner.Policy pol
3335
lazyAction.execute(formatExtension);
3436
}
3537
getRegisterDependenciesTask().steps.addAll(formatExtension.steps);
38+
// needed to fix Deemon memory leaks (#1194), but this line came from https://github.com/diffplug/spotless/pull/1206
39+
LazyForwardingEquality.unlazy(getRegisterDependenciesTask().steps);
3640
});
3741
});
3842
}

0 commit comments

Comments
 (0)