本文整理汇总了Java中edu.umd.cs.findbugs.ba.XMethodParameter类的典型用法代码示例。如果您正苦于以下问题:Java XMethodParameter类的具体用法?Java XMethodParameter怎么用?Java XMethodParameter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XMethodParameter类属于edu.umd.cs.findbugs.ba包,在下文中一共展示了XMethodParameter类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitParameterAnnotation
import edu.umd.cs.findbugs.ba.XMethodParameter; //导入依赖的package包/类
@Override
public void visitParameterAnnotation(int p, String annotationClass, Map<String, ElementValue> map, boolean runtimeVisible) {
if (database == null) {
return;
}
NullnessAnnotation n = NullnessAnnotation.Parser.parse(annotationClass);
annotationClass = lastPortion(annotationClass);
if (n == null)
return;
XMethod xmethod = XFactory.createXMethod(this);
if (DEBUG) {
System.out.println("Parameter " + p + " @" + annotationClass.substring(annotationClass.lastIndexOf('/') + 1) + " in "
+ xmethod.toString());
}
XMethodParameter xparameter = new XMethodParameter(xmethod, p);
database.addDirectAnnotation(xparameter, n);
}
示例2: getResolvedAnnotation
import edu.umd.cs.findbugs.ba.XMethodParameter; //导入依赖的package包/类
public NullnessAnnotation getResolvedAnnotation(Object o, boolean getMinimal) {
Profiler profiler = Global.getAnalysisCache().getProfiler();
profiler.start(this.getClass());
try {
if (DEBUG) {
System.out.println("getResolvedAnnotation: o=" + o + "...");
}
TypeQualifierAnnotation tqa = null;
if (o instanceof XMethodParameter) {
XMethodParameter param = (XMethodParameter) o;
tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(param.getMethod(),
param.getParameterNumber(), nonnullTypeQualifierValue);
} else if (o instanceof XMethod || o instanceof XField) {
tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation((AnnotatedObject) o,
nonnullTypeQualifierValue);
}
NullnessAnnotation result = toNullnessAnnotation(tqa);
if (DEBUG) {
if (result == null)
System.out.println(" ===> not found");
else
System.out.println(" ===> " + tqa + "/" + result.toString() );
}
return result;
} finally {
profiler.end(this.getClass());
}
}
示例3: getPassedAsNonNullParameter
import edu.umd.cs.findbugs.ba.XMethodParameter; //导入依赖的package包/类
public static PointerUsageRequiringNonNullValue getPassedAsNonNullParameter(final XMethod m, final int param) {
return new PointerUsageRequiringNonNullValue() {
@Override
public @CheckForNull
XMethodParameter getNonNullParameter() {
return new XMethodParameter(m, param);
}
@Override
public String getDescription() {
return "SOURCE_LINE_INVOKED";
}
};
}
示例4: getDirectAnnotation
import edu.umd.cs.findbugs.ba.XMethodParameter; //导入依赖的package包/类
public @CheckForNull NullnessAnnotation getDirectAnnotation(Object o) {
Profiler profiler = Global.getAnalysisCache().getProfiler();
profiler.start(this.getClass());
try {
if (DEBUG) {
System.out.println("getDirectAnnotation: o=" + o + "...");
}
TypeQualifierAnnotation tqa = null;
if (o instanceof XMethodParameter) {
XMethodParameter param = (XMethodParameter) o;
tqa = TypeQualifierApplications.getDirectTypeQualifierAnnotation(param.getMethod(),
param.getParameterNumber(), nonnullTypeQualifierValue);
} else if (o instanceof XMethod || o instanceof XField) {
tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation((AnnotatedObject) o,
nonnullTypeQualifierValue);
}
NullnessAnnotation result = toNullnessAnnotation(tqa);
if (DEBUG) {
if (result == null)
System.out.println(" ===> not found");
else
System.out.println(" ===> " + tqa + "/" + result.toString() );
}
return result;
} finally {
profiler.end(this.getClass());
}
}
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:33,代码来源:TypeQualifierNullnessAnnotationDatabase.java
示例5: initEntryFact
import edu.umd.cs.findbugs.ba.XMethodParameter; //导入依赖的package包/类
public void initEntryFact(IsNullValueFrame result) {
if (cachedEntryFact == null) {
cachedEntryFact = createFact();
cachedEntryFact.setValid();
int numLocals = methodGen.getMaxLocals();
boolean instanceMethod = !methodGen.isStatic();
XMethod xm = XFactory.createXMethod(methodGen.getClassName(), methodGen.getName(), methodGen.getSignature(),
methodGen.isStatic());
INullnessAnnotationDatabase db = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase();
int paramShift = instanceMethod ? 1 : 0;
Type[] argumentTypes = methodGen.getArgumentTypes();
for (int i = 0; i < numLocals; ++i) {
cachedEntryFact.setValue(i, IsNullValue.nonReportingNotNullValue());
}
if (paramShift == 1)
cachedEntryFact.setValue(0, IsNullValue.nonNullValue());
int slot = paramShift;
for (int paramIndex = 0; paramIndex < argumentTypes.length; paramIndex++) {
IsNullValue value;
XMethodParameter methodParameter = new XMethodParameter(xm, paramIndex);
NullnessAnnotation n = db.getResolvedAnnotation(methodParameter, false);
if (n == NullnessAnnotation.CHECK_FOR_NULL)
// Parameter declared @CheckForNull
value = IsNullValue.parameterMarkedAsMightBeNull(methodParameter);
else if (n == NullnessAnnotation.NONNULL)
// Parameter declared @NonNull
// TODO: label this so we don't report defensive programming
value = false ? IsNullValue.nonNullValue() : IsNullValue.parameterMarkedAsNonnull(methodParameter);
else
// Don't know; use default value, normally non-reporting
// nonnull
value = IsNullValue.nonReportingNotNullValue();
cachedEntryFact.setValue(slot, value);
slot += argumentTypes[paramIndex].getSize();
}
}
copy(cachedEntryFact, result);
}
示例6: getNonNullParameter
import edu.umd.cs.findbugs.ba.XMethodParameter; //导入依赖的package包/类
public @CheckForNull
XMethodParameter getNonNullParameter() {
return null;
}
示例7: parameterMarkedAsMightBeNull
import edu.umd.cs.findbugs.ba.XMethodParameter; //导入依赖的package包/类
/**
* Get instance representing a parameter marked as MightBeNull
*/
public static IsNullValue parameterMarkedAsMightBeNull(XMethodParameter mp) {
return instanceByFlagsList[PARAM >> FLAG_SHIFT][NSP];
}
示例8: parameterMarkedAsNonnull
import edu.umd.cs.findbugs.ba.XMethodParameter; //导入依赖的package包/类
/**
* Get instance representing a parameter marked as Nonnull
*/
public static IsNullValue parameterMarkedAsNonnull(XMethodParameter mp) {
return instanceByFlagsList[PARAM >> FLAG_SHIFT][NN];
}
示例9: visitSyntheticParameterAnnotation
import edu.umd.cs.findbugs.ba.XMethodParameter; //导入依赖的package包/类
@Override
public void visitSyntheticParameterAnnotation(int p, boolean runtimeVisible) {
if (database == null) {
return;
}
XMethod xmethod = XFactory.createXMethod(this);
XMethodParameter xparameter = new XMethodParameter(xmethod, p);
database.addDirectAnnotation(xparameter, NullnessAnnotation.UNKNOWN_NULLNESS);
}