void close(Writer device) { if (device != null) { try { device.close(); } catch (IOException ioex) { //ignore } } } /** * Close a stream without throwing any exception if something went wrong. * Do not attempt to close it if the argument is null. * * @param device Reader, can be null. */ public static void close(Reader device) { if (device != null) { try { device.close(); } catch (IOException ioex) { //ignore } } } /** * Close a stream without throwing any exception if something went wrong. * Do not attempt to close it if the argument is null. * * @param device stream, can be null. */ public static void close(OutputStream device) { if (device != null) { try { device.close(); } catch (IOException ioex) { //ignore } }
void close(Reader device) { if (device != null) { try { device.close(); } catch (IOException ioex) { //ignore } } } /** * Close a stream without throwing any exception if something went wrong. * Do not attempt to close it if the argument is null. * * @param device stream, can be null. */ public static void close(OutputStream device) { if (device != null) { try { device.close(); } catch (IOException ioex) { //ignore } } } /** * Close a stream without throwing any exception if something went wrong. * Do not attempt to close it if the argument is null. * * @param device stream, can be null. */ public static void close(InputStream device) { if (device != null) { try { device.close(); } catch (IOException ioex) { //ignore } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/FileUtils.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/FileUtils.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void close(Writer device) {
1
void close(Reader device) {
2
        if (device != null) {
2
        if (device != null) {
3
            try {
3
            try {
4
                device.close();
4
                device.close();
5
            } catch (IOException ioex) {
5
            } catch (IOException ioex) {
6
                //ignore
6
                //ignore
7
            }
7
            }
8
        }
8
        }
9
    }
9
    }
10
    /**
10
    /**
11
     * Close a stream without throwing any exception if something went wrong.
11
     * Close a stream without throwing any exception if something went wrong.
12
     * Do not attempt to close it if the argument is null.
12
     * Do not attempt to close it if the argument is null.
13
     *
13
     *
14
     * @param device Reader, can be null.
14
     * @param device stream, can be null.
15
     */
15
     */
16
    public static void close(Reader device) {
16
    public static void close(OutputStream device) {
17
        if (device != null) {
17
        if (device != null) {
18
            try {
18
            try {
19
                device.close();
19
                device.close();
20
            } catch (IOException ioex) {
20
            } catch (IOException ioex) {
21
                //ignore
21
                //ignore
22
            }
22
            }
23
        }
23
        }
24
    }
24
    }
25
    /**
25
    /**
26
     * Close a stream without throwing any exception if something went wrong.
26
     * Close a stream without throwing any exception if something went wrong.
27
     * Do not attempt to close it if the argument is null.
27
     * Do not attempt to close it if the argument is null.
28
     *
28
     *
29
     * @param device stream, can be null.
29
     * @param device stream, can be null.
30
     */
30
     */
31
    public static void close(OutputStream device) {
31
    public static void close(InputStream device) {
32
        if (device != null) {
32
        if (device != null) {
33
            try {
33
            try {
34
                device.close();
34
                device.close();
35
            } catch (IOException ioex) {
35
            } catch (IOException ioex) {
36
                //ignore
36
                //ignore
37
            }
37
            }
38
        }
38
        }
39
    
39
    
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0