CloneSet538


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
26201.000class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
126423
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
226638
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/SmartSemicolonAutoEditStrategy.java
Clone Instance
1
Line Count
26
Source Line
423
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java

        /**
         * Checks whether the content of <code>document</code> in the range (<code>offset</code>, <code>length</code>)
         * contains the <code>new</code> keyword.
         *
         * @param document the document being modified
         * @param offset the first character position in <code>document</code> to be considered
         * @param length the length of the character range to be considered
         * @param partitioning the document partitioning
         * @return <code>true</code> if the specified character range contains a <code>new</code> keyword, <code>false</code> otherwise.
         */
        private static boolean isNewMatch(IDocument document, int offset, int length, String partitioning) {
                Assert.isTrue(length >= 0);
                Assert.isTrue(offset >= 0);
                Assert.isTrue(offset + length < document.getLength() + 1);

                try {
                        String text = document.get(offset, length);
                        int pos = text.indexOf("new"); //$NON-NLS-1$

                        while (pos != -1 && !isDefaultPartition(document, pos + offset, partitioning))
                                pos = text.indexOf("new", pos + 2); //$NON-NLS-1$

                        if (pos < 0)
                                return false;

                        if (pos != 0 && Character.isJavaIdentifierPart(text.charAt(pos - 1)))
                                return false;

                        if (pos + 3 < length && Character.isJavaIdentifierPart(text.charAt(pos + 3)))
                                return false;

                        return true;
                }
                  catch (BadLocationException e) {
                  }
                return false;
        }


Clone Instance
2
Line Count
26
Source Line
638
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/SmartSemicolonAutoEditStrategy.java

        /**
         * Checks whether the content of <code>document</code> in the range (<code>offset</code>, <code>length</code>)
         * contains the <code>new</code> keyword.
         *
         * @param document the document being modified
         * @param offset the first character position in <code>document</code> to be considered
         * @param length the length of the character range to be considered
         * @param partitioning the document partitioning
         * @return <code>true</code> if the specified character range contains a <code>new</code> keyword, <code>false</code> otherwise.
         */
        private static boolean isNewMatch(IDocument document, int offset, int length, String partitioning) {
                Assert.isTrue(length >= 0);
                Assert.isTrue(offset >= 0);
                Assert.isTrue(offset + length < document.getLength() + 1);

                try {
                        String text = document.get(offset, length);
                        int pos = text.indexOf("new"); //$NON-NLS-1$

                        while (pos != -1 && !isDefaultPartition(document, pos + offset, partitioning))
                                pos = text.indexOf("new", pos + 2); //$NON-NLS-1$

                        if (pos < 0)
                                return false;

                        if (pos != 0 && Character.isJavaIdentifierPart(text.charAt(pos - 1)))
                                return false;

                        if (pos + 3 < length && Character.isJavaIdentifierPart(text.charAt(pos + 3)))
                                return false;

                        return true;
                }
                  catch (BadLocationException e) {
                  }
                return false;
        }


Clone AbstractionParameter Count: 0Parameter Bindings

/**
         * Checks whether the content of <code>document</code> in the range (<code>offset</code>, <code>length</code>)
         * contains the <code>new</code> keyword.
         *
         * @param document the document being modified
         * @param offset the first character position in <code>document</code> to be considered
         * @param length the length of the character range to be considered
         * @param partitioning the document partitioning
         * @return <code>true</code> if the specified character range contains a <code>new</code> keyword, <code>false</code> otherwise.
         */
private static boolean isNewMatch(IDocument document, int offset, int length, String partitioning) {
  Assert.isTrue(length >= 0);
  Assert.isTrue(offset >= 0);
  Assert.isTrue(offset + length < document.getLength() + 1);
  try {
    String text = document.get(offset, length);
    int pos = text.indexOf("new"); //$NON-NLS-1$
    while (pos != -1 && !isDefaultPartition(document, pos + offset, partitioning))
      pos = text.indexOf("new", pos + 2); //$NON-NLS-1$
    if (pos < 0)
      return false;
    if (pos != 0 && Character.isJavaIdentifierPart(text.charAt(pos - 1)))
      return false;
    if (pos + 3 < length && Character.isJavaIdentifierPart(text.charAt(pos + 3)))
      return false;
    return true;
  }
  catch (BadLocationException e) {
  }
  return false;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None