| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 25 | 2 | 3 | 0.960 | class_body_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 25 | 46 | plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSUtil.java |
| 2 | 27 | 292 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaCompareUtilities.java |
| ||||
/**
* Returns null if an error occurred.
* closes the stream
*/
public static String readString(InputStream is) {
if (is == null)
return null;
BufferedReader reader = null;
try {
StringBuffer buffer = new StringBuffer();
char[] part = new char[2048];
int read = 0;
reader = new BufferedReader(new InputStreamReader(is, "8859_1")); //$NON-NLS-1$
while ((read = reader.read(part)) != -1)
buffer.append(part, 0, read);
return buffer.toString();
}
catch (IOException ex) {
}
finally {
if (reader != null) {
try {
reader.close();
} catch (IOException ex) {
}
}
}
return null;
}
|
| ||||
/**
* Reads the contents of the given input stream into a string.
* The function assumes that the input stream uses the platform's default encoding
* (<code>ResourcesPlugin.getEncoding()</code>).
* Returns null if an error occurred.
*/
private static String readString(InputStream is, String encoding) {
if (is == null)
return null;
BufferedReader reader = null;
try {
StringBuffer buffer = new StringBuffer();
char[] part = new char[2048];
int read = 0;
reader = new BufferedReader(new InputStreamReader(is, encoding));
while ((read = reader.read(part)) != -1)
buffer.append(part, 0, read);
return buffer.toString();
}
catch (IOException ex) {
// NeedWork
}
finally {
if (reader != null) {
try {
reader.close();
} catch (IOException ex) {
// silently ignored
}
}
}
return null;
}
|
| |||
[[#variableb26a4b00]]static String readString( [[#variableb26a4a80]]) {
if (is == null)
return null;
BufferedReader reader = null;
try {
StringBuffer buffer = new StringBuffer();
char[] part = new char[2048];
int read = 0;
reader = new BufferedReader(new InputStreamReader(is, [[#variableb26a4a00]])); //$NON-NLS-1$
while ((read = reader.read(part)) != -1)
buffer.append(part, 0, read);
return buffer.toString();
}
catch (IOException ex) {
// NeedWork
}
finally {
if (reader != null) {
try {
reader.close();
}
catch (IOException ex) {
// silently ignored
}
}
}
return null;
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#b26a4b00]] | /** * Returns null if an error occurred. * closes the stream */ public |
| 1 | 2 | [[#b26a4b00]] | /** * Reads the contents of the given input stream into a string. * The function assumes that the input stream uses the platform's default encoding * (<code>ResourcesPlugin.getEncoding()</code>). * Returns null if an error occurred. */ private |
| 2 | 1 | [[#b26a4a80]] | InputStream is |
| 2 | 2 | [[#b26a4a80]] | InputStream is, String encoding |
| 3 | 1 | [[#b26a4a00]] | "8859_1" |
| 3 | 2 | [[#b26a4a00]] | encoding |