CloneSet450


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
25220.997class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
125302
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/IndentUtil.java
225732
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
Clone Instance
1
Line Count
25
Source Line
302
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/IndentUtil.java

        /**
         * Returns the indentation of the line <code>line</code> in <code>document</code>.
         * The returned string may contain pairs of leading slashes that are considered
         * part of the indentation. The space before the asterix in a javadoc-like
         * comment is not considered part of the indentation.
         *
         * @param document the document
         * @param line the line
         * @return the indentation of <code>line</code> in <code>document</code>
         * @throws BadLocationException if the document is changed concurrently
         */
        private static String getCurrentIndent(IDocument document, int line) throws BadLocationException {
                IRegion region = document.getLineInformation(line);
                int from = region.getOffset();
                int endOffset = region.getOffset() + region.getLength();

                // go behind line comments
                int to = from;
                while (to < endOffset - 2 && document.get(to, 2).equals(SLASHES))
                        to += 2;

                while (to < endOffset) {
                        char ch = document.getChar(to);
                        if ( !Character.isWhitespace(ch))
                                break;
                        to++;
                }

                // don't count the space before javadoc like, asterix-style comment lines
                if (to > from && to < endOffset - 1 && document.get(to - 1, 2).equals(" *")) { //$NON-NLS-1$
                        String type = TextUtilities.getContentType(document, IJavaPartitions.JAVA_PARTITIONING, to, true);
                        if (type.equals(IJavaPartitions.JAVA_DOC) || type.equals(IJavaPartitions.JAVA_MULTI_LINE_COMMENT))
                                to--;
                }

                return document.get(from, to - from);
        }


Clone Instance
2
Line Count
25
Source Line
732
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java

        /**
         * Returns the indentation of the line <code>line</code> in <code>document</code>.
         * The returned string may contain pairs of leading slashes that are considered
         * part of the indentation. The space before the asterix in a javadoc-like
         * comment is not considered part of the indentation.
         *
         * @param document the document
         * @param line the line
         * @return the indentation of <code>line</code> in <code>document</code>
         * @throws BadLocationException if the document is changed concurrently
         */
        private static String getCurrentIndent(Document document, int line) throws BadLocationException {
                IRegion region = document.getLineInformation(line);
                int from = region.getOffset();
                int endOffset = region.getOffset() + region.getLength();

                // go behind line comments
                int to = from;
                while (to < endOffset - 2 && document.get(to, 2).equals(LINE_COMMENT))
                        to += 2;

                while (to < endOffset) {
                        char ch = document.getChar(to);
                        if ( !Character.isWhitespace(ch))
                                break;
                        to++;
                }

                // don't count the space before javadoc like, asterix-style comment lines
                if (to > from && to < endOffset - 1 && document.get(to - 1, 2).equals(" *")) { //$NON-NLS-1$
                        String type = TextUtilities.getContentType(document, IJavaPartitions.JAVA_PARTITIONING, to, true);
                        if (type.equals(IJavaPartitions.JAVA_DOC) || type.equals(IJavaPartitions.JAVA_MULTI_LINE_COMMENT))
                                to--;
                }

                return document.get(from, to - from);
        }


Clone AbstractionParameter Count: 2Parameter Bindings

/**
         * Returns the indentation of the line <code>line</code> in <code>document</code>.
         * The returned string may contain pairs of leading slashes that are considered
         * part of the indentation. The space before the asterix in a javadoc-like
         * comment is not considered part of the indentation.
         *
         * @param document the document
         * @param line the line
         * @return the indentation of <code>line</code> in <code>document</code>
         * @throws BadLocationException if the document is changed concurrently
         */
private static String getCurrentIndent( [[#variableb436f840]] document, int line) throws BadLocationException {
  IRegion region = document.getLineInformation(line);
  int from = region.getOffset();
  int endOffset = region.getOffset() + region.getLength();
  // go behind line comments
  int to = from;
  while (to < endOffset - 2 && document.get(to, 2).equals( [[#variableb436f7c0]]))
    to += 2;
  while (to < endOffset) {
    char ch = document.getChar(to);
    if ( !Character.isWhitespace(ch))
      break;
    to++;
  }
  // don't count the space before javadoc like, asterix-style comment lines
  if (to > from && to < endOffset - 1 && document.get(to - 1, 2).equals(" *")) { //$NON-NLS-1$
    String type = TextUtilities.getContentType(document, IJavaPartitions.JAVA_PARTITIONING, to, true);
    if (type.equals(IJavaPartitions.JAVA_DOC) || type.equals(IJavaPartitions.JAVA_MULTI_LINE_COMMENT))
      to--;
  }
  return document.get(from, to - from);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b436f840]]
Document 
12[[#b436f840]]
IDocument 
21[[#b436f7c0]]
LINE_COMMENT 
22[[#b436f7c0]]
SLASHES