From 35e0d1defab101925cdbe1490050989f2b813ac1 Mon Sep 17 00:00:00 2001 From: Julian Odell Date: Wed, 28 Sep 2016 13:55:45 -0700 Subject: Fix collisions due to ignoring outer class names. Second attempt - this time strip the type parameters from the class name but keep the qualified token name (which will include both Outer and Inner class names so OuterClass1.InnerClass will become OuterClass1.InnerClass rather than just InnerClass). See b/31775016. Change-Id: Ib2465cc33006e086ab66a6e8e307e98ff1dc37e5 (cherry picked from commit cbc19f92af1b7cef2c2b2d1d3c2cdd12ce27b290) --- src/com/google/doclava/apicheck/ApiFile.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/google/doclava/apicheck/ApiFile.java b/src/com/google/doclava/apicheck/ApiFile.java index d865e20..14a8ab3 100644 --- a/src/com/google/doclava/apicheck/ApiFile.java +++ b/src/com/google/doclava/apicheck/ApiFile.java @@ -166,11 +166,13 @@ class ApiFile { name = token; qname = qualifiedName(pkg.name(), name, null); final TypeInfo typeInfo = Converter.obtainTypeFromString(qname); + // Simple type info excludes the package name (but includes enclosing class names) + final TypeInfo simpleTypeInfo = Converter.obtainTypeFromString(name); token = tokenizer.requireToken(); - cl = new ClassInfo(null/*classDoc*/, ""/*rawCommentText*/, tokenizer.pos(), pub, prot, - pkgpriv, false/*isPrivate*/, stat, iface, abs, true/*isOrdinaryClass*/, + cl = new ClassInfo(null/*classDoc*/, ""/*rawCommentText*/, tokenizer.pos(), pub, prot, + pkgpriv, false/*isPrivate*/, stat, iface, abs, true/*isOrdinaryClass*/, false/*isException*/, false/*isError*/, false/*isEnum*/, false/*isAnnotation*/, - fin, false/*isIncluded*/, typeInfo.simpleTypeName(), typeInfo.qualifiedTypeName(), + fin, false/*isIncluded*/, simpleTypeInfo.qualifiedTypeName(), typeInfo.qualifiedTypeName(), null/*qualifiedTypeName*/, false/*isPrimitive*/); cl.setTypeInfo(typeInfo); cl.setDeprecated(dep); @@ -755,4 +757,3 @@ class ApiFile { return true; } } - -- cgit v1.2.3