CloneSet604


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
48240.969class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1481668
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java
2481733
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java
Clone Instance
1
Line Count
48
Source Line
1668
Source File
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()));
}


Clone Instance
2
Line Count
48
Source Line
1733
Source File
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java

/**
 * 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()));
}


Clone AbstractionParameter Count: 4Parameter Bindings

/**
 * 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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#a3186440]]
getSignatureSimpleName 
12[[#a3186440]]
getSignatureQualifier 
21[[#53384200]]
i + 1 
22[[#53384200]]
0 
31[[#9901ca60]]
qualifiedType.length 
32[[#9901ca60]]
i 
41[[#a3186480]]
qualifiedType 
42[[#a3186480]]
CharOperation.NO_CHAR