| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 26 | 2 | 3 | 0.989 | class_body_declarations[2] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 26 | 303 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java |
| 2 | 26 | 377 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java |
| ||||
/**
* Returns true iff str.toLowerCase().endsWith(".class")
* implementation is not creating extra strings.
*/
public final static boolean isClassFileName(char[] name) {
int nameLength = name == null ? 0: name.length;
int suffixLength = SUFFIX_CLASS.length;
if (nameLength < suffixLength) return false;
for (int i = 0, offset = nameLength - suffixLength; i < suffixLength; i++) {
char c = name[offset + i];
if (c != SUFFIX_class[i] && c != SUFFIX_CLASS[i]) return false;
}
return true;
}
/**
* Returns true iff str.toLowerCase().endsWith(".class")
* implementation is not creating extra strings.
*/
public final static boolean isClassFileName(String name) {
int nameLength = name == null ? 0: name.length();
int suffixLength = SUFFIX_CLASS.length;
if (nameLength < suffixLength) return false;
for (int i = 0; i < suffixLength; i++) {
char c = name.charAt(nameLength - i - 1);
int suffixIndex = suffixLength - i - 1;
if (c != SUFFIX_class[suffixIndex] && c != SUFFIX_CLASS[suffixIndex]) return false;
}
return true;
}
|
| ||||
/**
* Returns true iff str.toLowerCase().endsWith(".java")
* implementation is not creating extra strings.
*/
public final static boolean isJavaFileName(char[] name) {
int nameLength = name == null ? 0: name.length;
int suffixLength = SUFFIX_JAVA.length;
if (nameLength < suffixLength) return false;
for (int i = 0, offset = nameLength - suffixLength; i < suffixLength; i++) {
char c = name[offset + i];
if (c != SUFFIX_java[i] && c != SUFFIX_JAVA[i]) return false;
}
return true;
}
/**
* Returns true iff str.toLowerCase().endsWith(".java")
* implementation is not creating extra strings.
*/
public final static boolean isJavaFileName(String name) {
int nameLength = name == null ? 0: name.length();
int suffixLength = SUFFIX_JAVA.length;
if (nameLength < suffixLength) return false;
for (int i = 0; i < suffixLength; i++) {
char c = name.charAt(nameLength - i - 1);
int suffixIndex = suffixLength - i - 1;
if (c != SUFFIX_java[suffixIndex] && c != SUFFIX_JAVA[suffixIndex]) return false;
}
return true;
}
|
| |||
/**
* Returns true iff str.toLowerCase().endsWith(".java")
* implementation is not creating extra strings.
*/
/**
* Returns true iff str.toLowerCase().endsWith(".class")
* implementation is not creating extra strings.
*/
public final static boolean [[#variableb36b2fa0]](char[] name) {
int nameLength = name == null ? 0: name.length;
int suffixLength = [[#variableb36b2e80]].length;
if (nameLength < suffixLength)
return false;
for (int i = 0, offset = nameLength - suffixLength; i < suffixLength; i++) {
char c = name[offset + i];
if (c != [[#variableb36b2f00]][i] && c != [[#variableb36b2e80]][i])
return false;
}
return true;
}
/**
* Returns true iff str.toLowerCase().endsWith(".java")
* implementation is not creating extra strings.
*/
/**
* Returns true iff str.toLowerCase().endsWith(".class")
* implementation is not creating extra strings.
*/
public final static boolean [[#variableb36b2fa0]](String name) {
int nameLength = name == null ? 0: name.length();
int suffixLength = [[#variableb36b2e80]].length;
if (nameLength < suffixLength)
return false;
for (int i = 0; i < suffixLength; i++) {
char c = name.charAt(nameLength - i - 1);
int suffixIndex = suffixLength - i - 1;
if (c != [[#variableb36b2f00]][suffixIndex] && c != [[#variableb36b2e80]][suffixIndex])
return false;
}
return true;
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#b36b2fa0]] | isJavaFileName |
| 1 | 2 | [[#b36b2fa0]] | isClassFileName |
| 2 | 1 | [[#b36b2e80]] | SUFFIX_JAVA |
| 2 | 2 | [[#b36b2e80]] | SUFFIX_CLASS |
| 3 | 1 | [[#b36b2f00]] | SUFFIX_java |
| 3 | 2 | [[#b36b2f00]] | SUFFIX_class |