CPD Resultaten

Het volgende document bevat de resultaten van PMD's CPD 6.21.0.

Dubbelingen

Bestand Regel
nl/geozet/openls/parser/OpenLSRequestParser.java 98
nl/geozet/openls/parser/OpenLSResponseParser.java 137
        } else if (eName.equalsIgnoreCase("Address")) {
            Address obj = new Address();
            objStack.push(obj);
            for (int i = 0; i < attributes.getLength(); i++) {
                String key = attributes.getQName(i);
                String value = attributes.getValue(i);
                if (key.equalsIgnoreCase("countryCode")) {
                    obj.setCountryCode(value);
                }
            }
        } else if (eName.equalsIgnoreCase("StreetAddress")) {
            StreetAddress obj = new StreetAddress();
            objStack.push(obj);
        } else if (eName.equalsIgnoreCase("Building")) {
            Building obj = new Building();
            objStack.push(obj);
            for (int i = 0; i < attributes.getLength(); i++) {
                String key = attributes.getQName(i);
                String value = attributes.getValue(i);
                if (key.equalsIgnoreCase("number")) {
                    obj.setNumber(value);
                }
            }
        } else if (eName.equalsIgnoreCase("Street")) {
            Street obj = new Street();
            objStack.push(obj);
        } else if (eName.equalsIgnoreCase("Place")) {
            Place obj = new Place();
            objStack.push(obj);
            for (int i = 0; i < attributes.getLength(); i++) {
                String key = attributes.getQName(i);
                String value = attributes.getValue(i);
                if (key.equalsIgnoreCase("type")) {
                    obj.setType(value);
                }
            }
        } else if (eName.equalsIgnoreCase("PostalCode")) {
            PostalCode obj = new PostalCode();
            objStack.push(obj);
        }
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String,
     * java.lang.String, java.lang.String)
     */
    @Override
    public void endElement(String uri, String localName, String qName) {
        String[] nsName = qName.split(":");
        String eName;
        if (nsName.length > 1) {
            eName = nsName[1];
        } else {
            eName = nsName[0];
        }
        if (eName.equalsIgnoreCase("Address")) {
Bestand Regel
nl/geozet/openls/parser/OpenLSRequestParser.java 158
nl/geozet/openls/parser/OpenLSResponseParser.java 220
                ((GeocodeRequest) (objStack.peek())).addAddress(obj);
            }
        } else if (eName.equalsIgnoreCase("StreetAddress")) {
            StreetAddress obj = (StreetAddress) (objStack.pop());
            if (objStack.peek().getClass() == Address.class) {
                ((Address) (objStack.peek())).setStreetAddress(obj);
            }
        } else if (eName.equalsIgnoreCase("Building")) {
            Building obj = (Building) (objStack.pop());
            if (objStack.peek().getClass() == StreetAddress.class) {
                ((StreetAddress) (objStack.peek())).setBuilding(obj);
            }
        } else if (eName.equalsIgnoreCase("Street")) {
            Street obj = (Street) (objStack.pop());
            obj.setStreet(eValBuf.toString());
            if (objStack.peek().getClass() == StreetAddress.class) {
                ((StreetAddress) (objStack.peek())).setStreet(obj);
            }
        } else if (eName.equalsIgnoreCase("Place")) {
            Place obj = (Place) (objStack.pop());
            obj.setPlace(eValBuf.toString());
            if (objStack.peek().getClass() == Address.class) {
                ((Address) (objStack.peek())).addPlace(obj);
            }
        } else if (eName.equalsIgnoreCase("PostalCode")) {
            PostalCode obj = (PostalCode) (objStack.pop());
            obj.setPostalCode(eValBuf.toString());
            if (objStack.peek().getClass() == Address.class) {
                ((Address) (objStack.peek())).setPostalCode(obj);
            }
        }
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int)
     */
    public void characters(char[] ch, int start, int length) {
        eValBuf.append(ch, start, length);
    }

    /**
     * Gets the geocode request.
     * 
     * @return the geocode request
     */
    public GeocodeRequest getGeocodeRequest() {