当前位置: 首页>>代码示例>>Java>>正文


Java ObjectTypeFactory类代码示例

本文整理汇总了Java中edu.umd.cs.findbugs.ba.ObjectTypeFactory的典型用法代码示例。如果您正苦于以下问题:Java ObjectTypeFactory类的具体用法?Java ObjectTypeFactory怎么用?Java ObjectTypeFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ObjectTypeFactory类属于edu.umd.cs.findbugs.ba包,在下文中一共展示了ObjectTypeFactory类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: IOStreamFactory

import edu.umd.cs.findbugs.ba.ObjectTypeFactory; //导入依赖的package包/类
public IOStreamFactory(String baseClass, String[] uninterestingSubclassList, String bugType) {
    this.baseClassType = ObjectTypeFactory.getInstance(baseClass);
    this.uninterestingSubclassTypeList = new ObjectType[uninterestingSubclassList.length];
    for (int i = 0; i < uninterestingSubclassList.length; ++i) {
        this.uninterestingSubclassTypeList[i] = ObjectTypeFactory.getInstance(uninterestingSubclassList[i]);
    }
    this.bugType = bugType;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:9,代码来源:IOStreamFactory.java

示例2: getObjectType

import edu.umd.cs.findbugs.ba.ObjectTypeFactory; //导入依赖的package包/类
/**
 * @return the underlying ObjectType for this Generic Object
 */
public ObjectType getObjectType() {
    String cName = ClassName.fromFieldSignature(getSignature());
    if (cName == null) {
        throw new IllegalStateException("Can't provide ObjectType for " + this);
    }
    @DottedClassName
    String c = ClassName.toDottedClassName(cName);
    return ObjectTypeFactory.getInstance(c);
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:13,代码来源:GenericObjectType.java

示例3: Subtypes2

import edu.umd.cs.findbugs.ba.ObjectTypeFactory; //导入依赖的package包/类
/**
 * Constructor.
 */
public Subtypes2() {
    this.graph = new InheritanceGraph();
    this.classDescriptorToVertexMap = new HashMap<ClassDescriptor, ClassVertex>();
    this.supertypeSetMap = new MapCache<ClassDescriptor, SupertypeQueryResults>(500);
    this.subtypeSetMap = new MapCache<ClassDescriptor, Set<ClassDescriptor>>(500);
    this.xclassSet = new HashSet<XClass>();
    this.SERIALIZABLE = ObjectTypeFactory.getInstance("java.io.Serializable");
    this.CLONEABLE = ObjectTypeFactory.getInstance("java.lang.Cloneable");
    this.firstCommonSuperclassQueryCache = new DualKeyHashMap<ReferenceType, ReferenceType, ReferenceType>();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:14,代码来源:Subtypes2.java

示例4: clearCaches

import edu.umd.cs.findbugs.ba.ObjectTypeFactory; //导入依赖的package包/类
/**
 * Protected to allow Eclipse plugin remember some cache data for later reuse
 */
protected void clearCaches() {
    DescriptorFactory.clearInstance();
    ObjectTypeFactory.clearInstance();
    TypeQualifierApplications.clearInstance();
    TypeQualifierAnnotation.clearInstance();
    TypeQualifierValue.clearInstance();
    // Make sure the codebases on the classpath are closed
    AnalysisContext.removeCurrentAnalysisContext();
    Global.removeAnalysisCacheForCurrentThread();
    MethodInfo.clearCaches();
    if (classPath != null) {
        classPath.close();
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:18,代码来源:FindBugs2.java

示例5: setUp

import edu.umd.cs.findbugs.ba.ObjectTypeFactory; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    super.setUp();
    typeSerializable = ObjectTypeFactory.getInstance("java.io.Serializable");
    typeClonable = ObjectTypeFactory.getInstance("java.lang.Cloneable");
    typeObject = ObjectTypeFactory.getInstance("java.lang.Object");
    typeInteger = ObjectTypeFactory.getInstance("java.lang.Integer");
    typeString = ObjectTypeFactory.getInstance("java.lang.String");
    typeComparable = ObjectTypeFactory.getInstance("java.lang.Comparable");

    typeList = ObjectTypeFactory.getInstance("java.util.List");
    typeCollection = ObjectTypeFactory.getInstance("java.util.Collection");
    typeHashSet = ObjectTypeFactory.getInstance("java.util.HashSet");
    typeArrayClonable = new ArrayType(typeClonable, 1);
    typeArrayComparable = new ArrayType(typeComparable, 1);
    typeArrayObject = new ArrayType(typeObject, 1);
    typeArrayInteger = new ArrayType(typeInteger, 1);
    typeArrayString = new ArrayType(typeString, 1);
    typeArrayArrayObject = new ArrayType(typeObject, 2);
    typeArrayArraySerializable = new ArrayType(typeSerializable, 2);
    typeArrayArrayString = new ArrayType(typeString, 2);
    typeArrayInt = new ArrayType(Type.INT, 1);
    typeArrayArrayInt = new ArrayType(Type.INT, 2);
    typeArrayArrayArrayInt = new ArrayType(Type.INT, 3);
    typeArrayChar = new ArrayType(Type.CHAR, 1);
    typeArrayArrayChar = new ArrayType(Type.CHAR, 2);
    typeArrayArrayArrayChar = new ArrayType(Type.CHAR, 3);
    typeDynamicString = new FindRefComparison.DynamicStringType();
    typeStaticString = new FindRefComparison.StaticStringType();
    typeParameterString = new FindRefComparison.ParameterStringType();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:32,代码来源:Subtypes2Test.java

示例6: clearCaches

import edu.umd.cs.findbugs.ba.ObjectTypeFactory; //导入依赖的package包/类
/**
 * Protected to allow Eclipse plugin remember some cache data for later reuse
 */
protected void clearCaches() {
    DescriptorFactory.clearInstance();
    ObjectTypeFactory.clearInstance();
    TypeQualifierApplications.clearInstance();
    TypeQualifierAnnotation.clearInstance();
    TypeQualifierValue.clearInstance();
    // Make sure the codebases on the classpath are closed
    AnalysisContext.removeCurrentAnalysisContext();
    Global.removeAnalysisCacheForCurrentThread();
    if (classPath != null) {
        classPath.close();
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:17,代码来源:FindBugs2.java

示例7: AnyMethodReturnValueStreamFactory

import edu.umd.cs.findbugs.ba.ObjectTypeFactory; //导入依赖的package包/类
public AnyMethodReturnValueStreamFactory(String streamBase) {
    this.baseClassType = ObjectTypeFactory.getInstance(streamBase);
    this.bugType = null;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:5,代码来源:AnyMethodReturnValueStreamFactory.java

示例8: Obligation

import edu.umd.cs.findbugs.ba.ObjectTypeFactory; //导入依赖的package包/类
public Obligation(@DottedClassName  String className, int id) {
    this.className = className;
    this.type = ObjectTypeFactory.getInstance(className);
    this.id = id;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:6,代码来源:Obligation.java

示例9: initEntryFact

import edu.umd.cs.findbugs.ba.ObjectTypeFactory; //导入依赖的package包/类
public void initEntryFact(TypeFrame result) {
    // Make the frame valid
    result.setValid();

    int slot = 0;

    // Clear the stack slots in the frame
    result.clearStack();

    // Add local for "this" pointer, if present
    if (!methodGen.isStatic())
        result.setValue(slot++, ObjectTypeFactory.getInstance(methodGen.getClassName()));

    // [Added: Support for Generics]
    // Get a parser that reads the generic signature of the method and
    // can be used to get the correct GenericObjectType if an argument
    // has a class type
    Iterator<String> iter = GenericSignatureParser.getGenericSignatureIterator(method);

    // Add locals for parameters.
    // Note that long and double parameters need to be handled
    // specially because they occupy two locals.
    Type[] argumentTypes = methodGen.getArgumentTypes();
    for (Type argType : argumentTypes) {
        // Add special "extra" type for long or double params.
        // These occupy the slot before the "plain" type.
        if (argType.getType() == Constants.T_LONG) {
            result.setValue(slot++, TypeFrame.getLongExtraType());
        } else if (argType.getType() == Constants.T_DOUBLE) {
            result.setValue(slot++, TypeFrame.getDoubleExtraType());
        }

        // [Added: Support for Generics]
        String s = (iter == null || !iter.hasNext()) ? null : iter.next();
        if (s != null && (argType instanceof ObjectType || argType instanceof ArrayType)
                && !(argType instanceof ExceptionObjectType)) {
            // replace with a generic version of the type
            try {
                Type t = GenericUtilities.getType(s);
                if (t != null)
                    argType = t;
            } catch (RuntimeException e) {
            } // degrade gracefully
        }

        // Add the plain parameter type.
        result.setValue(slot++, argType);
    }

    // Set remaining locals to BOTTOM; this will cause any
    // uses of them to be flagged
    while (slot < methodGen.getMaxLocals())
        result.setValue(slot++, TypeFrame.getBottomType());
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:55,代码来源:TypeAnalysis.java

示例10: MethodReturnValueStreamFactory

import edu.umd.cs.findbugs.ba.ObjectTypeFactory; //导入依赖的package包/类
/**
 * Constructor. The Streams created will be marked as uninteresting.
 * 
 * @param baseClass
 *            base class through which the method will be called (we check
 *            instances of the base class and all subtypes)
 * @param methodName
 *            name of the method called
 * @param methodSig
 *            signature of the method called
 */
public MethodReturnValueStreamFactory(String baseClass, String methodName, String methodSig) {
    this.baseClassType = ObjectTypeFactory.getInstance(baseClass);
    this.methodName = methodName;
    this.methodSig = methodSig;
    this.isUninteresting = true;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:18,代码来源:MethodReturnValueStreamFactory.java


注:本文中的edu.umd.cs.findbugs.ba.ObjectTypeFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。