Skip to content

Commit 6b66e45

Browse files
authoredJun 10, 2022
GJF without jvm args, pt 2 (#1228 follow-up to #1224, fixes #834)
2 parents 2a0f65a + 6f98128 commit 6b66e45

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed
 

‎CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This document is intended for Spotless developers.
1010
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
1111

1212
## [Unreleased]
13+
### Fixed
14+
* (Second try) `googleJavaFormat` and `removeUnusedImports` works on JDK16+ without jvm args workaround. ([#1228](https://github.com/diffplug/spotless/pull/1228))
1315

1416
## [2.26.0] - 2022-06-05
1517
### Added

‎lib/src/main/java/com/diffplug/spotless/java/ModuleHelper.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ private static void openPackages(Collection<String> packagesToOpen) throws Throw
102102
if (modules == null) {
103103
return;
104104
}
105-
final Unsafe unsafe = Unsafe.getUnsafe();
105+
final Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
106+
unsafeField.setAccessible(true);
107+
final Unsafe unsafe = (Unsafe) unsafeField.get(null);
106108
final Field implLookupField = MethodHandles.Lookup.class.getDeclaredField("IMPL_LOOKUP");
107109
final MethodHandles.Lookup lookup = (MethodHandles.Lookup) unsafe.getObject(
108110
unsafe.staticFieldBase(implLookupField),

‎plugin-gradle/CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
* (Second try) `googleJavaFormat` and `removeUnusedImports` works on JDK16+ without jvm args workaround. ([#1228](https://github.com/diffplug/spotless/pull/1228))
8+
* If you have a bunch of `--add-exports` calls in your `org.gradle.jvmargs` property in `gradle.properties`, you should be able to remove them. (fixes [#834](https://github.com/diffplug/spotless/issues/834#issuecomment-819118761))
69

710
## [6.7.0] - 2022-06-05
811
### Added

‎plugin-maven/CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
* (Second try) `googleJavaFormat` and `removeUnusedImports` works on JDK16+ without jvm args workaround. ([#1228](https://github.com/diffplug/spotless/pull/1228))
8+
* If you have a bunch of `--add-exports` calls in `MAVEN_OPTS` or `.mvn/jvm.config`, you should be able to remove them. (fixes [#834](https://github.com/diffplug/spotless/issues/834#issuecomment-817524058))
69

710
## [2.22.6] - 2022-06-05
811
### Fixed

0 commit comments

Comments
 (0)