DO NOT MERGE: Merge commit '2f6f6abe4d05282c82dd56fa897949f49ac3cd6c' from oc-support-26.0-dev to stage-aosp-master. am: e15c52f95e -s ours
am: 1cc4f4ec49
Change-Id: I413ffa000d3ef4cb03cfe37355309171e3709c83
diff --git a/src/com/google/doclava/AnnotationInstanceInfo.java b/src/com/google/doclava/AnnotationInstanceInfo.java
index 07ffd9d..d353426 100644
--- a/src/com/google/doclava/AnnotationInstanceInfo.java
+++ b/src/com/google/doclava/AnnotationInstanceInfo.java
@@ -20,7 +20,6 @@
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collection;
public class AnnotationInstanceInfo implements Resolvable {
private ClassInfo mType;
@@ -147,40 +146,19 @@
/**
* Get a new list containing the set of annotations that are shared between
- * the input annotations collection and the set of allowed annotations.
+ * the input annotations collection and the names of annotations passed in
+ * the showAnnotations parameter
*/
- public static ArrayList<AnnotationInstanceInfo> getAnnotationsIntersection(
- Collection<String> allowedAnnotations,
- Collection<? extends AnnotationInstanceInfo> allAnnotations) {
+ public static ArrayList<AnnotationInstanceInfo> getShowAnnotationsIntersection(
+ ArrayList<AnnotationInstanceInfo> annotations) {
ArrayList<AnnotationInstanceInfo> list = new ArrayList<AnnotationInstanceInfo>();
- java.util.Objects.requireNonNull(allowedAnnotations);
- if (allAnnotations != null) {
- for (AnnotationInstanceInfo info : allAnnotations) {
- if (allowedAnnotations.contains(info.type().qualifiedName())) {
+ if (annotations != null) {
+ for (AnnotationInstanceInfo info : annotations) {
+ if (Doclava.showAnnotations.contains(info.type().qualifiedName())) {
list.add(info);
}
}
}
return list;
}
-
- /**
- * Get a new list containing the set of annotations that are shared between
- * the input annotations collection and the names of annotations passed in
- * the showAnnotations parameter
- */
- public static ArrayList<AnnotationInstanceInfo> getShowAnnotationsIntersection(
- Collection<? extends AnnotationInstanceInfo> annotations) {
- return getAnnotationsIntersection(Doclava.showAnnotations, annotations);
- }
-
- /**
- * Get a new list containing the set of annotations that are shared between
- * the input annotations collection and the names of annotations passed in
- * the hideAnnotations parameter
- */
- public static ArrayList<AnnotationInstanceInfo> getHideAnnotationsIntersection(
- Collection<? extends AnnotationInstanceInfo> annotations) {
- return getAnnotationsIntersection(Doclava.hideAnnotations, annotations);
- }
}
diff --git a/src/com/google/doclava/ClassInfo.java b/src/com/google/doclava/ClassInfo.java
index b152508..20addc6 100644
--- a/src/com/google/doclava/ClassInfo.java
+++ b/src/com/google/doclava/ClassInfo.java
@@ -135,7 +135,6 @@
mIsPrimitive = isPrimitive;
mAnnotations = annotations;
mShowAnnotations = AnnotationInstanceInfo.getShowAnnotationsIntersection(annotations);
- mHideAnnotations = AnnotationInstanceInfo.getHideAnnotationsIntersection(annotations);
}
public void init(TypeInfo typeInfo, ArrayList<ClassInfo> interfaces,
@@ -168,7 +167,6 @@
mRealSuperclassType = superclassType;
mAnnotations = annotations;
mShowAnnotations = AnnotationInstanceInfo.getShowAnnotationsIntersection(annotations);
- mHideAnnotations = AnnotationInstanceInfo.getHideAnnotationsIntersection(annotations);
// after providing new methods and new superclass info,clear any cached
// lists of self + superclass methods, ctors, etc.
@@ -1473,8 +1471,8 @@
}
/**
- * @return true if the containing package has @hide comment, a hide annotaion,
- * or a containing class of this class is hidden.
+ * @return true if the containing package has @hide comment, or an ancestor
+ * class of this class is hidden, or this class has @hide comment.
*/
public boolean isHiddenImpl() {
ClassInfo cl = this;
@@ -1486,7 +1484,7 @@
if (pkg != null && pkg.hasHideComment()) {
return true;
}
- if (cl.comment().isHidden() || cl.hasHideAnnotation()) {
+ if (cl.comment().isHidden()) {
return true;
}
cl = cl.containingClass();
@@ -1538,14 +1536,6 @@
return mShowAnnotations;
}
- public boolean hasHideAnnotation() {
- return mHideAnnotations != null && mHideAnnotations.size() > 0;
- }
-
- public ArrayList<AnnotationInstanceInfo> hideAnnotations() {
- return mHideAnnotations;
- }
-
public ArrayList<AnnotationInstanceInfo> getShowAnnotationsIncludeOuters() {
ArrayList<AnnotationInstanceInfo> allAnnotations = new ArrayList<AnnotationInstanceInfo>();
ClassInfo cl = this;
@@ -1833,7 +1823,6 @@
private ClassInfo mSuperclass;
private ArrayList<AnnotationInstanceInfo> mAnnotations;
private ArrayList<AnnotationInstanceInfo> mShowAnnotations;
- private ArrayList<AnnotationInstanceInfo> mHideAnnotations;
private boolean mSuperclassInit;
private boolean mDeprecatedKnown;
diff --git a/src/com/google/doclava/Doclava.java b/src/com/google/doclava/Doclava.java
index 29ef509..6d26d80 100644
--- a/src/com/google/doclava/Doclava.java
+++ b/src/com/google/doclava/Doclava.java
@@ -104,7 +104,6 @@
public static HashSet<String> knownTags = new HashSet<String>();
public static FederationTagger federationTagger = new FederationTagger();
public static Set<String> showAnnotations = new HashSet<String>();
- public static Set<String> hideAnnotations = new HashSet<String>();
public static boolean showAnnotationOverridesVisibility = false;
public static Set<String> hiddenPackages = new HashSet<String>();
public static boolean includeAssets = true;
@@ -252,8 +251,6 @@
keepListFile = a[1];
} else if (a[0].equals("-showAnnotation")) {
showAnnotations.add(a[1]);
- } else if (a[0].equals("-hideAnnotation")) {
- hideAnnotations.add(a[1]);
} else if (a[0].equals("-showAnnotationOverridesVisibility")) {
showAnnotationOverridesVisibility = true;
} else if (a[0].equals("-hidePackage")) {
diff --git a/src/com/google/doclava/MemberInfo.java b/src/com/google/doclava/MemberInfo.java
index 8c88648..6c5aad3 100644
--- a/src/com/google/doclava/MemberInfo.java
+++ b/src/com/google/doclava/MemberInfo.java
@@ -39,7 +39,6 @@
mKind = kind;
mAnnotations = annotations;
mShowAnnotations = AnnotationInstanceInfo.getShowAnnotationsIntersection(annotations);
- mHideAnnotations = AnnotationInstanceInfo.getHideAnnotationsIntersection(annotations);
}
public abstract boolean isExecutable();
@@ -49,7 +48,7 @@
if (mShowAnnotations.size() > 0) {
return false;
}
- return super.isHidden() || mHideAnnotations.size() > 0;
+ return super.isHidden();
}
@Override
@@ -178,10 +177,6 @@
return mShowAnnotations;
}
- public ArrayList<AnnotationInstanceInfo> hideAnnotations() {
- return mHideAnnotations;
- }
-
ClassInfo mContainingClass;
ClassInfo mRealContainingClass;
String mName;
@@ -196,6 +191,5 @@
String mKind;
private ArrayList<AnnotationInstanceInfo> mAnnotations;
private ArrayList<AnnotationInstanceInfo> mShowAnnotations;
- private ArrayList<AnnotationInstanceInfo> mHideAnnotations;
}