Process proc = Runtime.getRuntime().exec(args); proc.getInputStream().close(); proc.getOutputStream().close(); proc.getErrorStream().close(); try { proc.waitFor(); } catch(InterruptedException ie) { }
try { waitSocket.getOutputStream().write('\0'); waitSocket.getOutputStream().flush(); waitSocket.getInputStream().close(); waitSocket.getOutputStream().close(); waitSocket.close(); } catch(IOException io) { //Log.log(Log.ERROR,this,io); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/installer/OperatingSystem.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/Buffer.java
Method name: void exec(String[]) Method name: void close()
Number of AST nodes: 6 Number of AST nodes: 6
1
Process proc = Runtime.getRuntime().exec(args);
2
			proc
1
try
2
			{
3
				waitSocket.getOutputStream().write('\0');
3
.getInputStream().close();
4
				waitSocket.getOutputStream().flush();
4
			proc.getOutputStream().close();
5
				waitSocket.getInputStream().close();
5
			proc.getErrorStream().close();
6
				waitSocket.getOutputStream().close();
6
			try
7
			
7
			{
8
				proc.waitFor();
8
	waitSocket.close();
9
			}
9
			}
10
			catch(InterruptedException ie)
10
			catch(IOException io)
11
			{
11
			{
12
			
12
				//Log.log(Log.ERROR,this,io);
13
}
13
			}
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.2
Clones locationClones are in different classes
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    Process proc = Runtime.getRuntime().exec(args);
                                                                                                    
    2
    proc.getInputStream().close();
                                                                      
    3
    proc.getOutputStream().close();
                                                                        
    4
    proc.getErrorStream().close();
                                                                      
    5
    try
    5
    try
    5
    try
    Differences
    Expression1Expression2Difference
    java.lang.InterruptedExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    ieioVARIABLE_NAME_MISMATCH
    java.lang.InterruptedExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    5
    try
                                                                                            
    6
    waitSocket.getOutputStream().write('\0');
    Preondition Violations
    Unmatched statement waitSocket.getOutputStream().write('\0'); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    6
    waitSocket.getOutputStream().write('\0');
    6
    proc.waitFor();
    6
    proc.waitFor();
    Preondition Violations
    Unmatched statement proc.waitFor(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                        
                                                                                    
    7
    waitSocket.getOutputStream().flush();
    Preondition Violations
    Unmatched statement waitSocket.getOutputStream().flush(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    7
    waitSocket.getOutputStream().flush();
                                                                                  
    8
    waitSocket.getInputStream().close();
    Preondition Violations
    Unmatched statement waitSocket.getInputStream().close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    8
    waitSocket.getInputStream().close();
                                                                                    
    9
    waitSocket.getOutputStream().close();
    Preondition Violations
    Unmatched statement waitSocket.getOutputStream().close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    9
    waitSocket.getOutputStream().close();
                                                  
    10
    waitSocket.close();
    Preondition Violations
    Unmatched statement waitSocket.close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    10
    waitSocket.close();
    Precondition Violations (6)
    Row Violation
    1Unmatched statement waitSocket.getOutputStream().write('\0'); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    2Unmatched statement proc.waitFor(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3Unmatched statement waitSocket.getOutputStream().flush(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    4Unmatched statement waitSocket.getInputStream().close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5Unmatched statement waitSocket.getOutputStream().close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    6Unmatched statement waitSocket.close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted