CPD Results

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

Duplications

FileLine
org/deegree/console/featurestore/AppSchemaInfo.java101
org/deegree/console/featurestore/FeatureStoreConfig.java264
    }

    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 ) {
FileLine
org/deegree/console/featurestore/FeatureStoreConfig.java175
org/deegree/console/featurestore/FeatureStoreConfig.java202
    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 ) {
FileLine
org/deegree/console/featurestore/AppSchemaInfo.java112
org/deegree/console/featurestore/AppSchemaInfo.java138
        }
        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;" );
        }
    }
FileLine
org/deegree/console/featurestore/AppSchemaInfo.java58
org/deegree/console/featurestore/AppSchemaInfo.java81
    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 ) {
FileLine
org/deegree/console/featurestore/AppSchemaInfo.java110
org/deegree/console/featurestore/FeatureStoreConfig.java248
                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;" );
FileLine
org/deegree/console/featurestore/AppSchemaInfo.java83
org/deegree/console/featurestore/FeatureStoreConfig.java206
        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, "" );
FileLine
org/deegree/console/featurestore/AppSchemaInfo.java138
org/deegree/console/featurestore/FeatureStoreConfig.java250
        }
        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;" );
FileLine
org/deegree/console/featurestore/FeatureStoreConfig.java248
org/deegree/console/featurestore/FeatureStoreConfig.java273
                           + " (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 ) {
FileLine
org/deegree/console/featurestore/AppSchemaInfo.java138
org/deegree/console/featurestore/FeatureStoreConfig.java275
        }
        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 ) {
FileLine
org/deegree/console/Config.java188
org/deegree/console/Config.java206
            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() {
FileLine
org/deegree/console/featurestore/AppSchemaInfo.java60
org/deegree/console/featurestore/AppSchemaInfo.java83
org/deegree/console/featurestore/FeatureStoreConfig.java179
org/deegree/console/featurestore/FeatureStoreConfig.java206
        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 ) {