gpt4 book ai didi

edu.umd.cs.findbugs.ba.XField.isVolatile()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 17:04:40 28 4
gpt4 key购买 nike

本文整理了Java中edu.umd.cs.findbugs.ba.XField.isVolatile()方法的一些代码示例,展示了XField.isVolatile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XField.isVolatile()方法的具体详情如下:
包路径:edu.umd.cs.findbugs.ba.XField
类名称:XField
方法名:isVolatile

XField.isVolatile介绍

[英]Is this a volatile field?
[中]这是一个不稳定的领域吗?

代码示例

代码示例来源:origin: spotbugs/spotbugs

private boolean isVolatile(XField f) {
  return f != null && f.isVolatile();
}

代码示例来源:origin: spotbugs/spotbugs

public OpcodeStack.Item getSummary(XField field) {
  if (field == null) {
    return new OpcodeStack.Item();
  }
  OpcodeStack.Item result = summary.get(field);
  if (result == null || field.isVolatile()) {
    String signature = field.getSignature();
    return new OpcodeStack.Item(signature);
  }
  return result;
}

代码示例来源:origin: spotbugs/spotbugs

public void killAllLoads(boolean primitiveOnly) {
  if (!REDUNDANT_LOAD_ELIMINATION) {
    return;
  }
  FieldSummary fieldSummary = AnalysisContext.currentAnalysisContext().getFieldSummary();
  HashSet<AvailableLoad> killMe = new HashSet<>();
  for (AvailableLoad availableLoad : getAvailableLoadMap().keySet()) {
    XField field = availableLoad.getField();
    if ((!primitiveOnly || !field.isReferenceType()) && (field.isVolatile() || !field.isFinal()
        && (!USE_WRITTEN_OUTSIDE_OF_CONSTRUCTOR || fieldSummary.isWrittenOutsideOfConstructor(field)))) {
      if (RLE_DEBUG) {
        System.out.println("KILLING load of " + availableLoad + " in " + this);
      }
      killMe.add(availableLoad);
    }
  }
  killAvailableLoads(killMe);
}

代码示例来源:origin: spotbugs/spotbugs

if (xfield.isVolatile()) {
  getFrame().killAllLoads();

代码示例来源:origin: spotbugs/spotbugs

private boolean interesting(XField f) {
  if (!f.isPublic() && !f.isProtected()) {
    return false;
  }
  if (!f.isStatic() || f.isSynthetic() || f.isVolatile()) {
    return false;
  }
  if (!f.isFinal()) {
    return true;
  }
  boolean isArray = f.getSignature().charAt(0) == '[';
  if (!(isArray || isCollection(f.getSignature()))) {
    return false;
  }
  return true;
}

代码示例来源:origin: spotbugs/spotbugs

@Override
public void visitGETFIELD(GETFIELD obj) {
  XField xfield = Hierarchy.findXField(obj, getCPG());
  if (xfield != null) {
    if (xfield.isVolatile()) {
      getFrame().killAllLoads();
    }
    if (doRedundantLoadElimination()) {
      loadInstanceField(xfield, obj);
      return;
    }
  }
  handleNormalInstruction(obj);
}

代码示例来源:origin: spotbugs/spotbugs

&& !"Ljava/lang/String;".equals(getSigConstantOperand())) {
XField declaration = getXFieldOperand();
if (declaration == null || !declaration.isVolatile()) {
  bugReporter.reportBug(new BugInstance(this, "DC_DOUBLECHECK", NORMAL_PRIORITY).addClassAndMethod(this)
      .addField(f).describe("FIELD_ON").addSourceLineRange(this, startPC, endPC));

代码示例来源:origin: spotbugs/spotbugs

if (!sawGetStaticAfterPutStatic && xfield.isVolatile()) {
  return;

代码示例来源:origin: spotbugs/spotbugs

if (field0 != null && field0.equals(field1) && (field0.isStatic() || fr0 != -1 && fr0 == fr1)) {
  int priority = NORMAL_PRIORITY;
  if (field0.isVolatile()) {
    priority++;

代码示例来源:origin: spotbugs/spotbugs

priority++;
if (f.isVolatile()) {
  priority++;

代码示例来源:origin: spotbugs/spotbugs

if (xfield.isStatic() || xfield.isPublic() || xfield.isVolatile() || xfield.isFinal()) {
  continue;

代码示例来源:origin: spotbugs/spotbugs

String prefix;
if (field != null) {
  if (field.isVolatile()) {
    return;

代码示例来源:origin: com.google.code.findbugs/findbugs

private boolean isVolatile(XField f) {
  return f != null && f.isVolatile();
}

代码示例来源:origin: com.google.code.findbugs/findbugs

public OpcodeStack.Item getSummary(XField field) {
  if (field == null) {
    return new OpcodeStack.Item();
  }
  OpcodeStack.Item result = summary.get(field);
  if (result == null || field.isVolatile()) {
    String signature = field.getSignature();
    return new OpcodeStack.Item(signature);
  }
  return result;
}

代码示例来源:origin: com.google.code.findbugs/findbugs

public void killAllLoads(boolean primitiveOnly) {
  if (!REDUNDANT_LOAD_ELIMINATION) {
    return;
  }
  FieldSummary fieldSummary = AnalysisContext.currentAnalysisContext().getFieldSummary();
  HashSet<AvailableLoad> killMe = new HashSet<AvailableLoad>();
  for (AvailableLoad availableLoad : getAvailableLoadMap().keySet()) {
    XField field = availableLoad.getField();
    if ((!primitiveOnly || !field.isReferenceType()) && (field.isVolatile() || !field.isFinal()
        && (!USE_WRITTEN_OUTSIDE_OF_CONSTRUCTOR || fieldSummary.isWrittenOutsideOfConstructor(field)))) {
      if (RLE_DEBUG) {
        System.out.println("KILLING load of " + availableLoad + " in " + this);
      }
      killMe.add(availableLoad);
    }
  }
  killAvailableLoads(killMe);
}

代码示例来源:origin: com.google.code.findbugs/findbugs

if (xfield.isVolatile()) {
  getFrame().killAllLoads();

代码示例来源:origin: com.google.code.findbugs/findbugs

private boolean interesting(XField f) {
  if (!f.isPublic() && !f.isProtected()) {
    return false;
  }
  if (!f.isStatic() || f.isSynthetic() || f.isVolatile()) {
    return false;
  }
  if (!f.isFinal()) {
    return true;
  }
  boolean isArray = f.getSignature().charAt(0) == '[';
  if (!(isArray || isCollection(f.getSignature()))) {
    return false;
  }
  return true;
}

代码示例来源:origin: com.google.code.findbugs/findbugs

@Override
public void visitGETFIELD(GETFIELD obj) {
  XField xfield = Hierarchy.findXField(obj, getCPG());
  if (xfield != null) {
    if (xfield.isVolatile()) {
      getFrame().killAllLoads();
    }
    if (doRedundantLoadElimination()) {
      loadInstanceField(xfield, obj);
      return;
    }
  }
  handleNormalInstruction(obj);
}

代码示例来源:origin: com.google.code.findbugs/findbugs

if (field0 != null && field0.equals(field1) && (field0.isStatic() || fr0 != -1 && fr0 == fr1)) {
  int priority = NORMAL_PRIORITY;
  if (field0.isVolatile()) {
    priority++;

代码示例来源:origin: com.google.code.findbugs/findbugs

String prefix;
if (field != null) {
  if (field.isVolatile()) {
    return;

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com