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.java269
    }

    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.java180
org/deegree/console/featurestore/FeatureStoreConfig.java207
    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.java253
                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.java211
        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.java255
        }
        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.java253
org/deegree/console/featurestore/FeatureStoreConfig.java278
                           + " (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.java280
        }
        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.java184
org/deegree/console/featurestore/FeatureStoreConfig.java211
        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/jdbc/ConnectionTester.java70
org/deegree/console/jdbc/ConnectionTester.java84
    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 );
        }