Package edu.umd.cs.findbugs.ba

Examples of edu.umd.cs.findbugs.ba.XClass.findMethod()


            if (we == null || we.equals(getXClass())) {
                whereEqual = "java.lang.Object";
            } else {
                inheritedEqualsFromAbstractClass = we.isAbstract();
                whereEqual = we.getClassDescriptor().getDottedClassName();
                inheritedEquals = we.findMethod("equals", "(Ljava/lang/Object;)Z", false);
                if (inheritedEquals != null) {
                    inheritedEqualsIsFinal = inheritedEquals.isFinal();
                    inheritedEqualsIsAbstract = inheritedEquals.isAbstract();
                }
            }
View Full Code Here


            XClass wh = Lookup.findSuperImplementor(getXClass(), "hashCode", "()I", false, bugReporter);
            if (wh == null) {
                whereHashCode = "java.lang.Object";
            } else {
                whereHashCode = wh.getClassDescriptor().getDottedClassName();
                XMethod m = wh.findMethod("hashCode", "()I", false);
                if (m != null && m.isFinal()) {
                    inheritedHashCodeIsFinal = true;
                }
            }
        }
View Full Code Here

            // Annotation elements appear as abstract methods in the annotation
            // class (interface).
            // So, if the type qualifier annotation has specified a default When
            // value,
            // it will appear as an abstract method called "when".
            XMethod whenMethod = xclass.findMethod("when", "()Ljavax/annotation/meta/When;", false);
            if (whenMethod == null) {
                isStrict1 = true;
            }
            for (XMethod xmethod : xclass.getXMethods()) {
                if (xmethod.getName().equals("value") && xmethod.getSignature().startsWith("()")) {
View Full Code Here

                        }
                        XClass c = Lookup.getXClass(classDescriptor);
                        XMethod m;
                        int priority = NORMAL_PRIORITY;
                        if (methodName.equals("wait")) {
                            m = c.findMethod("await", "()V", false);
                            priority = HIGH_PRIORITY;
                        } else if (methodName.equals("notify")) {
                            m = c.findMethod("signal", "()V", false);
                            if (m == null) {
                                m = c.findMethod("countDown", "()V", false);
View Full Code Here

                        int priority = NORMAL_PRIORITY;
                        if (methodName.equals("wait")) {
                            m = c.findMethod("await", "()V", false);
                            priority = HIGH_PRIORITY;
                        } else if (methodName.equals("notify")) {
                            m = c.findMethod("signal", "()V", false);
                            if (m == null) {
                                m = c.findMethod("countDown", "()V", false);
                            }
                        } else if (methodName.equals("notifyAll")) {
                            m = c.findMethod("signalAll", "()V", false);
View Full Code Here

                            m = c.findMethod("await", "()V", false);
                            priority = HIGH_PRIORITY;
                        } else if (methodName.equals("notify")) {
                            m = c.findMethod("signal", "()V", false);
                            if (m == null) {
                                m = c.findMethod("countDown", "()V", false);
                            }
                        } else if (methodName.equals("notifyAll")) {
                            m = c.findMethod("signalAll", "()V", false);
                            if (m == null) {
                                m = c.findMethod("countDown", "()V", false);
View Full Code Here

                            m = c.findMethod("signal", "()V", false);
                            if (m == null) {
                                m = c.findMethod("countDown", "()V", false);
                            }
                        } else if (methodName.equals("notifyAll")) {
                            m = c.findMethod("signalAll", "()V", false);
                            if (m == null) {
                                m = c.findMethod("countDown", "()V", false);
                            }
                        } else {
                            throw new IllegalStateException("Unexpected methodName: " + methodName);
View Full Code Here

                                m = c.findMethod("countDown", "()V", false);
                            }
                        } else if (methodName.equals("notifyAll")) {
                            m = c.findMethod("signalAll", "()V", false);
                            if (m == null) {
                                m = c.findMethod("countDown", "()V", false);
                            }
                        } else {
                            throw new IllegalStateException("Unexpected methodName: " + methodName);
                        }
View Full Code Here

            // 2 look in the hierarchy if we have relaxed contract
            HierarchyIterator hierarchy = new HierarchyIterator(xclass);
            XClass superClass;
            boolean done = false;
            while (!done && (superClass = hierarchy.next()) != null) {
                XMethod method = superClass.findMethod(name, desc, false);
                if (method != null) {
                    done = checkMethod(method);
                } else {
                    for (XMethod superMethod : superClass.getXMethods()) {
                        if (name.equals(superMethod.getName()) && compatibleParameters(desc, superMethod.getSignature())) {
View Full Code Here

                        boolean nasty = false;
                        for (ClassDescriptor subclass : subtypes) {
                            if (!subclass.equals(getClassDescriptor())) {

                                XClass xSub = AnalysisContext.currentXFactory().getXClass(subclass);
                                if (xSub != null && xSub.findMethod("readResolve", "()Ljava/lang/Object;", false) == null
                                        && xSub.findMethod("writeReplace", "()Ljava/lang/Object;", false) == null) {
                                    bug.addClass(subclass).describe(ClassAnnotation.SUBCLASS_ROLE);
                                    nasty = true;
                                }
                            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.