CPD Results

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

Duplications

File Line
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 427
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 472
private synchronized Path2D.Float readPolyLine(final ObjectEndianInputStream input, final boolean skipBoundingBox)
            throws IOException
    {
        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;

        Path2D.Float result = new Path2D.Float(Path2D.WIND_NON_ZERO);
        for (int i = 0; i < numParts; i++)
        {
            Path2D path = new Path2D.Float();
            FloatXY mf = this.coordinateTransform.floatTransform(input.readDouble(), input.readDouble());
            path.moveTo(mf.x(), mf.y());
            FloatXY lf = null;
            for (int ii = (partBegin[i] + 1); ii < partBegin[i + 1]; ii++)
            {
                lf = this.coordinateTransform.floatTransform(input.readDouble(), input.readDouble());
                path.lineTo(lf.x(), lf.y());
            }
            if (mf.equals(lf))
                path.closePath();
            result.append(path, false);
        }
        return result;
    }

    /**
     * reads a Polygon.
     * @param input the inputStream
     * @param skipBoundingBox 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 Path2D.Float readPolygon(final ObjectEndianInputStream input, final boolean skipBoundingBox)
File Line
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 558
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 691
private synchronized Path2D.Float readPolyLineZ(final ObjectEndianInputStream input, final int contentLength,
            final boolean skipBoundingBox) throws IOException
    {
        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;

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

        return result;
    }

    /**
     * reads a readPolygonZ.
     * @param input the inputStream
     * @param contentLength the contentLength
     * @param skipBoundingBox 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 Path2D.Float readPolygonZ(final ObjectEndianInputStream input, final int contentLength,
File Line
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 558
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 604
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 691
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 735
private synchronized Path2D.Float readPolyLineZ(final ObjectEndianInputStream input, final int contentLength,
            final boolean skipBoundingBox) throws IOException
    {
        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;

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

        return result;
    }

    /**
     * reads a readPolygonZ.
     * @param input the inputStream
     * @param contentLength the contentLength
     * @param skipBoundingBox 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 Path2D.Float readPolygonZ(final ObjectEndianInputStream input, final int contentLength,
File Line
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 649
nl/tudelft/simulation/dsol/animation/gis/esri/ShapeFileReader.java 780
private synchronized Point2D[] readMultiPointZ(final ObjectEndianInputStream input, final int contentLength,
            final boolean skipBoundingBox) throws IOException
    {
        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 the inputStream
     * @param contentLength the contentLength
     * @return the java2D PointShape
     * @throws IOException on file IO or database connection failure
     */
    private synchronized Point2D readPointM(final ObjectEndianInputStream input, final int contentLength) throws IOException