private BufferedReader createBufferedReader(FileEntry fileEntry, String filename) throws IOException { FileInputStream fis = new FileInputStream(fileEntry.file); InputStreamReader isr = null; // If file encoding is specified, read using that encoding, otherwise use default platform encoding String charsetName = fileEntry.charSetEncoding; if(charsetName != null && charsetName.trim().length() > 0) { isr = new InputStreamReader(fis, charsetName); } else { isr = new InputStreamReader(fis); } return new BufferedReader(isr);
private BufferedWriter createBufferedWriter(FileEntry fileEntry, String filename) throws IOException { FileOutputStream fos = new FileOutputStream(fileEntry.file); OutputStreamWriter osw = null; // If file encoding is specified, write using that encoding, otherwise use default platform encoding String charsetName = fileEntry.charSetEncoding; if(charsetName != null && charsetName.trim().length() > 0) { osw = new OutputStreamWriter(fos, charsetName); } else { osw = new OutputStreamWriter(fos); } return new BufferedWriter(osw);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/services/FileServer.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/services/FileServer.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
private BufferedReader createBufferedReader(FileEntry fileEntry, String filename) throws IOException { 
1
private BufferedWriter createBufferedWriter(FileEntry fileEntry, String filename) throws IOException { 
2
		FileInputStream fis = new FileInputStream(fileEntry.file);				
2
		FileOutputStream fos = new FileOutputStream(fileEntry.file);				
3
		InputStreamReader isr = null;
3
		OutputStreamWriter osw = null;
4
        // If file encoding is specified, read using that encoding, otherwise use default platform encoding
4
        // If file encoding is specified, write using that encoding, otherwise use default platform encoding
5
		String charsetName = fileEntry.charSetEncoding;
5
		String charsetName = fileEntry.charSetEncoding;
6
		if(charsetName != null && charsetName.trim().length() > 0) {
6
		if(charsetName != null && charsetName.trim().length() > 0) {
7
			isr = new InputStreamReader(fis, charsetName); 
7
			osw = new OutputStreamWriter(fos, charsetName); 
8
		} else {
8
		} else {
9
			isr = new InputStreamReader(fis); 
9
			osw = new OutputStreamWriter(fos); 
10
		}
10
		}
11
		return new BufferedReader(isr);
11
		return new BufferedWriter(osw);
12
	
12
	
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