diff options
author | Colin Cross <ccross@android.com> | 2019-01-30 12:51:47 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-01-30 12:51:47 -0800 |
commit | d36ff02156afd0f0c566af816566fab9f8f9fa5f (patch) | |
tree | 1341c1adbe2adae484c8f3018179457ca5a39a6c /java/com/google/turbine/main/Main.java | |
parent | 6c76159f8d28222e7fbfff5f8087b9b23fc0c61a (diff) | |
parent | 148c58934f1913b9d6ae300ddb3d6b58879b926c (diff) | |
download | turbine-d36ff02156afd0f0c566af816566fab9f8f9fa5f.tar.gz |
Merge remote-tracking branch 'aosp/upstream-master' into master am: a8a207a9f1
am: 148c58934f
Change-Id: Id6bab544479a2a6672c9d80cdd4258f8a1ba6baf
Diffstat (limited to 'java/com/google/turbine/main/Main.java')
-rw-r--r-- | java/com/google/turbine/main/Main.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/com/google/turbine/main/Main.java b/java/com/google/turbine/main/Main.java index 03a68ce..34421e1 100644 --- a/java/com/google/turbine/main/Main.java +++ b/java/com/google/turbine/main/Main.java @@ -16,10 +16,12 @@ package com.google.turbine.main; +import static com.google.common.base.StandardSystemProperty.JAVA_SPECIFICATION_VERSION; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.collect.ImmutableList; import com.google.common.hash.Hashing; +import com.google.common.io.MoreFiles; import com.google.turbine.binder.Binder; import com.google.turbine.binder.Binder.BindingResult; import com.google.turbine.binder.ClassPath; @@ -145,7 +147,7 @@ public class Main { if (options.release().isPresent()) { String release = options.release().get(); - if (release.equals(System.getProperty("java.specification.version"))) { + if (release.equals(JAVA_SPECIFICATION_VERSION.value())) { // if --release matches the host JDK, use its jimage instead of ct.sym return JimageClassBinder.bindDefault(); } @@ -172,7 +174,7 @@ public class Main { ImmutableList.Builder<CompUnit> units = ImmutableList.builder(); for (String source : options.sources()) { Path path = Paths.get(source); - units.add(Parser.parse(new SourceFile(source, new String(Files.readAllBytes(path), UTF_8)))); + units.add(Parser.parse(new SourceFile(source, MoreFiles.asCharSource(path, UTF_8).read()))); } for (String sourceJar : options.sourceJars()) { for (Zip.Entry ze : new Zip.ZipIterable(Paths.get(sourceJar))) { |