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) {
}
}
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) {
}
}
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(Reader rd){↵ | | 1 | void closeQuietly(InputStream is){↵
|
2 | try {↵ | | 2 | try {↵
|
3 | if (rd != null) {↵ | | 3 | if (is != null) {↵
|
4 | rd.close();↵ | | 4 | is.close();↵
|
5 | }↵ | | 5 | }↵
|
6 | } catch (IOException ignored) {↵ | | 6 | } catch (IOException ignored) {↵
|
7 | }↵ | | 7 | }↵
|
8 | }↵ | | 8 | }↵
|
|
9 | /**↵ | | 9 | /**↵
|
10 | * close a Socket with no error thrown↵ | | 10 | * close a stream with no error thrown↵
|
11 | * @param sock - Socket (may be null)↵ | | 11 | * @param os - OutputStream (may be null)↵
|
12 | */↵ | | 12 | */↵
|
13 | public static void closeQuietly(Socket sock){↵ | | 13 | public static void closeQuietly(OutputStream os){↵
|
14 | try {↵ | | 14 | try {↵
|
15 | if (sock!= null) {↵ | | 15 | if (os != null) {↵
|
16 | sock.close();↵ | | 16 | os.close();↵
|
17 | }↵ | | 17 | }↵
|
18 | } catch (IOException ignored) {↵ | | 18 | } catch (IOException ignored) {↵
|
19 | }↵ | | 19 | }↵
|
20 | } | | 20 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | |
Number of node comparisons | 0 |