Package org.jboss.byteman.rule.exception

Examples of org.jboss.byteman.rule.exception.TypeWarningException


                    try {
                        Method method = nextClass.getMethod(triggerMethodName, paramTypes);
                        Class<?>[] exceptionTypes = method.getExceptionTypes();
                        for (int i = 0; i < exceptionTypes.length; i++) {
                            if (exceptionTypes[i].isAssignableFrom(type.getTargetClass())) {
                                throw new TypeWarningException("ThrowExpression.typeCheck : exception type declared by rule target method but not by trigger method "  + typeName + getPos());
                            }
                        }
                    } catch (NoSuchMethodException e) {
                        // ok, ignore
                    }
View Full Code Here


                    try {
                        Method method = nextClass.getMethod(triggerMethodName, paramTypes);
                        Class<?>[] exceptionTypes = method.getExceptionTypes();
                        for (int i = 0; i < exceptionTypes.length; i++) {
                            if (exceptionTypes[i].isAssignableFrom(type.getTargetClass())) {
                                throw new TypeWarningException("ThrowExpression.typeCheck : exception type declared by rule target method but not by trigger method "  + typeName + getPos());
                            }
                        }
                    } catch (NoSuchMethodException e) {
                        // ok, ignore
                    }
View Full Code Here

        // remove the rule so that we don't try to inject into this method
        String key = getRuleKey(triggerMethodName, triggerMethodDescriptor);
        Rule rule = ruleMap.remove(key);
        // now attach an exception to the rule script
        String message = warningMessage + " for method " + triggerMethodName + TypeHelper.internalizeDescriptor(triggerMethodDescriptor);
        TypeWarningException tw = new TypeWarningException(message);
        ruleScript.recordTransform(loader, triggerClassName, triggerMethodName, triggerMethodDescriptor, rule, tw);
    }
View Full Code Here

        // if we got here then we have performed a successful injection for each rule in the rule map
        // if the map is empty then we ned to generate a warning that the rule was not injectable

        if (ruleMap.isEmpty() && firstRule != null) {
            // we parsed the rule but failed ever to inject it
            TypeWarningException twe = new TypeWarningException("failed to find any matching trigger method in class " + TypeHelper.internalizeClass(triggerClassName));
            ruleScript.recordTransform(loader, triggerClassName, null, null, firstRule, twe);
        }

        for (String key : ruleMap.keySet()) {
            String triggerMethodName = getKeyTriggerMethodName(key);
View Full Code Here

        // remove the rule so that we don't try to inject into this method
        String key = getRuleKey(triggerMethodName, triggerMethodDescriptor);
        Rule rule = ruleMap.remove(key);
        // now attach an exception to the rule script
        String message = warningMessage + " for method " + triggerMethodName + TypeHelper.internalizeDescriptor(triggerMethodDescriptor);
        TypeWarningException tw = new TypeWarningException(message);
        ruleScript.recordTransform(loader, triggerClassName, triggerMethodName, triggerMethodDescriptor, rule, tw);
    }
View Full Code Here

        // if we got here then we have performed a successful injection for each rule in the rule map
        // if the map is empty then we ned to generate a warning that the rule was not injectable

        if (ruleMap.isEmpty() && firstRule != null) {
            // we parsed the rule but failed ever to inject it
            TypeWarningException twe = new TypeWarningException("failed to find any matching trigger method in class " + TypeHelper.internalizeClass(triggerClassName));
            ruleScript.recordTransform(loader, triggerClassName, null, null, firstRule, twe);
        }

        for (String key : ruleMap.keySet()) {
            String triggerMethodName = getKeyTriggerMethodName(key);
View Full Code Here

                    try {
                        Method method = nextClass.getMethod(triggerMethodName, paramTypes);
                        Class<?>[] exceptionTypes = method.getExceptionTypes();
                        for (int i = 0; i < exceptionTypes.length; i++) {
                            if (exceptionTypes[i].isAssignableFrom(type.getTargetClass())) {
                                throw new TypeWarningException("ThrowExpression.typeCheck : exception type declared by rule target method but not by trigger method "  + typeName + getPos());
                            }
                        }
                    } catch (NoSuchMethodException e) {
                        // ok, ignore
                    }
View Full Code Here

TOP

Related Classes of org.jboss.byteman.rule.exception.TypeWarningException

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.