diff options
-rw-r--r-- | src/com/google/doclava/Converter.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/com/google/doclava/Converter.java b/src/com/google/doclava/Converter.java index 3153b41..555fc39 100644 --- a/src/com/google/doclava/Converter.java +++ b/src/com/google/doclava/Converter.java @@ -439,9 +439,23 @@ public class Converter { return result; } else { ConstructorDoc m = (ConstructorDoc) o; + // Workaround for a JavaDoc behavior change introduced in OpenJDK 8 that breaks + // links in documentation and the content of API files like current.txt. + // http://b/18051133. + String name = m.name(); + ClassDoc containingClass = m.containingClass(); + if (containingClass.containingClass() != null) { + // This should detect the new behavior and be bypassed otherwise. + if (!name.contains(".")) { + // Constructors of inner classes do not contain the name of the enclosing class + // with OpenJDK 8. This simulates the old behavior: + name = containingClass.name(); + } + } + // End of workaround. MethodInfo result = - new MethodInfo(m.getRawCommentText(), new ArrayList<TypeInfo>(Arrays.asList(Converter.convertTypes(m.typeParameters()))), m - .name(), m.signature(), Converter.obtainClass(m.containingClass()), Converter + new MethodInfo(m.getRawCommentText(), new ArrayList<TypeInfo>(Arrays.asList(Converter.convertTypes(m.typeParameters()))), + name, m.signature(), Converter.obtainClass(m.containingClass()), Converter .obtainClass(m.containingClass()), m.isPublic(), m.isProtected(), m .isPackagePrivate(), m.isPrivate(), m.isFinal(), m.isStatic(), m.isSynthetic(), false, m.isSynchronized(), m.isNative(), false, "constructor", m.flatSignature(), |