Skip to content

Commit

Permalink
Merge pull request #721 from google/moe_writing_branch_from_976d6c56e…
Browse files Browse the repository at this point in the history
…b1fb8b7c0b3b304e7ec2ba62b74955a

Output the full exception trace if ServiceLoader fails when looking for AutoValue extensions.
  • Loading branch information
eamonnmcmanus committed Apr 4, 2019
2 parents 70d7429 + 67e172e commit 1b49c90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.auto.value.extension.AutoValueExtension;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableBiMap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
Expand Down Expand Up @@ -118,7 +119,7 @@ public synchronized void init(ProcessingEnvironment processingEnv) {
if (t instanceof ServiceConfigurationError) {
warning.append(" This may be due to a corrupt jar file in the compiler's classpath.");
}
warning.append(" Exception: ").append(t);
warning.append("\n").append(Throwables.getStackTraceAsString(t));
errorReporter().reportWarning(warning.toString(), null);
extensions = ImmutableList.of();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ private void doTestBadJarDoesntBlowUp(File badJar) throws IOException {
.processedWith(new AutoValueProcessor(badJarLoader))
.compilesWithoutError();
success.withWarningContaining(
"This may be due to a corrupt jar file in the compiler's classpath. Exception: "
"This may be due to a corrupt jar file in the compiler's classpath.\n "
+ ServiceConfigurationError.class.getName());
success
.and()
Expand Down

0 comments on commit 1b49c90

Please sign in to comment.