本文整理了Java中edu.umd.cs.findbugs.annotations.NonNull
类的一些代码示例,展示了NonNull
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NonNull
类的具体详情如下:
包路径:edu.umd.cs.findbugs.annotations.NonNull
类名称:NonNull
暂无
代码示例来源:origin: jenkinsci/jenkins
/**
* Creates a new LocalPluginManager
* @param rootDir Jenkins home directory.
*/
public LocalPluginManager(@NonNull File rootDir) {
this(null, rootDir);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Creates a new LocalPluginManager
* @param context Servlet context. Provided for compatibility as {@code Jenkins.getInstance().servletContext} should be used.
* @param rootDir Jenkins home directory.
*/
public LocalPluginManager(@CheckForNull ServletContext context, @NonNull File rootDir) {
super(context, new File(rootDir,"plugins"));
}
代码示例来源:origin: spotbugs/spotbugs
void foo(@CheckForNull Object o) {
@NonNull
Object l = o;
}
}
代码示例来源:origin: jenkinsci/jenkins
abstract @NonNull PluginManager doCreate(@NonNull Class<? extends PluginManager> klass,
@NonNull Jenkins jenkins) throws ReflectiveOperationException;
}
代码示例来源:origin: spotbugs/spotbugs
@Override
public void f(@NonNull Object obj, @CheckForNull Object obj2);
}
代码示例来源:origin: jenkinsci/jenkins
@Override
@NonNull PluginManager doCreate(@NonNull Class<? extends PluginManager> klass,
@NonNull Jenkins jenkins) throws ReflectiveOperationException {
return klass.getConstructor(Jenkins.class).newInstance(jenkins);
}
},
代码示例来源:origin: spotbugs/spotbugs
@NonNull
T set2(@CheckForNull T o);
}
代码示例来源:origin: apache/hbase
/**
* Extract a Cell.
* @return a parsed Cell or throws an Exception. EOFException or a generic IOException maybe
* thrown if EOF is reached prematurely. Does not return null.
* @throws IOException
*/
@NonNull
protected abstract Cell parseCell() throws IOException;
代码示例来源:origin: spotbugs/spotbugs
public class TestFieldAnnotations {
@NonNull
Object x;
@CheckForNull
Object y;
代码示例来源:origin: jenkinsci/jenkins
@Override
@NonNull PluginManager doCreate(@NonNull Class<? extends PluginManager> klass,
@NonNull Jenkins jenkins) throws ReflectiveOperationException {
return klass.getConstructor(ServletContext.class, File.class).newInstance(jenkins.servletContext, jenkins.getRootDir());
}
},
代码示例来源:origin: spotbugs/spotbugs
@Override
@CheckForNull
@ExpectWarning("NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION,NP_METHOD_RETURN_RELAXING_ANNOTATION")
public Integer set2(@NonNull Integer o){
return null;
}
}
代码示例来源:origin: spotbugs/spotbugs
/**
* the only difference with Works.bar() is that the parameter is
* annotated as NonNull
*/
public void foo(@NonNull Object o) {
}
}
代码示例来源:origin: spotbugs/spotbugs
@Override
@CheckForNull
@ExpectWarning("NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION,NP_METHOD_RETURN_RELAXING_ANNOTATION")
public Integer set2(@NonNull Integer o){
return null;
}
}
代码示例来源:origin: spotbugs/spotbugs
@NonNull
public static String nonNullLoop(String[] args) {
String ret = null;
for (String s : args) {
ret = s;
}
return ret; // no warning reported here
}
代码示例来源:origin: org.jenkins-ci.plugins/credentials
/**
* Constructs an instance that matches the specified java bean property against the supplied value.
*
* @param name the property name.
* @param expected the expected value.
*/
public BeanPropertyMatcher(@NonNull String name, @CheckForNull T expected) {
this.name = name;
this.expected = expected;
}
代码示例来源:origin: spotbugs/spotbugs
@NonNull
Object bar() {
return null;
}
}
代码示例来源:origin: org.jenkins-ci.plugins/credentials
/**
* Our constructor.
*
* @param divId id of the {@literal <input>} element on the {@code window.opener} of the
* pop-up to inject the uploaded content into.
* @param uploadedKeystore the content.
*/
public Upload(@NonNull String divId, @CheckForNull SecretBytes uploadedKeystore) {
this.divId = divId;
this.uploadedKeystore = uploadedKeystore;
}
代码示例来源:origin: spotbugs/spotbugs
void foo(Object o) {
@NonNull
Object l = o;
}
}
代码示例来源:origin: org.jenkins-ci.plugins/git
/**
* Configures the {@link GitTool#getName()} to use.
*
* @param gitTool the {@link GitTool#getName()} or {@code null} to use the system default.
* @return {@code this} for method chaining.
*/
@SuppressWarnings("unchecked")
@NonNull
public final B withGitTool(@CheckForNull String gitTool) {
this.gitTool = gitTool;
return (B) this;
}
代码示例来源:origin: jenkinsci/jenkins
@Override
@NonNull PluginManager doCreate(@NonNull Class<? extends PluginManager> klass,
@NonNull Jenkins jenkins) throws ReflectiveOperationException {
return klass.getConstructor(File.class).newInstance(jenkins.getRootDir());
}
};
内容来源于网络,如有侵权,请联系作者删除!