gpt4 book ai didi

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

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

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

XField.getClassDescriptor介绍

暂无

代码示例

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

Map.Entry<XField, OpcodeStack.Item> entry = i.next();
XField f = entry.getKey();
if ( AnalysisContext.currentXFactory().isReflectiveClass(f.getClassDescriptor())) {
  i.remove();
  removed++;

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

@Override
public void report() {
  Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2();
  for (XField f : AnalysisContext.currentXFactory().allFields()) {
    if (isVolatileArray(f) && subtypes2.isApplicationClass(f.getClassDescriptor())) {
      int priority = LOW_PRIORITY;
      if (initializationWrites.contains(f) && !otherWrites.contains(f)) {
        priority = NORMAL_PRIORITY;
      }
      bugReporter.reportBug(new BugInstance(this, "VO_VOLATILE_REFERENCE_TO_ARRAY", priority).addClass(
          f.getClassDescriptor()).addField(f));
    }
  }
}

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

public static boolean isServletField(XField field) {
  ClassDescriptor classDescriptor = field.getClassDescriptor();
  try {
    Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2();
    if (subtypes2.isSubtype(classDescriptor, servlet) && !subtypes2.isSubtype(classDescriptor, singleThreadedServlet)) {
      return true;
    }
  } catch (ClassNotFoundException e) {
    assert true;
  }
  if (classDescriptor.getClassName().endsWith("Servlet")) {
    return true;
  }
  return false;
}

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

XClass xClass = Global.getAnalysisCache().getClassAnalysis(XClass.class, f.getClassDescriptor());
  movedOutofInterface = couldBePackage && xClass.isInterface();
} catch (CheckedAnalysisException e) {

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

if (seen == Const.PUTFIELD) {
  XField xField = getXFieldOperand();
  if (xField != null && xField.getClassDescriptor().equals(getClassDescriptor())) {
    Item first = stack.getStackItem(0);

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

XFactory xFactory = AnalysisContext.currentXFactory();
for (XField f : AnalysisContext.currentXFactory().allFields()) {
  ClassDescriptor classDescriptor = f.getClassDescriptor();
  if (currentAnalysisContext.isApplicationClass(classDescriptor) && !currentAnalysisContext.isTooBig(classDescriptor)
      && !xFactory.isReflectiveClass(classDescriptor)) {
  classContainingNullOnlyFields.add(f.getClassDescriptor());
  int increment = 3;
  Collection<ProgramPoint> assumedNonNullAt = data.assumedNonNull.get(f);
  } else if (nullOnlyFieldNames.getCount(f.getName()) > 8) {
    assumeReflective.add(f);
  } else if (classContainingNullOnlyFields.getCount(f.getClassDescriptor()) > 4) {
    assumeReflective.add(f);
  } else if (classContainingNullOnlyFields.getCount(f.getClassDescriptor()) > 2 && f.getName().length() == 1) {
    assumeReflective.add(f);
      XClass thisClass = Global.getAnalysisCache().getClassAnalysis(XClass.class, f.getClassDescriptor());
                if (r instanceof ObjectType) {
                  ClassDescriptor c = DescriptorFactory.getClassDescriptor((ObjectType) r);
                  if (subtypes2.isSubtype(f.getClassDescriptor(), c)) {
                    ProgramPoint p = data.threadLocalAssignedInConstructor.get(of);
                    int priority = p == null ? NORMAL_PRIORITY : HIGH_PRIORITY;
        if (isAnonymousInnerClass) {
          bugInstance = new BugInstance(this, "SIC_INNER_SHOULD_BE_STATIC_ANON", priority);
          List<BugAnnotation> annotations = anonymousClassAnnotation.remove(f.getClassDescriptor().getDottedClassName());
          if(annotations != null) {

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

@Override
  public void sawOpcode(int seen) {
    if(skip) {
      return;
    }
    if(isBranch(seen) || seen == Const.ATHROW || isReturn(seen)) {
      skip = true;
    }
    if(seen == Const.PUTFIELD) {
      XField xField = getXFieldOperand();
      if(xField != null && xField.getClassDescriptor().getClassName().equals(getClassName())) {
        Item val = getStack().getStackItem(0);
        if(val.isInitialParameter()) {
          reporter.reportBug(new BugInstance("ME_ENUM_FIELD_SETTER", NORMAL_PRIORITY).addClassAndMethod(this).addField(xField)
              .addSourceLine(this));
        }
      }
    }
  }
}

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

private MethodCall getMethodCall(MethodDescriptor methodDescriptorOperand) {
  Item objItem = getStack().getStackItem(getNumberArguments(methodDescriptorOperand.getSignature()));
  if (isNew(objItem)) {
    return new MethodCall(methodDescriptorOperand, TARGET_NEW);
  }
  if (objItem.getRegisterNumber() == 0 && !getMethod().isStatic()) {
    return new MethodCall(methodDescriptorOperand, constructor ? TARGET_NEW : TARGET_THIS);
  }
  XField xField = objItem.getXField();
  if (xField != null) {
    if (classInit && xField.isStatic() && xField.getClassDescriptor().getClassName().equals(getClassName())) {
      return new MethodCall(methodDescriptorOperand, TARGET_NEW);
    }
    if (!getMethodDescriptor().isStatic() && objItem.getFieldLoadedFromRegister() == 0
        && allowedFields.contains(xField.getFieldDescriptor())) {
      fieldsModifyingMethods.add(getMethodDescriptor());
      return new MethodCall(methodDescriptorOperand, xField.getFieldDescriptor());
    }
  }
  return new MethodCall(methodDescriptorOperand, TARGET_OTHER);
}

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

if (f == null || !f.getClassDescriptor().equals(getClassDescriptor())) {
  return;

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

if (!fieldOperand.getClassDescriptor().getClassName().equals(getClassName())) {
  fieldSummary.addWrittenOutsideOfConstructor(fieldOperand);
} else if (seen == Const.PUTFIELD) {

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

XField xField = (XField)field;
if((xField.isPublic() || xField.isProtected())) {
  XClass xClass = AnalysisContext.currentXFactory().getXClass(xField.getClassDescriptor());
  if(xClass != null && xClass.isPublic()) {
    priority = NORMAL_PRIORITY;

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

Map.Entry<XField, OpcodeStack.Item> entry = i.next();
XField f = entry.getKey();
if ( AnalysisContext.currentXFactory().isReflectiveClass(f.getClassDescriptor())) {
  i.remove();
  removed++;

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

@Override
public void report() {
  Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2();
  for (XField f : AnalysisContext.currentXFactory().allFields()) {
    if (isVolatileArray(f) && subtypes2.isApplicationClass(f.getClassDescriptor())) {
      int priority = LOW_PRIORITY;
      if (initializationWrites.contains(f) && !otherWrites.contains(f)) {
        priority = NORMAL_PRIORITY;
      }
      bugReporter.reportBug(new BugInstance(this, "VO_VOLATILE_REFERENCE_TO_ARRAY", priority).addClass(
          f.getClassDescriptor()).addField(f));
    }
  }
}

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

public static boolean isServletField(XField field) {
  ClassDescriptor classDescriptor = field.getClassDescriptor();
  try {
    Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2();
    if (subtypes2.isSubtype(classDescriptor, servlet) && !subtypes2.isSubtype(classDescriptor, singleThreadedServlet)) {
      return true;
    }
  } catch (ClassNotFoundException e) {
    assert true;
  }
  if (classDescriptor.getClassName().endsWith("Servlet")) {
    return true;
  }
  return false;
}

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

XClass xClass = Global.getAnalysisCache().getClassAnalysis(XClass.class, f.getClassDescriptor());
  movedOutofInterface = couldBePackage && xClass.isInterface();
} catch (CheckedAnalysisException e) {

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

if (seen == PUTFIELD) {
  XField xField = getXFieldOperand();
  if (xField != null && xField.getClassDescriptor().equals(getClassDescriptor())) {
    Item first = stack.getStackItem(0);

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

@Override
  public void sawOpcode(int seen) {
    if(skip) {
      return;
    }
    if(isBranch(seen) || seen == ATHROW || isReturn(seen)) {
      skip = true;
    }
    if(seen == PUTFIELD) {
      XField xField = getXFieldOperand();
      if(xField != null && xField.getClassDescriptor().getClassName().equals(getClassName())) {
        Item val = getStack().getStackItem(0);
        if(val.isInitialParameter()) {
          reporter.reportBug(new BugInstance("ME_ENUM_FIELD_SETTER", NORMAL_PRIORITY).addClassAndMethod(this).addField(xField)
              .addSourceLine(this));
        }
      }
    }
  }
}

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

private MethodCall getMethodCall(MethodDescriptor methodDescriptorOperand) {
  Item objItem = getStack().getStackItem(getNumberArguments(methodDescriptorOperand.getSignature()));
  if (isNew(objItem)) {
    return new MethodCall(methodDescriptorOperand, TARGET_NEW);
  }
  if (objItem.getRegisterNumber() == 0 && !getMethod().isStatic()) {
    return new MethodCall(methodDescriptorOperand, constructor ? TARGET_NEW : TARGET_THIS);
  }
  XField xField = objItem.getXField();
  if (xField != null) {
    if (classInit && xField.isStatic() && xField.getClassDescriptor().getClassName().equals(getClassName())) {
      return new MethodCall(methodDescriptorOperand, TARGET_NEW);
    }
    if (!getMethodDescriptor().isStatic() && objItem.getFieldLoadedFromRegister() == 0
        && allowedFields.contains(xField.getFieldDescriptor())) {
      fieldsModifyingMethods.add(getMethodDescriptor());
      return new MethodCall(methodDescriptorOperand, xField.getFieldDescriptor());
    }
  }
  return new MethodCall(methodDescriptorOperand, TARGET_OTHER);
}

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

if (!fieldOperand.getClassDescriptor().getClassName().equals(getClassName())) {
  fieldSummary.addWrittenOutsideOfConstructor(fieldOperand);
} else if (seen == PUTFIELD) {

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

if (f == null || !f.getClassDescriptor().equals(getClassDescriptor())) {
  return;

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