| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 48 | 2 | 4 | 0.969 | class_body_declarations[2] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 48 | 1668 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java |
| 2 | 48 | 1733 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java |
| ||||
/**
* Returns package fragment of a type signature. The package fragment separator must be '.'
* and the type fragment separator must be '$'.
* <p>
* For example:
* <pre>
* <code>
* getSignatureQualifier({'L', 'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l', '.', 'M', 'a', 'p', '$', 'E', 'n', 't', 'r', 'y', ';'}) -> {'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l'}
* </code>
* </pre>
* </p>
*
* @param typeSignature the type signature
* @return the package fragment (separators are '.')
* @since 3.1
*/
public static char[] getSignatureQualifier(char[] typeSignature) {
if (typeSignature == null) return CharOperation.NO_CHAR;
char[] qualifiedType = Signature.toCharArray(typeSignature);
int dotCount = 0;
indexFound: for (int i = 0; i < typeSignature.length; i++) {
switch (typeSignature[i]) {
case C_DOT:
dotCount++;
break;
case C_GENERIC_START:
break indexFound;
case C_DOLLAR:
break indexFound;
}
}
if (dotCount > 0) {
for (int i = 0; i < qualifiedType.length; i++) {
if (qualifiedType[i] == '.') {
dotCount--;
}
if (dotCount <= 0) {
return CharOperation.subarray(qualifiedType, 0, i);
}
}
}
return CharOperation.NO_CHAR;
}
/**
* Returns package fragment of a type signature. The package fragment separator must be '.'
* and the type fragment separator must be '$'.
* <p>
* For example:
* <pre>
* <code>
* getSignatureQualifier("Ljava.util.Map$Entry") -> "java.util"
* </code>
* </pre>
* </p>
*
* @param typeSignature the type signature
* @return the package fragment (separators are '.')
* @since 3.1
*/
public static String getSignatureQualifier(String typeSignature) {
return new String(getSignatureQualifier(typeSignature == null ? null: typeSignature.toCharArray()));
}
|
| ||||
/**
* Returns type fragment of a type signature. The package fragment separator must be '.'
* and the type fragment separator must be '$'.
* <p>
* For example:
* <pre>
* <code>
* getSignatureSimpleName({'L', 'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l', '.', 'M', 'a', 'p', '$', 'E', 'n', 't', 'r', 'y', ';'}) -> {'M', 'a', 'p', '.', 'E', 'n', 't', 'r', 'y'}
* </code>
* </pre>
* </p>
*
* @param typeSignature the type signature
* @return the type fragment (separators are '.')
* @since 3.1
*/
public static char[] getSignatureSimpleName(char[] typeSignature) {
if (typeSignature == null) return CharOperation.NO_CHAR;
char[] qualifiedType = Signature.toCharArray(typeSignature);
int dotCount = 0;
indexFound: for (int i = 0; i < typeSignature.length; i++) {
switch (typeSignature[i]) {
case C_DOT:
dotCount++;
break;
case C_GENERIC_START:
break indexFound;
case C_DOLLAR:
break indexFound;
}
}
if (dotCount > 0) {
for (int i = 0; i < qualifiedType.length; i++) {
if (qualifiedType[i] == '.') {
dotCount--;
}
if (dotCount <= 0) {
return CharOperation.subarray(qualifiedType, i + 1, qualifiedType.length);
}
}
}
return qualifiedType;
}
/**
* Returns type fragment of a type signature. The package fragment separator must be '.'
* and the type fragment separator must be '$'.
* <p>
* For example:
* <pre>
* <code>
* getSignatureSimpleName("Ljava.util.Map$Entry") -> "Map.Entry"
* </code>
* </pre>
* </p>
*
* @param typeSignature the type signature
* @return the type fragment (separators are '.')
* @since 3.1
*/
public static String getSignatureSimpleName(String typeSignature) {
return new String(getSignatureSimpleName(typeSignature == null ? null: typeSignature.toCharArray()));
}
|
| |||
/**
* Returns type fragment of a type signature. The package fragment separator must be '.'
* and the type fragment separator must be '$'.
* <p>
* For example:
* <pre>
* <code>
* getSignatureSimpleName({'L', 'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l', '.', 'M', 'a', 'p', '$', 'E', 'n', 't', 'r', 'y', ';'}) -> {'M', 'a', 'p', '.', 'E', 'n', 't', 'r', 'y'}
* </code>
* </pre>
* </p>
*
* @param typeSignature the type signature
* @return the type fragment (separators are '.')
* @since 3.1
*/
/**
* Returns package fragment of a type signature. The package fragment separator must be '.'
* and the type fragment separator must be '$'.
* <p>
* For example:
* <pre>
* <code>
* getSignatureQualifier({'L', 'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l', '.', 'M', 'a', 'p', '$', 'E', 'n', 't', 'r', 'y', ';'}) -> {'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l'}
* </code>
* </pre>
* </p>
*
* @param typeSignature the type signature
* @return the package fragment (separators are '.')
* @since 3.1
*/
public static char[] [[#variablea3186440]](char[] typeSignature) {
if (typeSignature == null)
return CharOperation.NO_CHAR;
char[] qualifiedType = Signature.toCharArray(typeSignature);
int dotCount = 0;
indexFound:
for (int i = 0; i < typeSignature.length; i++) {
switch (typeSignature[i]) {
case C_DOT:
dotCount++;
break;
case C_GENERIC_START:
break indexFound;
case C_DOLLAR:
break indexFound;
}
}
if (dotCount > 0) {
for (int i = 0; i < qualifiedType.length; i++) {
if (qualifiedType[i] == '.') {
dotCount--;
}
if (dotCount <= 0) {
return CharOperation.subarray(qualifiedType, [[#variable53384200]], [[#variable9901ca60]]);
}
}
}
return [[#variablea3186480]];
}
/**
* Returns type fragment of a type signature. The package fragment separator must be '.'
* and the type fragment separator must be '$'.
* <p>
* For example:
* <pre>
* <code>
* getSignatureSimpleName("Ljava.util.Map$Entry") -> "Map.Entry"
* </code>
* </pre>
* </p>
*
* @param typeSignature the type signature
* @return the type fragment (separators are '.')
* @since 3.1
*/
/**
* Returns package fragment of a type signature. The package fragment separator must be '.'
* and the type fragment separator must be '$'.
* <p>
* For example:
* <pre>
* <code>
* getSignatureQualifier("Ljava.util.Map$Entry") -> "java.util"
* </code>
* </pre>
* </p>
*
* @param typeSignature the type signature
* @return the package fragment (separators are '.')
* @since 3.1
*/
public static String [[#variablea3186440]](String typeSignature) {
return new String( [[#variablea3186440]](typeSignature == null ? null: typeSignature.toCharArray()));
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#a3186440]] | getSignatureSimpleName |
| 1 | 2 | [[#a3186440]] | getSignatureQualifier |
| 2 | 1 | [[#53384200]] | i + 1 |
| 2 | 2 | [[#53384200]] | 0 |
| 3 | 1 | [[#9901ca60]] | qualifiedType.length |
| 3 | 2 | [[#9901ca60]] | i |
| 4 | 1 | [[#a3186480]] | qualifiedType |
| 4 | 2 | [[#a3186480]] | CharOperation.NO_CHAR |