CPD Results

The following document contains the results of PMD's CPD

Duplications

FileLine
net/sourceforge/servletspy/handler/base/AbstractInterfaceTransformer.java134
net/sourceforge/servletspy/handler/container/DynamicProxyTransformer.java62
            final BeanInfo beanInfo = Introspector.getBeanInfo(clazz, clazz
                    .isInterface() ? null : Object.class);
            final PropertyDescriptor[] apd = beanInfo.getPropertyDescriptors();
            for (int i = 0; i < apd.length; i++) {
                final PropertyDescriptor pd = apd[i];
                final Method m = pd.getReadMethod();
                final Class clazzType = pd.getPropertyType();
                if (m == null) {
                    continue;
                }
                // Readers with parameter, i.e. indexed properties.
                if (m.getParameterTypes().length > 0) {
                    continue;
                }
                // Exclude null types, just in case there exists an
                // 'invalid' user defined property descriptor.
                if (clazzType == null) {
                    continue;
                }
                if (!Modifier.isPublic(m.getModifiers())
                        || Modifier.isStatic(m.getModifiers())) {
                    continue;
                }

FileLine
net/sourceforge/servletspy/handler/base/AbstractInterfaceTransformer.java154
net/sourceforge/servletspy/handler/container/DynamicProxyTransformer.java86
                if ( Collection.class.isAssignableFrom( clazzType ) && skipCollections ) {
                    continue;
                }

                // Guess the name of the property ...
                final String mName = m.getName();
                String key = null;
                if (mName.startsWith("get") && mName.length() > 3) {
                    key = Introspector.decapitalize(mName.substring(3));
                }
                if (mName.startsWith("is") && mName.length() > 2) {
                    key = Introspector.decapitalize(mName.substring(2));
                }
                final Object prop = m.invoke(context.getSubject(),
                        new Object[0]);
                context.add(key, prop);
            }
        }