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.
This commit is contained in:
Diomidis Spinellis 2014-10-28 17:23:47 +02:00
parent a8b1f1ff46
commit fe9ac58af1
1 changed files with 12 additions and 3 deletions

View File

@ -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) {