try { return new URL(path).openStream(); } catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
try { return new URL(path).openConnection() .getOutputStream(); } catch(MalformedURLException mu) { Log.log(Log.ERROR,this,mu); String[] args = { mu.getMessage() }; VFSManager.error(comp,path,"ioerror.badurl",args); return null; }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/UrlVFS.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/UrlVFS.java
Method name: InputStream _createInputStream(Object, String, boolean, Component) Method name: OutputStream _createOutputStream(Object, String, Component)
Number of AST nodes: 2 Number of AST nodes: 2
1
try
1
try
2
		{
2
		{
3
			return new URL(path).open
3
			return new URL(path).openConnection()
4
Stream();
4
				.getOutputStream();
5
		}
5
		}
6
		catch(MalformedURLException mu)
6
		catch(MalformedURLException mu)
7
		{
7
		{
8
			Log.log(Log.ERROR,this,mu);
8
			Log.log(Log.ERROR,this,mu);
9
			String[] args = { mu.getMessage() };
9
			String[] args = { mu.getMessage() };
10
			VFSManager.error(comp,path,"ioerror.badurl",args);
10
			VFSManager.error(comp,path,"ioerror.badurl",args);
11
			return null;
11
			return null;
12
		}
12
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are declared in the same class
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
                                                                                                                          
    2
    return new URL(path).openConnection().getOutputStream();
    Preondition Violations
    Unmatched return new URL(path).openConnection().getOutputStream();
    2
    return new URL(path).openConnection().getOutputStream();
    2
    return new URL(path).openStream();
    2
    return new URL(path).openStream();
    Preondition Violations
    Unmatched return new URL(path).openStream();
                                                                              
    Precondition Violations (2)
    Row Violation
    1Unmatched return new URL(path).openConnection().getOutputStream();
    2Unmatched return new URL(path).openStream();