gpt4 book ai didi

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

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

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

XField.getName介绍

暂无

代码示例

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

public void killLoadsWithSimilarName(String className, String methodName) {
  if (!REDUNDANT_LOAD_ELIMINATION) {
    return;
  }
  String packageName = extractPackageName(className);
  HashSet<AvailableLoad> killMe = new HashSet<>();
  for (AvailableLoad availableLoad : getAvailableLoadMap().keySet()) {
    XField field = availableLoad.getField();
    String fieldPackageName = extractPackageName(field.getClassName());
    if (packageName.equals(fieldPackageName) && field.isStatic()
        && methodName.toLowerCase().indexOf(field.getName().toLowerCase()) >= 0) {
      killMe.add(availableLoad);
    }
  }
  killAvailableLoads(killMe);
}

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

/**
 * Add a field annotation for an XField.
 *
 * @param xfield
 *            the XField
 * @return this object
 */
@Nonnull
public BugInstance addOptionalField(@CheckForNull XField xfield) {
  if (xfield == null) {
    return this;
  }
  return addField(xfield.getClassName(), xfield.getName(), xfield.getSignature(), xfield.isStatic());
}

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

/**
 * Add a field annotation for an XField.
 *
 * @param xfield
 *            the XField
 * @return this object
 */
@Nonnull
public BugInstance addField(XField xfield) {
  return addField(xfield.getClassName(), xfield.getName(), xfield.getSignature(), xfield.isStatic());
}

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

String className = f.getClassName();
String fieldSig = f.getSignature();
String fieldName = f.getName();
boolean couldBeFinal = !isFinal && !notFinal.contains(f);

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

public static FieldAnnotation fromXField(XField fieldDescriptor) {
  return new FieldAnnotation(fieldDescriptor.getClassName(), fieldDescriptor.getName(), fieldDescriptor.getSignature(),
      fieldDescriptor.getSourceSignature(), fieldDescriptor.isStatic());
}

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

if (f.getName().startsWith("this$")) {
  return NullnessAnnotation.NONNULL;

代码示例来源:origin: find-sec-bugs/find-sec-bugs

if(field.getClassName().endsWith("SecurityBypasser$AllHosts$") && field.getName().equals("MODULE$")) {
  bugReporter.reportBug(new BugInstance(this, WEAK_HOSTNAME_VERIFIER_TYPE, Priorities.NORMAL_PRIORITY) //
      .addClass(this).addMethod(this).addSourceLine(this));
else if(field.getClassName().endsWith("SecurityBypasser$AllTM$") && field.getName().equals("MODULE$")) {
  bugReporter.reportBug(new BugInstance(this, WEAK_TRUST_MANAGER_TYPE, Priorities.NORMAL_PRIORITY) //
      .addClass(this).addMethod(this).addSourceLine(this));

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

if ("java.util.logging.Level".equals(field.getClassName()) && "SEVERE".equals(field.getName())
    || "org.apache.log4j.Level".equals(field.getClassName())
    && ("ERROR".equals(field.getName()) || "FATAL".equals(field.getName()))) {
  getFrame().toExceptionValues();
if (field.getName().startsWith("class$")) {
  produce(IsNullValue.nonNullValue());
  return;

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

fieldName = fld.getName();
if (fieldName.length() == 1) {
  continue;
    priority++;
  if (fld.isSynthetic() || fld.getName().indexOf('$') >= 0) {
    priority++;

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

Set<String> fieldNamesSet = new HashSet<>();
for (XField f : data.writtenNonNullFields) {
  fieldNamesSet.add(f.getName());
for (Iterator<XField> i = declaredFields.iterator(); i.hasNext();) {
  XField f = i.next();
  if (f.isSynthetic() && !f.getName().startsWith("this$") || f.getName().startsWith("_")) {
    i.remove();
  nullOnlyFieldNames.add(f.getName());
  classContainingNullOnlyFields.add(f.getClassDescriptor());
  int increment = 3;
  } 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);
    System.out.println("   : " + data.assumedNonNull.containsKey(f));
    System.out.println("   : " + data.fieldsOfSerializableOrNativeClassed.contains(f));
    System.out.println("   : " + fieldNamesSet.contains(f.getName()));
    System.out.println("   : " + data.abstractClasses.contains(f.getClassName()));
    System.out.println("   : " + data.hasNonAbstractSubClass.contains(f.getClassName()));
  String fieldName = f.getName();
  String className = f.getClassName();
  int lastDollar = Math.max(className.lastIndexOf('$'), className.lastIndexOf('+'));

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

if (xfield.getName().startsWith("class$") || xfield.getName().startsWith("array$")) {
  if (DEBUG) {
    System.out.println("Ignoring field " + xfield.getName());
if (!signature.startsWith("[") && !signature.startsWith("L")) {
  if (DEBUG) {
    System.out.println("Ignoring non-reference field " + xfield.getName());

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

OpcodeStack.Item valuePut = getStack().getStackItem(0);
checkWriteToStaticFromInstanceMethod: if (f.getName().indexOf("class$") != 0) {
  int priority = LOW_PRIORITY;
  if (f.isReferenceType()) {
      || f.getName().indexOf('$') >= 0) {
    priority++;
  if (f.getName().indexOf("DEBUG") >= 0 || f.getName().indexOf("VERBOSE") >= 0 && "Z".equals(f.getSignature())) {
    priority++;
    priority++;

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

return;
if (f.isSynthetic() || f.getName().startsWith("this$")) {
  return;

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

} else {
  for (XField f : c.getXFields()) {
    if (f.getName().equals(local.getName()) && (f.isStatic() || !getMethod().isStatic())) {
      bugReporter.reportBug(new BugInstance(this, "SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD",
          priority).addClassAndMethod(this).add(local).addField(f)

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

&& f2.getSignature().equals(f.getSignature())) {
double distance = EditDistance.editDistanceRatio(f.getName(), f2.getName());
matches++;
if (minimumDistance > distance) {

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

xfield = XFactory.getExactXField(instanceClassName, xfield.getName(), xfield.getSignature(),
    xfield.isStatic());

代码示例来源:origin: stackoverflow.com

final XJavaDoc xJavaDoc = XDocletTagSupport.getXJavaDoc();
final XClass xClass = xJavaDoc.getXClass(clazz.getCanonicalName());
// iterate over all fields in the angebot class and...
for (Object field : xClass.getFields(true)) {
 final XField xfield = (XField) field;
 // ... check if it contains the corresponding field, ...
 if (xfield.getName().contains(fieldNameToLookFor)) {
  return xfield;
 }
}

代码示例来源:origin: com.mebigfatguy.fb-contrib/fb-contrib

private Object sawGetStatic(Object userObject) {
  XField field = getXFieldOperand();
  if (field != null) {
    String fieldName = field.getName();
    if (fieldSpecialObjects.containsKey(fieldName)) {
      return fieldName;
    }
  }
  return userObject;
}

代码示例来源:origin: com.mebigfatguy.fb-contrib/fb-contrib

private void processInvokeVirtual() {
  String className = getClassConstantOperand();
  if (className.startsWith("java/util/") && className.endsWith("List")) {
    XField field = getFieldFromStack(stack, getSigConstantOperand());
    if (field != null) {
      String fieldName = field.getName();
      fieldsReported.remove(fieldName);
    }
  }
}

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

/**
 * Add a field annotation for an XField.
 *
 * @param xfield
 *            the XField
 * @return this object
 */
@Nonnull
public BugInstance addField(XField xfield) {
  return addField(xfield.getClassName(), xfield.getName(), xfield.getSignature(), xfield.isStatic());
}

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