當前位置: 首頁>>代碼示例>>Java>>正文


Java Util.nullSafeEquals方法代碼示例

本文整理匯總了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;

}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:14,代碼來源:BugInstance.java

示例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;

}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:14,代碼來源:OpcodeStack.java

示例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);
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:11,代碼來源:GenericObjectType.java

示例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);
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:8,代碼來源:TypeQualifierValue.java

示例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);
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:9,代碼來源:IsNullConditionDecision.java

示例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;
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:15,代碼來源:IsNullValueFrame.java

示例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);
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:16,代碼來源:UserPreferences.java

示例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);
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:9,代碼來源:MemberMatcher.java

示例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);
}
 
開發者ID:OpenNTF,項目名稱:FindBug-for-Domino-Designer,代碼行數:8,代碼來源:TypeQualifierValue.java

示例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;
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:52,代碼來源:OpcodeStack.java

示例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);
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:7,代碼來源:NameMatch.java

示例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;
}
 
開發者ID:OpenNTF,項目名稱:FindBug-for-Domino-Designer,代碼行數:56,代碼來源:OpcodeStack.java


注:本文中的edu.umd.cs.findbugs.util.Util.nullSafeEquals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。