CPD Results

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

Duplications

File Line
net/sf/ehcache/distribution/RMIAsynchronousCacheReplicator.java 305
net/sf/ehcache/distribution/jgroups/JGroupsCacheReplicator.java 412
        List cachePeers = listRemoteCachePeers(cache);

        for (int j = 0; j < cachePeers.size(); j++) {
            CachePeer cachePeer = (CachePeer) cachePeers.get(j);
            try {
                cachePeer.send(resolvedEventMessages);
            } catch (UnmarshalException e) {
                String message = e.getMessage();
                if (message.indexOf("Read time out") != 0) {
                    LOG.warning("Unable to send message to remote peer due to socket read timeout. Consider increasing"
                            + " the socketTimeoutMillis setting in the cacheManagerPeerListenerFactory. " + "Message was: "
                            + e.getMessage());
                } else {
                    LOG.fine("Unable to send message to remote peer.  Message was: " + e.getMessage());
                }
            } catch (Throwable t) {
                LOG.log(Level.WARNING, "Unable to send message to remote peer.  Message was: " + t.getMessage(), t);
            }
        }

File Line
net/sf/ehcache/hibernate/EhCacheProvider.java 143
net/sf/ehcache/hibernate/SingletonEhCacheProvider.java 138
        }
    }

    private URL loadResource(String configurationResourceName) {
        ClassLoader standardClassloader = ClassLoaderUtil.getStandardClassLoader();
        URL url = null;
        if (standardClassloader != null) {
            url = standardClassloader.getResource(configurationResourceName);
        }
        if (url == null) {
            url = this.getClass().getResource(configurationResourceName);
        }
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Creating EhCacheProvider from a specified resource: "
                    + configurationResourceName + " Resolved to URL: " + url);
        }
        if (url == null) {
            if (LOG.isLoggable(Level.WARNING)) {
                LOG.warning("A configurationResourceName was set to " + configurationResourceName +
                        " but the resource could not be loaded from the classpath." +
                        "Ehcache will configure itself using defaults.");
            }
        }
        return url;
    }

    /**
     * Callback to perform any necessary cleanup of the underlying cache implementation
     * during SessionFactory.close().
     */
    public void stop() {