void closeQuietly(InputStream is){ try { if (is != null) { is.close(); } } catch (IOException ignored) { } } /** * close a stream with no error thrown * @param os - OutputStream (may be null) */ public static void closeQuietly(OutputStream os){ try { if (os != null) { os.close(); } } catch (IOException ignored) { }
void closeQuietly(Reader rd){ try { if (rd != null) { rd.close(); } } catch (IOException ignored) { } } /** * close a Socket with no error thrown * @param sock - Socket (may be null) */ public static void closeQuietly(Socket sock){ try { if (sock!= null) { sock.close(); } } catch (IOException ignored) { }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/JOrphanUtils.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/JOrphanUtils.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void closeQuietly(InputStream is){
1
void closeQuietly(Reader rd){
2
        try {
2
        try {
3
            if (is != null) {
3
            if (rd != null) {
4
                is.close();
4
                rd.close();
5
            }
5
            }
6
        } catch (IOException ignored) {
6
        } catch (IOException ignored) {
7
        }
7
        }
8
    }
8
    }
9
    /**
9
    /**
10
     * close a stream with no error thrown
10
     * close a Socket with no error thrown
11
     * @param os - OutputStream (may be null)
11
     * @param sock - Socket (may be null)
12
     */
12
     */
13
    public static void closeQuietly(OutputStream os){
13
    public static void closeQuietly(Socket sock){
14
        try {
14
        try {
15
            if (os != null) {
15
            if (sock!= null) {
16
                os.close();
16
                sock.close();
17
            }
17
            }
18
        } catch (IOException ignored) {
18
        } catch (IOException ignored) {
19
        }
19
        }
20
    
20
    
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