145 } else if (utils.isRecord(typeElement)) {
146 addTypeElement(typeElement, records);
147 } else if (utils.isAnnotationType(typeElement)) {
148 addTypeElement(typeElement, annotationTypes);
149 } else if (utils.isError(typeElement)) {
150 addTypeElement(typeElement, errors);
151 } else if (utils.isInterface(typeElement)) {
152 addTypeElement(typeElement, interfaces);
153 }
154 }
155
156 /**
157 * Add the given class to the given map.
158 *
159 * @param typeElement the class to add to the catalog.
160 * @param map the Map to add the TypeElement to.
161 */
162 private void addTypeElement(TypeElement typeElement, Map<PackageElement, SortedSet<TypeElement>> map) {
163
164 PackageElement pkg = utils.containingPackage(typeElement);
165 if (utils.isSpecified(pkg) || configuration.nodeprecated && utils.isDeprecated(pkg)) {
166 // No need to catalog this class if it's package is
167 // specified on the command line or if -nodeprecated option is set
168 return;
169 }
170
171 SortedSet<TypeElement> s = map.get(pkg);
172 if (s == null) {
173 packageSet.add(pkg);
174 s = new TreeSet<>(comparator);
175 }
176 s.add(typeElement);
177 map.put(pkg, s);
178
179 }
180
181 private SortedSet<TypeElement> getSet(Map<PackageElement, SortedSet<TypeElement>> m, PackageElement key) {
182 SortedSet<TypeElement> s = m.get(key);
183 if (s != null) {
184 return s;
185 }
|
145 } else if (utils.isRecord(typeElement)) {
146 addTypeElement(typeElement, records);
147 } else if (utils.isAnnotationType(typeElement)) {
148 addTypeElement(typeElement, annotationTypes);
149 } else if (utils.isError(typeElement)) {
150 addTypeElement(typeElement, errors);
151 } else if (utils.isInterface(typeElement)) {
152 addTypeElement(typeElement, interfaces);
153 }
154 }
155
156 /**
157 * Add the given class to the given map.
158 *
159 * @param typeElement the class to add to the catalog.
160 * @param map the Map to add the TypeElement to.
161 */
162 private void addTypeElement(TypeElement typeElement, Map<PackageElement, SortedSet<TypeElement>> map) {
163
164 PackageElement pkg = utils.containingPackage(typeElement);
165 if (utils.isSpecified(pkg) || configuration.getOptions().noDeprecated && utils.isDeprecated(pkg)) {
166 // No need to catalog this class if it's package is
167 // specified on the command line or if -nodeprecated option is set
168 return;
169 }
170
171 SortedSet<TypeElement> s = map.get(pkg);
172 if (s == null) {
173 packageSet.add(pkg);
174 s = new TreeSet<>(comparator);
175 }
176 s.add(typeElement);
177 map.put(pkg, s);
178
179 }
180
181 private SortedSet<TypeElement> getSet(Map<PackageElement, SortedSet<TypeElement>> m, PackageElement key) {
182 SortedSet<TypeElement> s = m.get(key);
183 if (s != null) {
184 return s;
185 }
|