Skip to content

Commit

Permalink
Revert using bootstrapping formatter for Java 15 (#582)
Browse files Browse the repository at this point in the history
Revert using bootstrapping formatter for Java 15
  • Loading branch information
fawind authored Nov 18, 2021
1 parent 310147a commit 243536a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-582.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Revert using bootstrapping formatter for Java 15
links:
- https://github.com/palantir/palantir-java-format/pull/582
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.intellij.openapi.projectRoots.JdkUtil;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.ProjectRootManager;
import com.palantir.javaformat.bootstrap.BootstrappingFormatterService;
import com.palantir.javaformat.java.FormatterService;
import com.palantir.logsafe.Preconditions;
import java.io.IOException;
Expand Down Expand Up @@ -63,12 +62,14 @@ private static FormatterService createFormatter(FormatterCacheKey cacheKey) {
List<Path> implementationClasspath =
getImplementationUrls(cacheKey.implementationClassPath, cacheKey.useBundledImplementation);

// TODO(fwindheuser): Temporarily disable the bootstrapping formatter to debug it crashing intellij on
// certain files
// Enable the bootstrapping formatter for projects using Java 15+ as they might use new language features.
if (jdkMajorVersion >= 15) {
Path jdkPath = getJdkPath(cacheKey.project);
log.info("Using bootstrapping formatter with jdk version {} and path: {}", jdkMajorVersion, jdkPath);
return new BootstrappingFormatterService(jdkPath, jdkMajorVersion, implementationClasspath);
}
// if (jdkMajorVersion >= 15) {
// Path jdkPath = getJdkPath(cacheKey.project);
// log.info("Using bootstrapping formatter with jdk version {} and path: {}", jdkMajorVersion, jdkPath);
// return new BootstrappingFormatterService(jdkPath, jdkMajorVersion, implementationClasspath);
// }

// Use "in-process" formatter service
log.info("Using in-process formatter for jdk version {}", jdkMajorVersion);
Expand Down

0 comments on commit 243536a

Please sign in to comment.