Correctly stub classes with hidden constructors
If a class had no publicly-visible constructors, and the
super constructor had a throws clause, no call to a super
constructor would be generated. If there was no default
super constructor, this would cause a build failure.
Fixed by just allowing the super call even though the throws
are not exposed.
Bug: 67777702
Test: Stubs that failed to build now build.
Change-Id: I7d1126daefee097091ec7c96d9b85694db7f2f8f
Merged-In: I7d1126daefee097091ec7c96d9b85694db7f2f8f
diff --git a/src/com/google/doclava/Stubs.java b/src/com/google/doclava/Stubs.java
index 28c6892..930d52c 100644
--- a/src/com/google/doclava/Stubs.java
+++ b/src/com/google/doclava/Stubs.java
@@ -1003,7 +1003,7 @@
if (canCallMethod(cl, m)) {
if (m.thrownExceptions() != null) {
for (ClassInfo thrown : m.thrownExceptions()) {
- if (!exceptionNames.contains(thrown.name())) {
+ if (thrownExceptions != null && !exceptionNames.contains(thrown.name())) {
badException = true;
}
}