提交 acc55190 编写于 作者: J Jesse Glick

findByClassName should not be advertised to outside code.

(cherry picked from commit 8dd079a8)
上级 9079eb80
......@@ -944,11 +944,10 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
}
/**
* Finds a descriptor from a collection by its class name.
* @deprecated Since we introduced {@link Descriptor#getId()}, it is a preferred method of identifying descriptor by a string.
* @since TODO
* Finds a descriptor from a collection by the class name of the {@link Descriptor}.
* This is useless as of the introduction of {@link #getId} and so only very old compatibility code needs it.
*/
public static @CheckForNull <T extends Descriptor> T findByClassName(Collection<? extends T> list, String className) {
private static @CheckForNull <T extends Descriptor> T findByClassName(Collection<? extends T> list, String className) {
for (T d : list) {
if(d.getClass().getName().equals(className))
return d;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册