private static void validateAttributes()

in src/core/src/main/java/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java [320:361]


    private static void validateAttributes(PropertyDescriptor pd, PropertyEditor pe) {
        final Object deflt = pd.getValue(DEFAULT);
        if (deflt == null) {
            if (notNull(pd)) {
                if (log.isWarnEnabled()) {
                    log.warn("{} requires a value but does not provide a default.", getDetails(pd));
                }
            }
            if (noSaveDefault(pd)) {
                if (log.isWarnEnabled()) {
                    log.warn("{} specifies DEFAULT_NO_SAVE but does not provide a default.", getDetails(pd));
                }
            }
        } else {
            final Class<?> defltClass = deflt.getClass(); // the DEFAULT class
            // Convert int to Integer etc:
            final Class<?> propClass = ClassUtils.primitiveToWrapper(pd.getPropertyType());
            if (!propClass.isAssignableFrom(defltClass) ){
                if (log.isWarnEnabled()) {
                    log.warn("{} has a DEFAULT of class {}", getDetails(pd), defltClass.getCanonicalName());
                }
            }
        }
        if (notOther(pd) && pd.getValue(TAGS) == null && pe.getTags() == null) {
            if (log.isWarnEnabled()) {
                log.warn("{} does not have tags but other values are not allowed.", getDetails(pd));
            }
        }
        if (!notNull(pd)) {
            Class<?> propertyType = pd.getPropertyType();
            if (propertyType.isPrimitive()) {
                if (log.isWarnEnabled()) {
                    log.warn("{} allows null but is a primitive type", getDetails(pd));
                }
            }
        }
        if (!pd.attributeNames().hasMoreElements()) {
            if (log.isWarnEnabled()) {
                log.warn("{} does not appear to have been configured", getDetails(pd));
            }
        }
    }