Skip to content

Commit

Permalink
No-op refactor after unknown commit
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 624300376
  • Loading branch information
cushon authored and Javac Team committed Apr 12, 2024
1 parent ff491a5 commit 5637a07
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions java/com/google/turbine/main/Main.java
Expand Up @@ -83,7 +83,7 @@ public final class Main {
static final Attributes.Name TARGET_LABEL = new Attributes.Name("Target-Label");
static final Attributes.Name INJECTING_RULE_KIND = new Attributes.Name("Injecting-Rule-Kind");

public static void main(String[] args) throws IOException {
public static void main(String[] args) {
boolean ok;
try {
compile(args);
Expand Down Expand Up @@ -218,7 +218,7 @@ public static Result compile(TurbineOptions options) throws IOException {
}
}
if (options.output().isPresent()) {
Map<String, byte[]> transitive = Transitive.collectDeps(bootclasspath, bound);
ImmutableMap<String, byte[]> transitive = Transitive.collectDeps(bootclasspath, bound);
writeOutput(options, bound.generatedClasses(), lowered.bytes(), transitive);
}
if (options.outputManifest().isPresent()) {
Expand Down Expand Up @@ -301,16 +301,7 @@ private static ClassPath bootclasspath(TurbineOptions options) throws IOExceptio
}

if (release.isPresent()) {
// Search ct.sym for a matching release
ClassPath bootclasspath = CtSymClassBinder.bind(release.getAsInt());
if (bootclasspath != null) {
return bootclasspath;
} else if (release.getAsInt() == Integer.parseInt(JAVA_SPECIFICATION_VERSION.value())) {
// if --release matches the host JDK, use its jimage instead of ct.sym
return JimageClassBinder.bindDefault();
} else {
throw new UsageException("not a supported release: " + release);
}
return release(release.getAsInt());
}

if (options.system().isPresent()) {
Expand All @@ -322,6 +313,19 @@ private static ClassPath bootclasspath(TurbineOptions options) throws IOExceptio
return ClassPathBinder.bindClasspath(toPaths(options.bootClassPath()));
}

private static ClassPath release(int release) throws IOException {
// Search ct.sym for a matching release
ClassPath bootclasspath = CtSymClassBinder.bind(release);
if (bootclasspath != null) {
return bootclasspath;
}
if (release == Integer.parseInt(JAVA_SPECIFICATION_VERSION.value())) {
// if --release matches the host JDK, use its jimage
return JimageClassBinder.bindDefault();
}
throw new UsageException("not a supported release: " + release);
}

/** Parse all source files and source jars. */
// TODO(cushon): parallelize
private static ImmutableList<CompUnit> parseAll(TurbineOptions options) throws IOException {
Expand Down

0 comments on commit 5637a07

Please sign in to comment.