CPD Results

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

Duplications

File Line
org/deegree/style/se/parser/PostgreSQLWriter.java 185
org/deegree/style/se/parser/PostgreSQLWriter.java 415
                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 )
File Line
org/deegree/style/se/parser/GraphicSymbologyParser.java 182
org/deegree/style/se/parser/SymbologyParser.java 780
                            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>() {
File Line
org/deegree/style/se/parser/PostgreSQLWriter.java 637
org/deegree/style/se/parser/PostgreSQLWriter.java 707
                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 ) {
File Line
org/deegree/style/se/parser/GraphicSymbologyParser.java 205
org/deegree/style/se/parser/SymbologyParser.java 603
                            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 );
            }
        }
File Line
org/deegree/style/se/parser/PostgreSQLWriter.java 460
org/deegree/style/se/parser/PostgreSQLWriter.java 509
            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 )
File Line
org/deegree/style/se/parser/PostgreSQLWriter.java 187
org/deegree/style/se/parser/PostgreSQLWriter.java 259
org/deegree/style/se/parser/PostgreSQLWriter.java 417
                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 )
File Line
org/deegree/style/se/parser/PostgreSQLWriter.java 146
org/deegree/style/se/parser/PostgreSQLWriter.java 188
org/deegree/style/se/parser/PostgreSQLWriter.java 260
org/deegree/style/se/parser/PostgreSQLWriter.java 418
            }
            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 )
File Line
org/deegree/style/se/parser/PostgreSQLWriter.java 297
org/deegree/style/se/parser/PostgreSQLWriter.java 338
org/deegree/style/se/parser/PostgreSQLWriter.java 378
org/deegree/style/se/parser/PostgreSQLWriter.java 460
org/deegree/style/se/parser/PostgreSQLWriter.java 509
            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 )
File Line
org/deegree/style/se/parser/PostgreSQLWriter.java 147
org/deegree/style/se/parser/PostgreSQLWriter.java 189
org/deegree/style/se/parser/PostgreSQLWriter.java 261
org/deegree/style/se/parser/PostgreSQLWriter.java 299
org/deegree/style/se/parser/PostgreSQLWriter.java 340
org/deegree/style/se/parser/PostgreSQLWriter.java 380
org/deegree/style/se/parser/PostgreSQLWriter.java 420
org/deegree/style/se/parser/PostgreSQLWriter.java 462
org/deegree/style/se/parser/PostgreSQLWriter.java 511
            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 )
File Line
org/deegree/style/se/parser/PostgreSQLWriter.java 187
org/deegree/style/se/parser/PostgreSQLWriter.java 259
org/deegree/style/se/parser/PostgreSQLWriter.java 417
org/deegree/style/se/parser/PostgreSQLWriter.java 570
                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 )
File Line
org/deegree/style/se/parser/PostgreSQLWriter.java 146
org/deegree/style/se/parser/PostgreSQLWriter.java 571
            }
            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 )
File Line
org/deegree/style/se/parser/PostgreSQLWriter.java 299
org/deegree/style/se/parser/PostgreSQLWriter.java 340
org/deegree/style/se/parser/PostgreSQLWriter.java 380
org/deegree/style/se/parser/PostgreSQLWriter.java 462
org/deegree/style/se/parser/PostgreSQLWriter.java 511
org/deegree/style/se/parser/PostgreSQLWriter.java 573
            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 )