CPD Results

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

Duplications

FileLine
org/deegree/wps/jts/CentroidProcesslet.java97
org/deegree/wps/jts/ConvexHullProcesslet.java90
        return inputGeometry.getCentroid();
    }

    private void writeGeometry( ComplexOutput gmlOutput, Geometry geometry )
                            throws ProcessletException {
        try {
            SchemaLocationXMLStreamWriter sw = new SchemaLocationXMLStreamWriter( gmlOutput.getXMLStreamWriter(),
                                                                    "http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/base/geometryAggregates.xsd" );
            sw.setPrefix( "gml", GMLNS );
            GMLStreamWriter gmlWriter = GMLOutputFactory.createGMLStreamWriter( GML_31, sw );
            gmlWriter.write( geometry );
        } catch ( Exception e ) {
            throw new ProcessletException( "Error exporting geometry: " + e.getMessage() );
        }

    }

    private Geometry readGeometry( ComplexInput gmlInput1 )
                            throws ProcessletException {
        try {
            XMLStreamReader xmlReader = gmlInput1.getValueAsXMLStream();
            GMLStreamReader gmlReader = GMLInputFactory.createGMLStreamReader( GML_31, xmlReader );
            return gmlReader.readGeometry();
        } catch ( Exception e ) {
            throw new ProcessletException( "Error parsing parameter " + gmlInput1.getIdentifier() + ": "
                                           + e.getMessage() );
        }
    }

}
FileLine
org/deegree/wps/jts/DifferenceProcesslet.java92
org/deegree/wps/jts/UnionProcesslet.java92
        writeGeometry( differenceOutput, difference );
    }

    private void writeGeometry( ComplexOutput gmlOutput, Geometry geometry )
                            throws ProcessletException {
        try {
            SchemaLocationXMLStreamWriter sw = new SchemaLocationXMLStreamWriter( gmlOutput.getXMLStreamWriter(),
                                                                    "http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/base/geometryAggregates.xsd" );
            sw.setPrefix( "gml", GMLNS );
            GMLStreamWriter gmlWriter = GMLOutputFactory.createGMLStreamWriter( GML_31, sw );
            gmlWriter.write( geometry );
        } catch ( Exception e ) {
            throw new ProcessletException( "Error exporting geometry: " + e.getMessage() );
        }
    }

    private Geometry readGeometry( ComplexInput gmlInput )
                            throws ProcessletException {
        try {
            XMLStreamReader xmlReader = gmlInput.getValueAsXMLStream();
            GMLStreamReader gmlReader = GMLInputFactory.createGMLStreamReader( GML_31, xmlReader );
            return gmlReader.readGeometry();
        } catch ( Exception e ) {
            throw new ProcessletException( "Error parsing parameter " + gmlInput.getIdentifier() + ": "
                                           + e.getMessage() );
        }
    }

}