CPD Results

The following document contains the results of PMD's CPD 3.7.

Duplications

FileLine
org/apache/geronimo/kernel/classloader/IoUtil.java68
org/apache/geronimo/kernel/config/IOUtil.java122
    }

    public static void flush(OutputStream thing) {
        if (thing != null) {
            try {
                thing.flush();
            } catch(Exception ignored) {
            }
        }
    }

    public static void flush(Writer thing) {
        if (thing != null) {
            try {
                thing.flush();
            } catch(Exception ignored) {
            }
        }
    }

    public static void close(JarFile thing) {
        if (thing != null) {
            try {
                thing.close();
            } catch(Exception ignored) {
            }
        }
    }

    public static void close(InputStream thing) {
        if (thing != null) {
            try {
                thing.close();
            } catch(Exception ignored) {
            }
        }
    }

    public static void close(OutputStream thing) {
        if (thing != null) {
            try {
                thing.close();
            } catch(Exception ignored) {
            }
        }
    }

    public static void close(Reader thing) {
        if (thing != null) {
            try {
                thing.close();
            } catch(Exception ignored) {
            }
        }
    }

    public static void close(Writer thing) {
        if (thing != null) {
            try {
                thing.close();
            } catch(Exception ignored) {
            }
        }
    }

    public static Set search(File root, String pattern) throws MalformedURLException {

FileLine
org/apache/geronimo/kernel/config/SerializedGBeanState.java65
org/apache/geronimo/kernel/config/xstream/XStreamGBeanState.java79
        gbeans.addAll(XStreamGBeanState.loadGBeans(gbeanState, classLoader));
        return Collections.unmodifiableList(gbeans);
    }

    public void addGBean(GBeanData gbeanData) {
        if (gbeanState != null) {
            throw new IllegalStateException("GBeans have been serialized, so no more GBeans can be added");
        }

        gbeans.add(gbeanData);
    }

    public GBeanData addGBean(String name, GBeanInfo gbeanInfo, Naming naming, Environment environment) {
        if (gbeanState != null) {
            throw new IllegalStateException("GBeans have been serialized, so no more GBeans can be added");
        }

        String j2eeType = gbeanInfo.getJ2eeType();
        if (j2eeType == null) j2eeType = "GBean";
        AbstractName abstractName = naming.createRootName(environment.getConfigId(), name, j2eeType);
        GBeanData gBeanData = new GBeanData(abstractName, gbeanInfo);
        addGBean(gBeanData);
        return gBeanData;
    }

    private static List loadGBeans(Element element, ClassLoader classLoader) throws InvalidConfigException {

FileLine
org/apache/geronimo/gbean/AbstractName.java99
org/apache/geronimo/gbean/AbstractNameQuery.java104
                throw new IllegalArgumentException("uri path must be in the form [groupId]/[artifactId]/[version]/[type] : " + artifactString);
            }

            String groupId = (String) artifactParts.get(0);
            if (groupId.length() == 0) groupId = null;

            String artifactId = (String) artifactParts.get(1);
            if (artifactId.length() == 0) artifactId = null;

            String version = (String) artifactParts.get(2);
            if (version.length() == 0) version = null;

            String type = (String) artifactParts.get(3);
            if (type.length() == 0) type = null;

            artifact = new Artifact(groupId, artifactId, version, type);

FileLine
org/apache/geronimo/gbean/AbstractName.java151
org/apache/geronimo/gbean/AbstractNameQuery.java170
    private static URI createURI(Artifact artifact, Map name, Set interfaceTypes) {
        StringBuffer queryString = new StringBuffer();
        TreeMap treeMap = new TreeMap(name);
        for (Iterator iterator = treeMap.entrySet().iterator(); iterator.hasNext();) {
            Map.Entry entry = (Map.Entry) iterator.next();
            String key = (String) entry.getKey();
            String value = (String) entry.getValue();
            queryString.append(key).append('=').append(value);
            if (iterator.hasNext()) {
                queryString.append(',');
            }
        }