From fe9ac58af1dc3ada5d27e66153d7d657880ec922 Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Tue, 28 Oct 2014 17:23:47 +0200 Subject: [PATCH] Disable importedClasses deprecation warning In our case an attempt to get the imported classes is justified. Although they are an implementation detail, we document the implementation. --- src/main/java/org/umlgraph/doclet/ClassGraph.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/umlgraph/doclet/ClassGraph.java b/src/main/java/org/umlgraph/doclet/ClassGraph.java index f96cbcc..12f90ce 100644 --- a/src/main/java/org/umlgraph/doclet/ClassGraph.java +++ b/src/main/java/org/umlgraph/doclet/ClassGraph.java @@ -860,7 +860,16 @@ class ClassGraph { printInferredDependencies(c); } } - + + /** Returns an array representing the imported classes of c. + * Disables the deprecation warning, which is output, because the + * imported classed are an implementation detail. + */ + @SuppressWarnings( "deprecation" ) + ClassDoc[] importedClasses(ClassDoc c) { + return c.importedClasses(); + } + /** * Prints dependencies recovered from the methods of a class. A * dependency is inferred only if another relation between the two @@ -898,11 +907,11 @@ class ClassGraph { if(tv.bounds().length > 0 ) types.addAll(Arrays.asList(tv.bounds())); } - + // and finally check for explicitly imported classes (this // assumes there are no unused imports...) if (opt.useImports) - types.addAll(Arrays.asList(c.importedClasses())); + types.addAll(Arrays.asList(importedClasses(c))); // compute dependencies for (Type type : types) {