Skip to content

Commit

Permalink
doc: clarify the contract of get(String) (INRIA#3045)
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus authored and nharrand committed Jul 12, 2019
1 parent 03f2e60 commit ee0c74c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/spoon/reflect/factory/TypeFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,13 @@ public <T> CtTypeReference<T> createReference(String qualifiedName) {
}

/**
* Gets a created type from its qualified name.
* Gets a created type from its qualified name if source in the source classpath.
*
* @return a found type or null if does not exist
* `TypeFactory#get(String)` returns null if the class is not in the source classpath (even if it is in the binary classpath).
* `TypeFactory#get(Class)` returns null if the class is neither in the source classpath nor in the binary classpath,
* and returns a [shadow class](http://spoon.gforge.inria.fr/reflection.html) if it is only in the binary classpath.
* Note that a shadow class has empty method bodies, if you need a shadow class with method bodies, see [spoon-decompiler](https://github.com/INRIA/spoon/tree/master/spoon-decompiler))
* @return a type if source in the source classpath or null if does not exist
*/
@SuppressWarnings("unchecked")
public <T> CtType<T> get(final String qualifiedName) {
Expand Down

0 comments on commit ee0c74c

Please sign in to comment.