本文整理汇总了Java中edu.umd.cs.findbugs.util.Util.nullSafeEquals方法的典型用法代码示例。如果您正苦于以下问题:Java Util.nullSafeEquals方法的具体用法?Java Util.nullSafeEquals怎么用?Java Util.nullSafeEquals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.umd.cs.findbugs.util.Util
的用法示例。
在下文中一共展示了Util.nullSafeEquals方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAnnotationWithRole
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
/** Get the first bug annotation with the specified class and role; return null if no
* such annotation exists;
* @param role
* @return
*/
public @CheckForNull <A extends BugAnnotation> A getAnnotationWithRole(Class<A> c, String role) {
for(BugAnnotation a : annotationList) {
if (c.isInstance(a) && Util.nullSafeEquals(role, a.getDescription()))
return c.cast(a);
}
return null;
}
示例2: equals
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
@Override
public boolean equals(Object o) {
if (!(o instanceof Item))
return false;
Item that = (Item) o;
return Util.nullSafeEquals(this.signature, that.signature) && Util.nullSafeEquals(this.constValue, that.constValue)
&& Util.nullSafeEquals(this.source, that.source) && Util.nullSafeEquals(this.userValue, that.userValue)
&& Util.nullSafeEquals(this.injection, that.injection) && this.specialKind == that.specialKind
&& this.registerNumber == that.registerNumber && this.flags == that.flags
&& this.fieldLoadedFromRegister == that.fieldLoadedFromRegister;
}
示例3: equals
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
@Override
public boolean equals(Object o) {
if (!(o instanceof GenericObjectType))
return false;
if (!super.equals(o))
return false;
GenericObjectType that = (GenericObjectType) o;
return Util.nullSafeEquals(this.parameters, that.parameters) && Util.nullSafeEquals(this.variable, that.variable)
&& Util.nullSafeEquals(this.extension, that.extension);
}
示例4: equals
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
@Override
public boolean equals(Object o) {
if (!(o instanceof TypeQualifierValue))
return false;
TypeQualifierValue other = (TypeQualifierValue) o;
return typeQualifier.equals(other.typeQualifier) && Util.nullSafeEquals(value, other.value);
}
示例5: equals
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
@Override
public boolean equals(Object o) {
if (!(o instanceof IsNullConditionDecision))
return false;
IsNullConditionDecision other = (IsNullConditionDecision) o;
return Util.nullSafeEquals(value, other.value) && Util.nullSafeEquals(ifcmpDecision, other.ifcmpDecision)
&& Util.nullSafeEquals(fallThroughDecision, other.fallThroughDecision);
}
示例6: sameAs
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
@Override
public boolean sameAs(Frame<IsNullValue> other) {
if (!(other instanceof IsNullValueFrame))
return false;
if (!super.sameAs(other))
return false;
IsNullValueFrame o2 = (IsNullValueFrame) other;
if (!Util.nullSafeEquals(decision, o2.decision))
return false;
if (trackValueNumbers && !Util.nullSafeEquals(knownValueMap, o2.knownValueMap))
return false;
return true;
}
示例7: equals
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
if (obj == null || obj.getClass() != this.getClass()) {
return false;
}
UserPreferences other = (UserPreferences) obj;
return runAtFullBuild == other.runAtFullBuild && recentProjectsList.equals(other.recentProjectsList)
&& detectorEnablementMap.equals(other.detectorEnablementMap) && filterSettings.equals(other.filterSettings)
&& effort.equals(other.effort) && includeFilterFiles.equals(other.includeFilterFiles)
&& excludeFilterFiles.equals(other.excludeFilterFiles) && excludeBugsFiles.equals(other.excludeBugsFiles)
&& customPlugins.equals(other.customPlugins)
&& Util.nullSafeEquals(cloudId, other.cloudId);
}
示例8: equals
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
@Override
public boolean equals(Object o) {
if (o == null || this.getClass() != o.getClass())
return false;
MemberMatcher other = (MemberMatcher) o;
return name.equals(other.name) && Util.nullSafeEquals(signature, other.signature);
}
示例9: equals
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
@Override
public boolean equals(Object o) {
if (!(o instanceof TypeQualifierValue))
return false;
TypeQualifierValue<?> other = (TypeQualifierValue<?>) o;
return typeQualifier.equals(other.typeQualifier) && Util.nullSafeEquals(value, other.value);
}
示例10: merge
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
public static Item merge(Item i1, Item i2) {
if (i1 == null)
return i2;
if (i2 == null)
return i1;
if (i1.equals(i2))
return i1;
Item m = new Item();
m.flags = i1.flags & i2.flags;
m.setCouldBeZero(i1.isCouldBeZero() || i2.isCouldBeZero());
if (i1.pc == i2.pc)
m.pc = i1.pc;
if (Util.nullSafeEquals(i1.signature, i2.signature))
m.signature = i1.signature;
else if (i1.isNull())
m.signature = i2.signature;
else if (i2.isNull())
m.signature = i1.signature;
if (Util.nullSafeEquals(i1.constValue, i2.constValue))
m.constValue = i1.constValue;
if (Util.nullSafeEquals(i1.source, i2.source)) {
m.source = i1.source;
} else if ("".equals(i1.constValue))
m.source = i2.source;
else if ("".equals(i2.constValue))
m.source = i1.source;
if (Util.nullSafeEquals(i1.userValue, i2.userValue))
m.userValue = i1.userValue;
if (i1.registerNumber == i2.registerNumber)
m.registerNumber = i1.registerNumber;
if (i1.fieldLoadedFromRegister == i2.fieldLoadedFromRegister)
m.fieldLoadedFromRegister = i1.fieldLoadedFromRegister;
if (i1.specialKind == SERVLET_REQUEST_TAINTED) {
m.specialKind = SERVLET_REQUEST_TAINTED;
m.injection = i1.injection;
} else if (i2.specialKind == SERVLET_REQUEST_TAINTED) {
m.specialKind = SERVLET_REQUEST_TAINTED;
m.injection = i2.injection;
} else if (i1.specialKind == i2.specialKind)
m.specialKind = i1.specialKind;
else if (i1.specialKind == NASTY_FLOAT_MATH || i2.specialKind == NASTY_FLOAT_MATH)
m.specialKind = NASTY_FLOAT_MATH;
else if (i1.specialKind == FLOAT_MATH || i2.specialKind == FLOAT_MATH)
m.specialKind = FLOAT_MATH;
if (DEBUG)
System.out.println("Merge " + i1 + " and " + i2 + " gives " + m);
return m;
}
示例11: equals
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
@Override
public boolean equals(Object o) {
if (!(o instanceof NameMatch))
return false;
return Util.nullSafeEquals(spec, ((NameMatch) o).spec);
}
示例12: merge
import edu.umd.cs.findbugs.util.Util; //导入方法依赖的package包/类
public static Item merge(Item i1, Item i2) {
if (i1 == null)
return i2;
if (i2 == null)
return i1;
if (i1.equals(i2))
return i1;
Item m = new Item();
if (i1.getSpecialKind() == TYPE_ONLY && i2.getSpecialKind() != TYPE_ONLY)
return i2;
else if (i2.getSpecialKind() == TYPE_ONLY && i1.getSpecialKind() != TYPE_ONLY)
return i1;
m.flags = i1.flags & i2.flags;
m.setCouldBeZero(i1.isCouldBeZero() || i2.isCouldBeZero());
if (i1.pc == i2.pc)
m.pc = i1.pc;
if (Util.nullSafeEquals(i1.signature, i2.signature))
m.signature = i1.signature;
else if (i1.isNull())
m.signature = i2.signature;
else if (i2.isNull())
m.signature = i1.signature;
if (Util.nullSafeEquals(i1.constValue, i2.constValue))
m.constValue = i1.constValue;
if (Util.nullSafeEquals(i1.source, i2.source)) {
m.source = i1.source;
} else if ("".equals(i1.constValue))
m.source = i2.source;
else if ("".equals(i2.constValue))
m.source = i1.source;
if (Util.nullSafeEquals(i1.userValue, i2.userValue))
m.userValue = i1.userValue;
if (i1.registerNumber == i2.registerNumber)
m.registerNumber = i1.registerNumber;
if (i1.fieldLoadedFromRegister == i2.fieldLoadedFromRegister)
m.fieldLoadedFromRegister = i1.fieldLoadedFromRegister;
if (i1.specialKind == SERVLET_REQUEST_TAINTED) {
m.specialKind = SERVLET_REQUEST_TAINTED;
m.injection = i1.injection;
} else if (i2.specialKind == SERVLET_REQUEST_TAINTED) {
m.specialKind = SERVLET_REQUEST_TAINTED;
m.injection = i2.injection;
} else if (i1.specialKind == i2.specialKind)
m.specialKind = i1.specialKind;
else if (i1.specialKind == NASTY_FLOAT_MATH || i2.specialKind == NASTY_FLOAT_MATH)
m.specialKind = NASTY_FLOAT_MATH;
else if (i1.specialKind == FLOAT_MATH || i2.specialKind == FLOAT_MATH)
m.specialKind = FLOAT_MATH;
if (DEBUG)
System.out.println("Merge " + i1 + " and " + i2 + " gives " + m);
return m;
}