| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 16 | 2 | 5 | 0.973 | class_body_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 16 | 2830 | plugins/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java |
| 2 | 16 | 2854 | plugins/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java |
| ||||
/**
* Method parseIntValue.
* @param token
*/
private int parseIntValue(String token) {
int tokenLength = token.length();
if (tokenLength < 10) {
// Integer.decode can handle tokens with less than 10 digits
return Integer.decode(token).intValue();
}
switch (getBase(token)) {
case 8:
return (Integer.decode(token.substring(0, tokenLength - 1)).intValue() << 3)| Integer.decode("0" + token.charAt(tokenLength - 1)).intValue(); //$NON-NLS-1$
case 10:
return Integer.decode(token).intValue();
case 16:
return (Integer.decode(token.substring(0, tokenLength - 1)).intValue() << 4)| Integer.decode("0x" + token.charAt(tokenLength - 1)).intValue(); //$NON-NLS-1$
default:
// getBase(String) only returns 8, 10, or 16. This code is unreachable
return 0;
}
}
|
| ||||
/**
* Method parseLongValue.
* @param token
*/
private long parseLongValue(String token) {
int tokenLength = token.length();
if (tokenLength < 18) {
// Long.decode can handle tokens with less than 18 digits
return Long.decode(token).longValue();
}
switch (getBase(token)) {
case 8:
return (Long.decode(token.substring(0, tokenLength - 1)).longValue() << 3)| Long.decode("0" + token.charAt(tokenLength - 1)).longValue(); //$NON-NLS-1$
case 10:
return Long.decode(token).longValue();
case 16:
return (Long.decode(token.substring(0, tokenLength - 1)).longValue() << 4)| Long.decode("0x" + token.charAt(tokenLength - 1)).longValue(); //$NON-NLS-1$
default:
// getBase(String) only returns 8, 10, or 16. This code is unreachable
return 0;
}
}
|
| |||
/**
* Method parseIntValue.
* @param token
*/
/**
* Method parseLongValue.
* @param token
*/
private [[#variableb6993a40]] [[#variableb6993960]](String token) {
int tokenLength = token.length();
if (tokenLength < [[#variableb69938c0]]) {
// Integer.decode can handle tokens with less than 10 digits
// Long.decode can handle tokens with less than 18 digits
return [[#variableb6993820]].decode(token). [[#variableb69938a0]]();
}
switch (getBase(token)) {
case 8:
return ( [[#variableb6993820]].decode(token.substring(0, tokenLength - 1)). [[#variableb69938a0]]() << 3)| [[#variableb6993820]].decode("0" + token.charAt(tokenLength - 1)). [[#variableb69938a0]](); //$NON-NLS-1$
case 10:
return [[#variableb6993820]].decode(token). [[#variableb69938a0]]();
case 16:
return ( [[#variableb6993820]].decode(token.substring(0, tokenLength - 1)). [[#variableb69938a0]]() << 4)| [[#variableb6993820]].decode("0x" + token.charAt(tokenLength - 1)). [[#variableb69938a0]](); //$NON-NLS-1$
default:
// getBase(String) only returns 8, 10, or 16. This code is unreachable
return 0;
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#b6993a40]] | int |
| 1 | 2 | [[#b6993a40]] | long |
| 2 | 1 | [[#b6993960]] | parseIntValue |
| 2 | 2 | [[#b6993960]] | parseLongValue |
| 3 | 1 | [[#b69938c0]] | 10 |
| 3 | 2 | [[#b69938c0]] | 18 |
| 4 | 1 | [[#b6993820]] | Integer |
| 4 | 2 | [[#b6993820]] | Long |
| 5 | 1 | [[#b69938a0]] | intValue |
| 5 | 2 | [[#b69938a0]] | longValue |