Package edu.umd.cs.findbugs.ba

Examples of edu.umd.cs.findbugs.ba.SignatureParser


        int localsThatAreParameters = PreorderVisitor.getNumberArguments(method.getSignature());
        int startIndex = 0;
        if (!method.isStatic()) {
            startIndex = 1;
        }
        SignatureParser parser = new SignatureParser(method.getSignature());
        Iterator<String> signatureIterator = parser.parameterSignatureIterator();
        int lowestCost = Integer.MAX_VALUE;
        for (int i = startIndex; i < localsThatAreParameters + startIndex; i++) {
            String sig = signatureIterator.next();
            if (signature.equals(sig)) {
                LocalVariableAnnotation potentialMatch = LocalVariableAnnotation.getLocalVariableAnnotation(method, i, 0, 0);
View Full Code Here


        }
        return "L" + signature + ";";
    }

    public static String hashMethodSignature(String signature) {
        SignatureParser parser = new SignatureParser(signature);
        StringBuilder buf = new StringBuilder("(");
        for (Iterator<String> i = parser.parameterSignatureIterator(); i.hasNext();) {
            String param = i.next();
            buf.append(hashSignature(param));
        }
        buf.append(")");
        buf.append(hashSignature(parser.getReturnTypeSignature()));
        return buf.toString();

    }
View Full Code Here

            CFG cfg = classContext.getCFG(method);

            ValueNumberDataflow vnaDataflow = classContext.getValueNumberDataflow(method);
            UnconditionalValueDerefDataflow dataflow = classContext.getUnconditionalValueDerefDataflow(method);

            SignatureParser parser = new SignatureParser(method.getSignature());
            int paramLocalOffset = method.isStatic() ? 0 : 1;

            // Build BitSet of params that are unconditionally dereferenced
            BitSet unconditionalDerefSet = new BitSet();
            UnconditionalValueDerefSet entryFact = dataflow.getResultFact(cfg.getEntry());
            Iterator<String> paramIterator = parser.parameterSignatureIterator();
            int i = 0;
            while (paramIterator.hasNext()) {
                String paramSig = paramIterator.next();

                ValueNumber paramVN = vnaDataflow.getAnalysis().getEntryValue(paramLocalOffset);
View Full Code Here

    public void visit(Code obj) {

        if (!getMethod().isPublic() && !getMethod().isProtected()) {
            return;
        }
        SignatureParser p = new SignatureParser(getMethodSig());
        LocalVariableTable t = obj.getLocalVariableTable();

        if (t == null) {
            return;
        }
        ParameterProperty property = new ParameterProperty();

        int index = getMethod().isStatic() ? 0 : 1;
        int parameterNumber = 0;
        for (Iterator<String> i = p.parameterSignatureIterator(); i.hasNext();) {
            String s = i.next();
            LocalVariable localVariable = t.getLocalVariable(index, 0);
            if (localVariable != null) {
                String name = localVariable.getName();
                if (s.equals("J") && (name.toLowerCase().indexOf("instant") >= 0 || name.startsWith("date"))) {
View Full Code Here

    private String stripFirstAndLast(String s) {
        return s.substring(1, s.length()-1);
    }
    private IMethod getIMethod(IType type, MethodAnnotation mma) throws JavaModelException {
        String name = mma.getMethodName();
        SignatureParser parser = new SignatureParser(mma.getMethodSignature());
        String[] arguments = parser.getArguments();


        nextMethod: for(IMethod m : type.getMethods()) {
            if (!m.getElementName().equals(name)) {
                continue nextMethod;
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.ba.SignatureParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.