CPD Results

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

Duplications

FileLine
org/deegree/style/se/parser/PostgreSQLWriter.java185
org/deegree/style/se/parser/PostgreSQLWriter.java415
                stmt.setInt( 2, write( conn, fill.graphic ) );
            } else {
                stmt.setNull( 2, INTEGER );
            }
            rs = stmt.executeQuery();
            if ( rs.next() ) {
                return rs.getInt( 1 );
            }
            return -1;
        } finally {
            if ( rs != null ) {
                try {
                    rs.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
            if ( stmt != null ) {
                try {
                    stmt.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
        }
    }

    private int write( Connection conn, Stroke stroke )
FileLine
org/deegree/style/se/parser/GraphicSymbologyParser.java182
org/deegree/style/se/parser/SymbologyParser.java780
                            public void update( Graphic obj, String val ) {
                                obj.anchorPointY = Double.parseDouble( val );
                            }
                        }, contn ).second;
                    } else if ( in.isStartElement() ) {
                        Location loc = in.getLocation();
                        LOG.error( "Found unknown element '{}' at line {}, column {}, skipping.",
                                   new Object[] { in.getLocalName(), loc.getLineNumber(), loc.getColumnNumber() } );
                        skipElement( in );
                    }
                }
            } else if ( in.getLocalName().equals( "Displacement" ) ) {
                while ( !( in.isEndElement() && in.getLocalName().equals( "Displacement" ) ) ) {
                    in.nextTag();

                    if ( in.getLocalName().equals( "DisplacementX" ) ) {
                        contn = context.parser.updateOrContinue( in, "DisplacementX", base, new Updater<Graphic>() {
FileLine
org/deegree/style/se/parser/PostgreSQLWriter.java637
org/deegree/style/se/parser/PostgreSQLWriter.java707
                stmt.setString( 5, name );
            }

            stmt.executeUpdate();
            conn.commit();
        } catch ( SQLException e ) {
            LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
            LOG.trace( "Stack trace:", e );
        } finally {
            if ( stmt != null ) {
                try {
                    stmt.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
            if ( conn != null ) {
                try {
                    conn.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
        }
    }

    /**
     * @param style
     * @param name
     */
    public void write( Style style, String name ) {
FileLine
org/deegree/style/se/parser/GraphicSymbologyParser.java205
org/deegree/style/se/parser/SymbologyParser.java603
                            public void update( Graphic obj, String val ) {
                                obj.displacementY = Double.parseDouble( val );
                            }
                        }, contn ).second;
                    } else if ( in.isStartElement() ) {
                        Location loc = in.getLocation();
                        LOG.error( "Found unknown element '{}' at line {}, column {}, skipping.",
                                   new Object[] { in.getLocalName(), loc.getLineNumber(), loc.getColumnNumber() } );
                        skipElement( in );
                    }
                }
            } else if ( in.isStartElement() ) {
                Location loc = in.getLocation();
                LOG.error( "Found unknown element '{}' at line {}, column {}, skipping.",
                           new Object[] { in.getLocalName(), loc.getLineNumber(), loc.getColumnNumber() } );
                skipElement( in );
            }
        }
FileLine
org/deegree/style/se/parser/PostgreSQLWriter.java460
org/deegree/style/se/parser/PostgreSQLWriter.java509
            stmt.setDouble( 3, styling.perpendicularOffset );

            rs = stmt.executeQuery();
            if ( rs.next() ) {
                return rs.getInt( 1 );
            }
            return -1;
        } finally {
            if ( rs != null ) {
                try {
                    rs.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
            if ( stmt != null ) {
                try {
                    stmt.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
        }
    }

    private int write( Connection conn, PolygonStyling styling )
FileLine
org/deegree/style/se/parser/PostgreSQLWriter.java187
org/deegree/style/se/parser/PostgreSQLWriter.java259
org/deegree/style/se/parser/PostgreSQLWriter.java417
                stmt.setNull( 2, INTEGER );
            }
            rs = stmt.executeQuery();
            if ( rs.next() ) {
                return rs.getInt( 1 );
            }
            return -1;
        } finally {
            if ( rs != null ) {
                try {
                    rs.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
            if ( stmt != null ) {
                try {
                    stmt.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
        }
    }

    private int write( Connection conn, Stroke stroke )
FileLine
org/deegree/style/se/parser/PostgreSQLWriter.java146
org/deegree/style/se/parser/PostgreSQLWriter.java188
org/deegree/style/se/parser/PostgreSQLWriter.java260
org/deegree/style/se/parser/PostgreSQLWriter.java418
            }
            rs = stmt.executeQuery();
            if ( rs.next() ) {
                return rs.getInt( 1 );
            }
            return -1;
        } finally {
            if ( rs != null ) {
                try {
                    rs.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
            if ( stmt != null ) {
                try {
                    stmt.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
        }
    }

    private int write( Connection conn, Fill fill )
FileLine
org/deegree/style/se/parser/PostgreSQLWriter.java297
org/deegree/style/se/parser/PostgreSQLWriter.java338
org/deegree/style/se/parser/PostgreSQLWriter.java378
org/deegree/style/se/parser/PostgreSQLWriter.java460
org/deegree/style/se/parser/PostgreSQLWriter.java509
            stmt.setDouble( 4, font.fontSize );

            rs = stmt.executeQuery();
            if ( rs.next() ) {
                return rs.getInt( 1 );
            }
            return -1;
        } finally {
            if ( rs != null ) {
                try {
                    rs.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
            if ( stmt != null ) {
                try {
                    stmt.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
        }
    }

    private int write( Connection conn, LinePlacement lineplacement )
FileLine
org/deegree/style/se/parser/PostgreSQLWriter.java147
org/deegree/style/se/parser/PostgreSQLWriter.java189
org/deegree/style/se/parser/PostgreSQLWriter.java261
org/deegree/style/se/parser/PostgreSQLWriter.java299
org/deegree/style/se/parser/PostgreSQLWriter.java340
org/deegree/style/se/parser/PostgreSQLWriter.java380
org/deegree/style/se/parser/PostgreSQLWriter.java420
org/deegree/style/se/parser/PostgreSQLWriter.java462
org/deegree/style/se/parser/PostgreSQLWriter.java511
            rs = stmt.executeQuery();
            if ( rs.next() ) {
                return rs.getInt( 1 );
            }
            return -1;
        } finally {
            if ( rs != null ) {
                try {
                    rs.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
            if ( stmt != null ) {
                try {
                    stmt.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
        }
    }

    private int write( Connection conn, Fill fill )
FileLine
org/deegree/style/se/parser/PostgreSQLWriter.java187
org/deegree/style/se/parser/PostgreSQLWriter.java259
org/deegree/style/se/parser/PostgreSQLWriter.java417
org/deegree/style/se/parser/PostgreSQLWriter.java570
                stmt.setNull( 2, INTEGER );
            }
            rs = stmt.executeQuery();
            if ( rs.next() ) {
                return rs.getInt( 1 );
            }
            return -1;
        } finally {
            if ( rs != null ) {
                try {
                    rs.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
            if ( stmt != null ) {
                try {
                    stmt.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
        }
    }

    private int write( Connection conn, Stroke stroke )
FileLine
org/deegree/style/se/parser/PostgreSQLWriter.java146
org/deegree/style/se/parser/PostgreSQLWriter.java571
            }
            rs = stmt.executeQuery();
            if ( rs.next() ) {
                return rs.getInt( 1 );
            }
            return -1;
        } finally {
            if ( rs != null ) {
                try {
                    rs.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
            if ( stmt != null ) {
                try {
                    stmt.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
        }
    }

    private int write( Connection conn, Fill fill )
FileLine
org/deegree/style/se/parser/PostgreSQLWriter.java299
org/deegree/style/se/parser/PostgreSQLWriter.java340
org/deegree/style/se/parser/PostgreSQLWriter.java380
org/deegree/style/se/parser/PostgreSQLWriter.java462
org/deegree/style/se/parser/PostgreSQLWriter.java511
org/deegree/style/se/parser/PostgreSQLWriter.java573
            rs = stmt.executeQuery();
            if ( rs.next() ) {
                return rs.getInt( 1 );
            }
            return -1;
        } finally {
            if ( rs != null ) {
                try {
                    rs.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
            if ( stmt != null ) {
                try {
                    stmt.close();
                } catch ( SQLException e ) {
                    LOG.info( "Unable to write style to DB: '{}'.", e.getLocalizedMessage() );
                    LOG.trace( "Stack trace:", e );
                }
            }
        }
    }

    private int write( Connection conn, LinePlacement lineplacement )