CPD Results

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

Duplications

FileLine
org/deegree/services/wps/capabilities/CapabilitiesXMLWriter.java145
org/deegree/services/wps/describeprocess/DescribeProcessResponseXMLAdapter.java139
            writer.writeAttribute( WPS_NS, "processVersion", processDef.getProcessVersion() );

            // "ows:Identifier" (minOccurs="1", maxOccurs="1")
            writer.writeStartElement( OWS_NS, "Identifier" );
            if ( processDef.getIdentifier().getCodeSpace() != null ) {
                writer.writeAttribute( "codeSpace", processDef.getIdentifier().getCodeSpace() );
            }
            writer.writeCharacters( processDef.getIdentifier().getValue() );
            writer.writeEndElement();

            // "ows:Title" (minOccurs="1", maxOccurs="1")
            if ( processDef.getTitle() != null ) {
                writer.writeStartElement( OWS_NS, "Title" );
                if ( processDef.getTitle().getLang() != null ) {
                    writer.writeAttribute( "xml:lang", processDef.getTitle().getLang() );
                }
                writer.writeCharacters( processDef.getTitle().getValue() );
                writer.writeEndElement();
            }

            // "ows:Abstract" (minOccurs="0", maxOccurs="1")
            if ( processDef.getAbstract() != null ) {
                writer.writeStartElement( OWS_NS, "Abstract" );
                if ( processDef.getAbstract().getLang() != null ) {
                    writer.writeAttribute( "xml:lang", processDef.getAbstract().getLang() );
                }
                writer.writeCharacters( processDef.getAbstract().getValue() );
                writer.writeEndElement();
            }

            // "ows:Metadata" (minOccurs="0", maxOccurs="unbounded")
            if ( processDef.getMetadata() != null ) {
                for ( Metadata metadata : processDef.getMetadata() ) {
                    writer.writeStartElement( OWS_NS, "Metadata" );
                    if ( metadata.getAbout() != null ) {
                        writer.writeAttribute( "about", metadata.getAbout() );
                    }
                    if ( metadata.getHref() != null ) {
                        writer.writeAttribute( XLN_NS, "href", metadata.getHref() );
                    }
                    writer.writeEndElement();
                }
            }

            // "wps:Profile" (minOccurs="0", maxOccurs="unbounded")
            if ( processDef.getProfile() != null ) {
                for ( String profile : processDef.getProfile() ) {
                    writeElement( writer, WPS_NS, "Profile", profile );
                }
            }

            // "wps:WSDL" (minOccurs="0", maxOccurs="unbounded")
            if ( processDef.getWSDL() != null ) {
FileLine
org/deegree/process/jaxb/java/LiteralInputDefinition.java247
org/deegree/process/jaxb/java/LiteralOutputDefinition.java161
    }


    /**
     * <p>Java class for anonymous complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;simpleContent>
     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
     *       &lt;attribute name="reference" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
     *     &lt;/extension>
     *   &lt;/simpleContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "value"
    })
    public static class DataType {

        @XmlValue
        protected String value;
        @XmlAttribute(name = "reference")
        @XmlSchemaType(name = "anySimpleType")
        protected String reference;

        /**
         * Gets the value of the value property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getValue() {
            return value;
        }

        /**
         * Sets the value of the value property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setValue(String value) {
            this.value = value;
        }

        /**
         * Gets the value of the reference property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getReference() {
            return reference;
        }

        /**
         * Sets the value of the reference property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setReference(String value) {
            this.reference = value;
        }

    }


    /**
     * <p>Java class for anonymous complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;simpleContent>
     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
     *       &lt;attribute name="reference" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
     *     &lt;/extension>
     *   &lt;/simpleContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "value"
    })
    public static class DefaultUOM {

        @XmlValue
        protected String value;
        @XmlAttribute(name = "reference")
        @XmlSchemaType(name = "anySimpleType")
        protected String reference;

        /**
         * Gets the value of the value property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getValue() {
            return value;
        }

        /**
         * Sets the value of the value property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setValue(String value) {
            this.value = value;
        }

        /**
         * Gets the value of the reference property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getReference() {
            return reference;
        }

        /**
         * Sets the value of the reference property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setReference(String value) {
            this.reference = value;
        }

    }


    /**
     * <p>Java class for anonymous complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;simpleContent>
     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
     *       &lt;attribute name="reference" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
     *     &lt;/extension>
     *   &lt;/simpleContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "value"
    })
    public static class OtherUOM {

        @XmlValue
        protected String value;
        @XmlAttribute(name = "reference")
        @XmlSchemaType(name = "anySimpleType")
        protected String reference;

        /**
         * Gets the value of the value property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getValue() {
            return value;
        }

        /**
         * Sets the value of the value property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setValue(String value) {
            this.value = value;
        }

        /**
         * Gets the value of the reference property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getReference() {
            return reference;
        }

        /**
         * Sets the value of the reference property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setReference(String value) {
            this.reference = value;
        }

    }

}
FileLine
org/deegree/services/wps/execute/ExecuteRequestKVPAdapter.java318
org/deegree/services/wps/execute/ExecuteRequestKVPAdapter.java397
            throw exceptionCustomizer.inputInvalidCombination( identifier, combi );
        }

        List<ComplexFormatType> matchingFormats = new LinkedList<ComplexFormatType>();
        for ( ComplexFormatType candidateFormat : equalMimeTypeAndSchema ) {
            if ( format.getEncoding() == null || format.getEncoding().equals( candidateFormat.getEncoding() ) ) {
                matchingFormats.add( candidateFormat );
            }
        }

        // no formats with specified mime type, schema and encoding found?
        if ( matchingFormats.isEmpty() ) {
            CodeType identifier = new CodeType( definition.getIdentifier().getValue(),
                                                definition.getIdentifier().getCodeSpace() );
            List<Pair<String, String>> combi = new ArrayList<Pair<String, String>>();
            combi.add( new Pair<String, String>( "mimetype", format.getMimeType() ) );
            combi.add( new Pair<String, String>( "schema", format.getSchema() ) );
            combi.add( new Pair<String, String>( "encoding", format.getEncoding() ) );
            throw exceptionCustomizer.inputInvalidCombination( identifier, combi );
FileLine
org/deegree/services/wps/execute/ExecuteRequestKVPAdapter.java299
org/deegree/services/wps/execute/ExecuteRequestKVPAdapter.java378
            throw exceptionCustomizer.inputInvalidParameter(
                                                             identifier,
                                                             new Pair<String, String>( "mimetype", format.getMimeType() ) );
        }

        List<ComplexFormatType> equalMimeTypeAndSchema = new LinkedList<ComplexFormatType>();
        for ( ComplexFormatType candidateFormat : equalMimeType ) {
            if ( format.getSchema() == null || format.getSchema().equals( candidateFormat.getSchema() ) ) {
                equalMimeTypeAndSchema.add( candidateFormat );
            }
        }

        // no matching formats (mime type and schema) found?
        if ( equalMimeTypeAndSchema.isEmpty() ) {
            CodeType identifier = new CodeType( definition.getIdentifier().getValue(),
                                                definition.getIdentifier().getCodeSpace() );
            List<Pair<String, String>> combi = new ArrayList<Pair<String, String>>();
            combi.add( new Pair<String, String>( "mimetype", format.getMimeType() ) );
            combi.add( new Pair<String, String>( "schema", format.getSchema() ) );
            throw exceptionCustomizer.inputInvalidCombination( identifier, combi );
FileLine
org/deegree/services/wps/execute/ExecuteRequestKVPAdapter.java274
org/deegree/services/wps/execute/ExecuteRequestKVPAdapter.java353
                                                               ComplexInputDefinition definition,
                                                               ExceptionCustomizer exceptionCustomizer )
                            throws OWSException {

        LOG.debug( "Looking up compatible format ('" + toString( format ) + "') in parameter definition." );
        List<ComplexFormatType> equalMimeType = null;
        if ( format.getMimeType() == null ) {
            // not specified -> assume mime type from default format
            equalMimeType = Collections.singletonList( definition.getDefaultFormat() );
        } else {
            equalMimeType = new LinkedList<ComplexFormatType>();
            if ( format.getMimeType().equals( definition.getDefaultFormat().getMimeType() ) ) {
                equalMimeType.add( definition.getDefaultFormat() );
            }
            for ( ComplexFormatType otherFormat : definition.getOtherFormats() ) {
                if ( format.getMimeType().equals( otherFormat.getMimeType() ) ) {
                    equalMimeType.add( format );
                }
            }
        }

        // no matching formats (mime type) found?
        if ( equalMimeType.isEmpty() ) {
            CodeType identifier = new CodeType( definition.getIdentifier().getValue(),
                                                definition.getIdentifier().getCodeSpace() );
            throw exceptionCustomizer.inputInvalidParameter(
FileLine
org/deegree/services/wps/execute/ExecuteRequestKVPAdapter.java191
org/deegree/services/wps/execute/ExecuteRequestXMLAdapter.java219
            processInputs.add( input );

            CodeType inputId = input.getIdentifier();
            Integer count = inputIdToCount.get( inputId );
            if ( count == null ) {
                count = 1;
            } else {
                count++;
            }
            inputIdToCount.put( inputId, count );
        }

        // validate cardinalities of present input parameters
        for ( JAXBElement<? extends ProcessletInputDefinition> el : processDef.getInputParameters().getProcessInput() ) {
            ProcessletInputDefinition inputDef = el.getValue();
            CodeType inputId = new CodeType( inputDef.getIdentifier().getValue(),
                                             inputDef.getIdentifier().getCodeSpace() );
            int minOccurs = inputDef.getMinOccurs() != null ? inputDef.getMinOccurs().intValue() : 1;
            int maxOccurs = inputDef.getMaxOccurs() != null ? inputDef.getMaxOccurs().intValue() : 1;
            int actualOccurs = inputIdToCount.get( inputId ) != null ? inputIdToCount.get( inputId ) : 0;
            if ( actualOccurs < minOccurs ) {
FileLine
org/deegree/services/wps/execute/ExecuteRequestXMLAdapter.java649
org/deegree/services/wps/execute/ExecuteRequestXMLAdapter.java718
            throw eCustomizer.inputInvalidCombination( getIdentifier( definition ), combi );
        }

        List<ComplexFormatType> matchingFormats = new LinkedList<ComplexFormatType>();
        for ( ComplexFormatType candidateFormat : equalMimeTypeAndSchema ) {
            if ( format.getEncoding() == null || format.getEncoding().equals( candidateFormat.getEncoding() ) ) {
                matchingFormats.add( candidateFormat );
            }
        }

        // no formats with specified mime type, schema and encoding found?
        if ( matchingFormats.isEmpty() ) {
            List<Pair<String, String>> combi = new ArrayList<Pair<String, String>>();
            combi.add( new Pair<String, String>( "mimetype", format.getMimeType() ) );
            combi.add( new Pair<String, String>( "schema", format.getSchema() ) );
            combi.add( new Pair<String, String>( "encoding", format.getEncoding() ) );
            throw eCustomizer.inputInvalidCombination( getIdentifier( definition ), combi );
FileLine
org/deegree/services/wps/execute/ExecuteRequestXMLAdapter.java633
org/deegree/services/wps/execute/ExecuteRequestXMLAdapter.java702
            throw eCustomizer.inputInvalidParameter( getIdentifier( definition ),
                                                     new Pair<String, String>( "mimetype", format.getMimeType() ) );
        }

        List<ComplexFormatType> equalMimeTypeAndSchema = new LinkedList<ComplexFormatType>();
        for ( ComplexFormatType candidateFormat : equalMimeType ) {
            if ( format.getSchema() == null || format.getSchema().equals( candidateFormat.getSchema() ) ) {
                equalMimeTypeAndSchema.add( candidateFormat );
            }
        }

        // no matching formats (mime type and schema) found?
        if ( equalMimeTypeAndSchema.isEmpty() ) {
            List<Pair<String, String>> combi = new ArrayList<Pair<String, String>>();
            combi.add( new Pair<String, String>( "mimetype", format.getMimeType() ) );
            combi.add( new Pair<String, String>( "schema", format.getSchema() ) );
            throw eCustomizer.inputInvalidCombination( getIdentifier( definition ), combi );
FileLine
org/deegree/services/wps/execute/ExecuteRequestXMLAdapter.java610
org/deegree/services/wps/execute/ExecuteRequestXMLAdapter.java679
    private ComplexFormatType validateAndAugmentFormat( ComplexFormatType format, ComplexInputDefinition definition,
                                                        ExceptionCustomizer eCustomizer )
                            throws OWSException {

        LOG.debug( "Looking up compatible format ('" + toString( format ) + "') in parameter definition." );
        List<ComplexFormatType> equalMimeType = null;
        if ( format.getMimeType() == null ) {
            // not specified -> assume mime type from default format
            equalMimeType = Collections.singletonList( definition.getDefaultFormat() );
        } else {
            equalMimeType = new LinkedList<ComplexFormatType>();
            if ( format.getMimeType().equals( definition.getDefaultFormat().getMimeType() ) ) {
                equalMimeType.add( definition.getDefaultFormat() );
            }
            for ( ComplexFormatType otherFormat : definition.getOtherFormats() ) {
                if ( format.getMimeType().equals( otherFormat.getMimeType() ) ) {
                    equalMimeType.add( format );
                }
            }
        }

        // no matching formats (mime type) found?
        if ( equalMimeType.isEmpty() ) {
            throw eCustomizer.inputInvalidParameter( getIdentifier( definition ),
FileLine
org/deegree/services/wps/execute/ExecuteRequestKVPAdapter.java275
org/deegree/services/wps/execute/ExecuteRequestKVPAdapter.java354
org/deegree/services/wps/execute/ExecuteRequestXMLAdapter.java611
org/deegree/services/wps/execute/ExecuteRequestXMLAdapter.java680
                                                               ExceptionCustomizer exceptionCustomizer )
                            throws OWSException {

        LOG.debug( "Looking up compatible format ('" + toString( format ) + "') in parameter definition." );
        List<ComplexFormatType> equalMimeType = null;
        if ( format.getMimeType() == null ) {
            // not specified -> assume mime type from default format
            equalMimeType = Collections.singletonList( definition.getDefaultFormat() );
        } else {
            equalMimeType = new LinkedList<ComplexFormatType>();
            if ( format.getMimeType().equals( definition.getDefaultFormat().getMimeType() ) ) {
                equalMimeType.add( definition.getDefaultFormat() );
            }
            for ( ComplexFormatType otherFormat : definition.getOtherFormats() ) {
                if ( format.getMimeType().equals( otherFormat.getMimeType() ) ) {
                    equalMimeType.add( format );
                }
            }
        }

        // no matching formats (mime type) found?
        if ( equalMimeType.isEmpty() ) {
FileLine
org/deegree/services/wps/describeprocess/DescribeProcessResponseXMLAdapter.java292
org/deegree/services/wps/describeprocess/DescribeProcessResponseXMLAdapter.java499
                org.deegree.process.jaxb.java.LiteralInputDefinition.DefaultUOM defaultUOM = literalData.getDefaultUOM();
                writer.writeStartElement( "UOMs" );

                // "Default" (minOccurs="1", maxOccurs="1")
                writer.writeStartElement( "Default" );
                // "ows:UOM" (minOccurs="1", maxOccurs="1")
                writer.writeStartElement( OWS_NS, "UOM" );
                if ( defaultUOM.getReference() != null ) {
                    writer.writeAttribute( OWS_NS, "reference", defaultUOM.getReference() );
                }
                writer.writeCharacters( defaultUOM.getValue() );
                writer.writeEndElement();
                writer.writeEndElement(); // Default

                // "Supported" (minOccurs="1", maxOccurs="1")
                writer.writeStartElement( "Supported" );
                // "ows:UOM" (minOccurs="1", maxOccurs="unbounded")
                writer.writeStartElement( OWS_NS, "UOM" );
                if ( defaultUOM.getReference() != null ) {
                    writer.writeAttribute( OWS_NS, "reference", defaultUOM.getReference() );
                }
                writer.writeCharacters( defaultUOM.getValue() );
                writer.writeEndElement(); // UOM
FileLine
org/deegree/process/jaxb/java/ProcessletInputDefinition.java234
org/deegree/process/jaxb/java/ProcessletOutputDefinition.java177
    }


    /**
     * <p>Java class for anonymous complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;complexContent>
     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       &lt;attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     *       &lt;attribute name="about" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "")
    public static class Metadata {

        @XmlAttribute(name = "href")
        @XmlSchemaType(name = "anyURI")
        protected String href;
        @XmlAttribute(name = "about")
        @XmlSchemaType(name = "anyURI")
        protected String about;

        /**
         * Gets the value of the href property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getHref() {
            return href;
        }

        /**
         * Sets the value of the href property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setHref(String value) {
            this.href = value;
        }

        /**
         * Gets the value of the about property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getAbout() {
            return about;
        }

        /**
         * Sets the value of the about property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setAbout(String value) {
            this.about = value;
        }

    }

}
FileLine
org/deegree/process/jaxb/java/ProcessDefinition.java524
org/deegree/process/jaxb/java/ProcessletInputDefinition.java234
org/deegree/process/jaxb/java/ProcessletOutputDefinition.java177
    }


    /**
     * <p>Java class for anonymous complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;complexContent>
     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       &lt;attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     *       &lt;attribute name="about" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "")
    public static class Metadata {

        @XmlAttribute(name = "href")
        @XmlSchemaType(name = "anyURI")
        protected String href;
        @XmlAttribute(name = "about")
        @XmlSchemaType(name = "anyURI")
        protected String about;

        /**
         * Gets the value of the href property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getHref() {
            return href;
        }

        /**
         * Sets the value of the href property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setHref(String value) {
            this.href = value;
        }

        /**
         * Gets the value of the about property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getAbout() {
            return about;
        }

        /**
         * Sets the value of the about property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setAbout(String value) {
            this.about = value;
        }

    }