diff options
author | cnsun <cnsun@google.com> | 2018-05-30 11:41:14 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-05-30 11:44:18 -0700 |
commit | 5ad445b09283ee80dab22a4ba342cb4a72fedb0e (patch) | |
tree | 28d604a89178ad8c3aee886cca92eff2b117fde1 /src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/AbstractClassEntryState.java | |
parent | 9c53da2386c60646fa96c84235e5a3cc9238030f (diff) |
Resolve all super classes even if we have found missing super classes. This is
necessary. If we stop resolving the super classes, then the checker will
complain that some methods are missign. In fact, these methods exist, but their
class is not resolved due to the existing early-break strategy.
RELNOTES: none
PiperOrigin-RevId: 198594008
Diffstat (limited to 'src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/AbstractClassEntryState.java')
-rw-r--r-- | src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/AbstractClassEntryState.java | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/AbstractClassEntryState.java b/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/AbstractClassEntryState.java index 209bf83fcb..eeb162f3ba 100644 --- a/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/AbstractClassEntryState.java +++ b/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/AbstractClassEntryState.java @@ -13,7 +13,6 @@ // limitations under the License. package com.google.devtools.build.importdeps; -import static com.google.common.base.Preconditions.checkArgument; import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableList; @@ -100,20 +99,15 @@ public abstract class AbstractClassEntryState { public abstract static class IncompleteState extends AbstractClassEntryState { public static IncompleteState create( - ClassInfo classInfo, ImmutableList<String> resolutionFailurePath) { - checkArgument( - !resolutionFailurePath.isEmpty(), - "The resolution path should contain at least one element, the missing ancestor. %s", - resolutionFailurePath); + ClassInfo classInfo, ResolutionFailureChain resolutionFailureChain) { return new AutoValue_AbstractClassEntryState_IncompleteState( - Optional.of(classInfo), resolutionFailurePath); + Optional.of(classInfo), resolutionFailureChain); } - public abstract ImmutableList<String> getResolutionFailurePath(); + public abstract ResolutionFailureChain resolutionFailureChain(); - public String getMissingAncestor() { - ImmutableList<String> path = getResolutionFailurePath(); - return path.get(path.size() - 1); + public ImmutableList<String> missingAncestors() { + return resolutionFailureChain().missingClasses(); } @Override |