Skip to content

Commit

Permalink
only doOpenInternalPackagesIfRequired when GoogleJavaFormatStep is re…
Browse files Browse the repository at this point in the history
…levant

Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Jun 2, 2022
1 parent 7474c25 commit 2631a3f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 0 additions & 3 deletions lib/src/main/java/com/diffplug/spotless/Jvm.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public final class Jvm {
if (VERSION <= 8) {
throw new IllegalArgumentException("Expected " + jre + " to start with an integer greater than 8");
}
if (VERSION >= 16) {
ModuleHelper.doOpenInternalPackagesIfRequired();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ static final class State implements Serializable {

State(String stepName, String groupArtifact, String version, String style, Provisioner provisioner, boolean reflowLongStrings) throws Exception {
JVM_SUPPORT.assertFormatterSupported(version);
ModuleHelper.doOpenInternalPackagesIfRequired();
this.jarState = JarState.from(groupArtifact + ":" + version, provisioner);
this.stepName = stepName;
this.version = version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.diffplug.spotless;
package com.diffplug.spotless.java;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
Expand All @@ -31,7 +31,10 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import sun.misc.Unsafe;

public final class ModuleHelper {
final class ModuleHelper {
// prevent direct instantiation
private ModuleHelper() {}

private static final Map<String, String> REQUIRED_PACKAGES_TO_TEST_CLASSES = new HashMap<>();

static {
Expand Down

0 comments on commit 2631a3f

Please sign in to comment.