CPD Results

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

Duplications

FileLine
org/deegree/tools/crs/ConfigurationConverger.java127
org/deegree/tools/crs/CoordinateTransform.java156
                            throws Exception {
        CommandLineParser parser = new PosixParser();

        Options options = initOptions();
        boolean verbose = false;

        // for the moment, using the CLI API there is no way to respond to a help argument; see
        // https://issues.apache.org/jira/browse/CLI-179
        if ( args != null && args.length > 0 ) {
            for ( String a : args ) {
                if ( a != null && a.toLowerCase().contains( "help" ) || "-?".equals( a ) ) {
                    printHelp( options );
                }
            }
        }
        CommandLine line = null;
        try {
            line = parser.parse( options, args );
            verbose = line.hasOption( OPT_VERBOSE );
            init( line );
        } catch ( ParseException exp ) {
            System.err.println( "ERROR: Invalid command line: " + exp.getMessage() );
            printHelp( options );
        } catch ( Exception e ) {
FileLine
org/deegree/tools/feature/gml/ApplicationSchemaTool.java578
org/deegree/tools/feature/persistence/FeatureStoreLoader.java197
                mapToPostGIS( inputFormat, inputFileName, rulesFileName );
                break;
            }
        } catch ( ParseException exp ) {
            System.err.println( Messages.getMessage( "TOOL_COMMANDLINE_ERROR", exp.getMessage() ) );
            // printHelp( options );
        }
    }

    private static Options initOptions() {

        Options opts = new Options();

        String actionsList = "";
        Action[] actions = Action.values();
        actionsList += actions[0].toString();
        for ( int i = 1; i < actions.length; i++ ) {
            actionsList += ", " + actions[i];
        }

        Option opt = new Option( OPT_ACTION, true, "action, one of: " + actionsList + "" );
        opt.setRequired( true );
        opts.addOption( opt );

        String formatsList = "";
FileLine
org/deegree/tools/coverage/gridifier/index/MultiLevelMemoryTileGridIndex.java189
org/deegree/tools/coverage/gridifier/index/PostGISRasterTileIndex.java167
    private List<RasterLevel> fetchScaleLevels( Connection conn )
                            throws SQLException {

        List<RasterLevel> scaleLevels = new ArrayList<RasterLevel>();
        Statement stmt = null;
        ResultSet rs = null;
        try {
            stmt = conn.createStatement();
            rs = stmt.executeQuery( "SELECT id, level, minscale, maxscale FROM " + levelTableName
                                    + " ORDER BY minscale" );

            while ( rs.next() ) {
                int id = rs.getInt( 1 );
                int level = rs.getInt( 2 );
                double minScale = rs.getDouble( 3 );
                double maxScale = rs.getDouble( 4 );
                RasterLevel o = new RasterLevel( id, level, minScale, maxScale );
                scaleLevels.add( o );
            }
            return scaleLevels;
FileLine
org/deegree/tools/crs/CoordinateTransform.java156
org/deegree/tools/crs/XMLCoordinateTransform.java103
    public static void main( String[] args ) {
        CommandLineParser parser = new PosixParser();

        Options options = initOptions();
        boolean verbose = false;

        // String sourceCRS = "EPSG:25832";
        // String targetCRS = "EPSG:31466";
        // String coord = "370766.738,5685588.661";

        // for the moment, using the CLI API there is no way to respond to a help argument; see
        // https://issues.apache.org/jira/browse/CLI-179
        if ( args != null && args.length > 0 ) {
            for ( String a : args ) {
                if ( a != null && a.toLowerCase().contains( "help" ) || "-?".equals( a ) ) {
                    printHelp( options );
                }
            }
        }
        CommandLine line = null;
        try {
            line = parser.parse( options, args );
            verbose = line.hasOption( OPT_VERBOSE );
FileLine
org/deegree/tools/crs/CRSInfo.java168
org/deegree/tools/crs/CoordinateTransform.java149
    }

    /**
     * @param args
     *            following parameters are supported:
     *            <ul>
     *            <li>[-isAvailable srsName]</li>
     *            <li>[-file outputfile]</li>
     *            <li>[-verify]</li>
     *            </ul>
     */
    public static void main( String[] args ) {

        CommandLineParser parser = new PosixParser();

        Options options = initOptions();
        boolean verbose = false;

        // for the moment, using the CLI API there is no way to respond to a help argument; see
        // https://issues.apache.org/jira/browse/CLI-179
        if ( args != null && args.length > 0 ) {
            for ( String a : args ) {
                if ( a != null && a.toLowerCase().contains( "help" ) || "-?".equals( a ) ) {
                    printHelp( options );
                }
            }
        }
        CommandLine line = null;
        try {
            line = parser.parse( options, args );
            verbose = line.hasOption( CommandUtils.OPT_VERBOSE );
FileLine
org/deegree/tools/crs/CRSInfo.java179
org/deegree/tools/crs/XMLCoordinateTransform.java103
    public static void main( String[] args ) {

        CommandLineParser parser = new PosixParser();

        Options options = initOptions();
        boolean verbose = false;

        // for the moment, using the CLI API there is no way to respond to a help argument; see
        // https://issues.apache.org/jira/browse/CLI-179
        if ( args != null && args.length > 0 ) {
            for ( String a : args ) {
                if ( a != null && a.toLowerCase().contains( "help" ) || "-?".equals( a ) ) {
                    printHelp( options );
                }
            }
        }
        CommandLine line = null;
        try {
            line = parser.parse( options, args );
            verbose = line.hasOption( CommandUtils.OPT_VERBOSE );
FileLine
org/deegree/tools/rendering/r2d/se/PostgreSQLImporter.java77
org/deegree/tools/rendering/r2d/se/StyleChecker.java85
        opt = new Option( "d", "dburl", true, "database url, like jdbc:postgresql://localhost/dbname" );
        opt.setRequired( true );
        opts.addOption( opt );

        opt = new Option( "u", "dbuser", true, "database user, like postgres" );
        opt.setRequired( true );
        opts.addOption( opt );

        opt = new Option( "p", "dbpassword", true, "database password, if left off, will be set as empty" );
        opt.setRequired( false );
        opts.addOption( opt );

        opt = new Option( "s", "schema", true, "table schema, if left off, public will be used" );
        opt.setRequired( false );
        opts.addOption( opt );