CPD Results

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

Duplications

File Line
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 550
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 687
private synchronized Object readPolyLineZ(final ObjectEndianInputStream input, final int contentLength,
            final boolean skipBoundingBox) throws IOException
    {
        this.currentType = GisMapInterface.LINE;
        if (skipBoundingBox)
        {
            input.skipBytes(32);
        }
        input.setEndianness(Endianness.LITTLE_ENDIAN);
        int numParts = input.readInt();
        int numPoints = input.readInt();
        int byteCounter = 44;
        int[] partBegin = new int[numParts + 1];

        for (int i = 0; i < partBegin.length - 1; i++)
        {
            partBegin[i] = input.readInt();
            byteCounter += 4;
        }
        partBegin[partBegin.length - 1] = numPoints;

        SerializablePath result = new SerializablePath(Path2D.WIND_NON_ZERO, numPoints);
        for (int i = 0; i < numParts; i++)
        {
            float[] mf = this.coordinateTransform.floatTransform(input.readDouble(), input.readDouble());
            result.moveTo(mf[0], mf[1]);
            byteCounter += 16;
            for (int ii = (partBegin[i] + 1); ii < partBegin[i + 1]; ii++)
            {
                float[] lf = this.coordinateTransform.floatTransform(input.readDouble(), input.readDouble());
                result.lineTo(lf[0], lf[1]);
                byteCounter += 16;
            }
        }
        input.skipBytes((contentLength * 2) - byteCounter);

        return result;
    }

    /**
     * reads a readPolygonZ.
     * @param input ObjectEndianInputStream; the inputStream
     * @param contentLength int; the contentLength
     * @param skipBoundingBox boolean; whether to skip the bytes of the bounding box because they have not yet been read
     * @return the java2D PointShape
     * @throws IOException on file IO or database connection failure
     */
    private synchronized Object readPolygonZ(final ObjectEndianInputStream input, final int contentLength,
File Line
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 597
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 732
private synchronized Object readPolygonZ(final ObjectEndianInputStream input, final int contentLength,
            final boolean skipBoundingBox) throws IOException
    {
        this.currentType = GisMapInterface.POLYGON;
        if (skipBoundingBox)
        {
            input.skipBytes(32);
        }
        input.setEndianness(Endianness.LITTLE_ENDIAN);
        int numParts = input.readInt();
        int numPoints = input.readInt();
        int byteCounter = 44;
        int[] partBegin = new int[numParts + 1];
        for (int i = 0; i < partBegin.length - 1; i++)
        {
            partBegin[i] = input.readInt();
            byteCounter += 4;
        }
        partBegin[partBegin.length - 1] = numPoints;

        SerializablePath result = new SerializablePath(Path2D.WIND_NON_ZERO, numPoints);
        for (int i = 0; i < numParts; i++)
        {
            float[] mf = this.coordinateTransform.floatTransform(input.readDouble(), input.readDouble());
            result.moveTo(mf[0], mf[1]);
            byteCounter += 16;
            for (int ii = (partBegin[i] + 1); ii < partBegin[i + 1]; ii++)
            {
                float[] lf = this.coordinateTransform.floatTransform(input.readDouble(), input.readDouble());
                result.lineTo(lf[0], lf[1]);
                byteCounter += 16;
            }
        }
        input.skipBytes((contentLength * 2) - byteCounter);

        return result;
    }

    /**
     * reads a readMultiPointZ.
     * @param input ObjectEndianInputStream; the inputStream
     * @param contentLength int; the contentLength
     * @param skipBoundingBox boolean; whether to skip the bytes of the bounding box because they have not yet been read
     * @return the java2D PointShape
     * @throws IOException on file IO or database connection failure
     */
    private synchronized Object readMultiPointZ(final ObjectEndianInputStream input, final int contentLength,
File Line
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 554
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 601
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 691
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 736
if (skipBoundingBox)
        {
            input.skipBytes(32);
        }
        input.setEndianness(Endianness.LITTLE_ENDIAN);
        int numParts = input.readInt();
        int numPoints = input.readInt();
        int byteCounter = 44;
        int[] partBegin = new int[numParts + 1];

        for (int i = 0; i < partBegin.length - 1; i++)
        {
            partBegin[i] = input.readInt();
            byteCounter += 4;
        }
        partBegin[partBegin.length - 1] = numPoints;

        SerializablePath result = new SerializablePath(Path2D.WIND_NON_ZERO, numPoints);
        for (int i = 0; i < numParts; i++)
        {
            float[] mf = this.coordinateTransform.floatTransform(input.readDouble(), input.readDouble());
            result.moveTo(mf[0], mf[1]);
            byteCounter += 16;
            for (int ii = (partBegin[i] + 1); ii < partBegin[i + 1]; ii++)
            {
                float[] lf = this.coordinateTransform.floatTransform(input.readDouble(), input.readDouble());
                result.lineTo(lf[0], lf[1]);
                byteCounter += 16;
            }
        }
        input.skipBytes((contentLength * 2) - byteCounter);

        return result;
    }

    /**
     * reads a readPolygonZ.
     * @param input ObjectEndianInputStream; the inputStream
     * @param contentLength int; the contentLength
     * @param skipBoundingBox boolean; whether to skip the bytes of the bounding box because they have not yet been read
     * @return the java2D PointShape
     * @throws IOException on file IO or database connection failure
     */
    private synchronized Object readPolygonZ(final ObjectEndianInputStream input, final int contentLength,
File Line
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 430
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 471
if (skipBoundingBox)
        {
            input.skipBytes(32);
        }
        input.setEndianness(Endianness.LITTLE_ENDIAN);
        int numParts = input.readInt();
        int numPoints = input.readInt();
        int[] partBegin = new int[numParts + 1];

        for (int i = 0; i < partBegin.length - 1; i++)
        {
            partBegin[i] = input.readInt();

        }
        partBegin[partBegin.length - 1] = numPoints;

        SerializablePath result = new SerializablePath(Path2D.WIND_NON_ZERO, numPoints);
        for (int i = 0; i < numParts; i++)
        {
            float[] mf = this.coordinateTransform.floatTransform(input.readDouble(), input.readDouble());
            result.moveTo(mf[0], mf[1]);
            for (int ii = (partBegin[i] + 1); ii < partBegin[i + 1]; ii++)
            {
                float[] lf = this.coordinateTransform.floatTransform(input.readDouble(), input.readDouble());
                result.lineTo(lf[0], lf[1]);
            }
        }
        return result;
    }

    /**
     * reads a Polygon.
     * @param input ObjectEndianInputStream; the inputStream
     * @param skipBoundingBox boolean; whether to skip the bytes of the bounding box because they have not yet been read
     * @return the java2D PointShape
     * @throws IOException on file IO or database connection failure
     */
    private synchronized Object readPolygon(final ObjectEndianInputStream input, final boolean skipBoundingBox)
File Line
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 643
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 778
private synchronized Object readMultiPointZ(final ObjectEndianInputStream input, final int contentLength,
            final boolean skipBoundingBox) throws IOException
    {
        this.currentType = GisMapInterface.POINT;
        if (skipBoundingBox)
        {
            input.skipBytes(32);
        }
        input.setEndianness(Endianness.LITTLE_ENDIAN);
        Point2D[] result = new Point2D.Double[input.readInt()];
        int byteCounter = 40;
        for (int i = 0; i < result.length; i++)
        {
            result[i] = (Point2D) readPoint(input);
            byteCounter += 16;
        }
        input.skipBytes((contentLength * 2) - byteCounter);

        return result;
    }

    /**
     * reads a readPointM.
     * @param input ObjectEndianInputStream; the inputStream
     * @param contentLength int; the contentLength
     * @return the java2D PointShape
     * @throws IOException on file IO or database connection failure
     */
    private synchronized Object readPointM(final ObjectEndianInputStream input, final int contentLength) throws IOException