Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: clarify the contract of get(String) #3045

Merged
merged 6 commits into from
Jul 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/main/java/spoon/reflect/factory/TypeFactory.java
Original file line number Diff line number Diff line change
@@ -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) {