CPD Results

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

Duplications

File Line
org/deegree/console/featurestore/AppSchemaInfo.java 101
org/deegree/console/featurestore/FeatureStoreConfig.java 269
    }

    private void appendFcInfo( FeatureType ft, StringBuffer sb, String indent )
                            throws IOException {
        if ( ft instanceof FeatureCollectionType ) {
            if ( ft.isAbstract() ) {
                sb.append( indent + "- <i>" + ft.getName().getPrefix() + ":" + ft.getName().getLocalPart()
                           + " (abstract)</i><br/>" );
            } else {
                sb.append( indent + "- " + ft.getName().getPrefix() + ":" + ft.getName().getLocalPart() + "<br/>" );
            }
        }
        FeatureType[] fts = ft.getSchema().getDirectSubtypes( ft );
        Arrays.sort( fts, new Comparator<FeatureType>() {
            public int compare( FeatureType a, FeatureType b ) {
                int order = a.getName().getNamespaceURI().compareTo( b.getName().getNamespaceURI() );
                if ( order == 0 ) {
                    order = a.getName().getLocalPart().compareTo( b.getName().getLocalPart() );
                }
                return order;
            }
        } );
        for ( FeatureType childType : fts ) {
File Line
org/deegree/console/featurestore/FeatureStoreConfig.java 180
org/deegree/console/featurestore/FeatureStoreConfig.java 207
    public String getFtInfo()
                            throws IOException {
        StringBuffer sb = new StringBuffer();
        FeatureStore fs = getFeatureStoreManager().get( getId() );
        AppSchema schema = fs.getSchema();
        FeatureType[] fts = schema.getRootFeatureTypes();

        // sort the types by name
        Arrays.sort( fts, new Comparator<FeatureType>() {
            public int compare( FeatureType a, FeatureType b ) {
                int order = a.getName().getNamespaceURI().compareTo( b.getName().getNamespaceURI() );
                if ( order == 0 ) {
                    order = a.getName().getLocalPart().compareTo( b.getName().getLocalPart() );
                }
                return order;
            }
        } );

        for ( FeatureType ft : fts ) {
File Line
org/deegree/console/featurestore/AppSchemaInfo.java 112
org/deegree/console/featurestore/AppSchemaInfo.java 138
        }
        FeatureType[] fts = ft.getSchema().getDirectSubtypes( ft );
        Arrays.sort( fts, new Comparator<FeatureType>() {
            public int compare( FeatureType a, FeatureType b ) {
                int order = a.getName().getNamespaceURI().compareTo( b.getName().getNamespaceURI() );
                if ( order == 0 ) {
                    order = a.getName().getLocalPart().compareTo( b.getName().getLocalPart() );
                }
                return order;
            }
        } );
        for ( FeatureType childType : fts ) {
            appendFtInfo( childType, sb, indent + "&nbsp;&nbsp;" );
        }
    }
File Line
org/deegree/console/featurestore/AppSchemaInfo.java 58
org/deegree/console/featurestore/AppSchemaInfo.java 81
    public String getFtInfo()
                            throws IOException {
        StringBuffer sb = new StringBuffer();
        FeatureType[] fts = schema.getRootFeatureTypes();

        // sort the types by name
        Arrays.sort( fts, new Comparator<FeatureType>() {
            public int compare( FeatureType a, FeatureType b ) {
                int order = a.getName().getNamespaceURI().compareTo( b.getName().getNamespaceURI() );
                if ( order == 0 ) {
                    order = a.getName().getLocalPart().compareTo( b.getName().getLocalPart() );
                }
                return order;
            }
        } );

        for ( FeatureType ft : fts ) {
File Line
org/deegree/console/featurestore/AppSchemaInfo.java 110
org/deegree/console/featurestore/FeatureStoreConfig.java 253
                sb.append( indent + "- " + ft.getName().getPrefix() + ":" + ft.getName().getLocalPart() + "<br/>" );
            }
        }
        FeatureType[] fts = ft.getSchema().getDirectSubtypes( ft );
        Arrays.sort( fts, new Comparator<FeatureType>() {
            public int compare( FeatureType a, FeatureType b ) {
                int order = a.getName().getNamespaceURI().compareTo( b.getName().getNamespaceURI() );
                if ( order == 0 ) {
                    order = a.getName().getLocalPart().compareTo( b.getName().getLocalPart() );
                }
                return order;
            }
        } );
        for ( FeatureType childType : fts ) {
            appendFtInfo( childType, sb, indent + "&nbsp;&nbsp;" );
File Line
org/deegree/console/featurestore/AppSchemaInfo.java 83
org/deegree/console/featurestore/FeatureStoreConfig.java 211
        StringBuffer sb = new StringBuffer();
        FeatureType[] fts = schema.getRootFeatureTypes();

        // sort the types by name
        Arrays.sort( fts, new Comparator<FeatureType>() {
            public int compare( FeatureType a, FeatureType b ) {
                int order = a.getName().getNamespaceURI().compareTo( b.getName().getNamespaceURI() );
                if ( order == 0 ) {
                    order = a.getName().getLocalPart().compareTo( b.getName().getLocalPart() );
                }
                return order;
            }
        } );

        for ( FeatureType ft : fts ) {
            appendFcInfo( ft, sb, "" );
File Line
org/deegree/console/featurestore/AppSchemaInfo.java 138
org/deegree/console/featurestore/FeatureStoreConfig.java 255
        }
        FeatureType[] fts = ft.getSchema().getDirectSubtypes( ft );
        Arrays.sort( fts, new Comparator<FeatureType>() {
            public int compare( FeatureType a, FeatureType b ) {
                int order = a.getName().getNamespaceURI().compareTo( b.getName().getNamespaceURI() );
                if ( order == 0 ) {
                    order = a.getName().getLocalPart().compareTo( b.getName().getLocalPart() );
                }
                return order;
            }
        } );
        for ( FeatureType childType : fts ) {
            appendFtInfo( childType, sb, indent + "&nbsp;&nbsp;" );
File Line
org/deegree/console/featurestore/FeatureStoreConfig.java 253
org/deegree/console/featurestore/FeatureStoreConfig.java 278
                           + " (not mapped)<br/>" );
            }
        }
        FeatureType[] fts = ft.getSchema().getDirectSubtypes( ft );
        Arrays.sort( fts, new Comparator<FeatureType>() {
            public int compare( FeatureType a, FeatureType b ) {
                int order = a.getName().getNamespaceURI().compareTo( b.getName().getNamespaceURI() );
                if ( order == 0 ) {
                    order = a.getName().getLocalPart().compareTo( b.getName().getLocalPart() );
                }
                return order;
            }
        } );
        for ( FeatureType childType : fts ) {
File Line
org/deegree/console/featurestore/AppSchemaInfo.java 138
org/deegree/console/featurestore/FeatureStoreConfig.java 280
        }
        FeatureType[] fts = ft.getSchema().getDirectSubtypes( ft );
        Arrays.sort( fts, new Comparator<FeatureType>() {
            public int compare( FeatureType a, FeatureType b ) {
                int order = a.getName().getNamespaceURI().compareTo( b.getName().getNamespaceURI() );
                if ( order == 0 ) {
                    order = a.getName().getLocalPart().compareTo( b.getName().getLocalPart() );
                }
                return order;
            }
        } );
        for ( FeatureType childType : fts ) {
File Line
org/deegree/console/Config.java 188
org/deegree/console/Config.java 206
            FacesMessage fm = new FacesMessage( SEVERITY_ERROR, "Unable to activate resource: " + t.getMessage(), null );
            FacesContext.getCurrentInstance().addMessage( null, fm );
            return;
        }
        state = resourceManager.getState( id );
        WorkspaceBean ws = (WorkspaceBean) FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().get( "workspace" );
        ws.setModified();
        if ( state.getLastException() != null ) {
            String msg = state.getLastException().getMessage();
            FacesMessage fm = new FacesMessage( SEVERITY_ERROR, msg, null );
            FacesContext.getCurrentInstance().addMessage( null, fm );
        }
    }

    public void deactivate() {
File Line
org/deegree/console/featurestore/AppSchemaInfo.java 60
org/deegree/console/featurestore/AppSchemaInfo.java 83
org/deegree/console/featurestore/FeatureStoreConfig.java 184
org/deegree/console/featurestore/FeatureStoreConfig.java 211
        StringBuffer sb = new StringBuffer();
        FeatureType[] fts = schema.getRootFeatureTypes();

        // sort the types by name
        Arrays.sort( fts, new Comparator<FeatureType>() {
            public int compare( FeatureType a, FeatureType b ) {
                int order = a.getName().getNamespaceURI().compareTo( b.getName().getNamespaceURI() );
                if ( order == 0 ) {
                    order = a.getName().getLocalPart().compareTo( b.getName().getLocalPart() );
                }
                return order;
            }
        } );

        for ( FeatureType ft : fts ) {
File Line
org/deegree/console/jdbc/ConnectionTester.java 70
org/deegree/console/jdbc/ConnectionTester.java 84
    public void test() {
        String id = (String) getParam1();
        try {
            ConnectionManager mgr = getWorkspace().getSubsystemManager( ConnectionManager.class );
            mgr.get( id ).close();
            FacesMessage fm = new FacesMessage( SEVERITY_INFO, "Connection '" + id + "' ok", null );
            FacesContext.getCurrentInstance().addMessage( null, fm );
        } catch ( Throwable t ) {
            FacesMessage fm = new FacesMessage( SEVERITY_ERROR, "Connection '" + id + "' unavailable: "
                                                                + t.getMessage(), null );
            FacesContext.getCurrentInstance().addMessage( null, fm );
        }