CloneSet269


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
50201.000class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
150384
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java
250354
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe2.java
Clone Instance
1
Line Count
50
Source Line
384
Source File
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java

        public String getEmptyLines(int linesNumber) {
                if (this.nlsTagCounter > 0) {
                        return EMPTY_STRING;
                }
                StringBuffer buffer = new StringBuffer();
                if (lastNumberOfNewLines == 0) {
                        linesNumber++; // add an extra line breaks
                        for (int i = 0; i < linesNumber; i++) {
                if (indentEmptyLines) printIndentationIfNecessary(buffer);
                                buffer.append(this.lineSeparator);
                        }
                        lastNumberOfNewLines += linesNumber;
                        line += linesNumber;
                        column = 1;
                        needSpace = false;
                        this.pendingSpace = false;
                }
                else   if (lastNumberOfNewLines == 1) {
                        for (int i = 0; i < linesNumber; i++) {
                if (indentEmptyLines) printIndentationIfNecessary(buffer);
                                buffer.append(this.lineSeparator);
                        }
                        lastNumberOfNewLines += linesNumber;
                        line += linesNumber;
                        column = 1;
                        needSpace = false;
                        this.pendingSpace = false;
                       }
                       else {
                        if ((lastNumberOfNewLines - 1) >= linesNumber) {
                                // there is no need to add new lines
                                return EMPTY_STRING;
                        }
                        final int realNewLineNumber = linesNumber - lastNumberOfNewLines + 1;
                        for (int i = 0; i < realNewLineNumber; i++) {
                if (indentEmptyLines) printIndentationIfNecessary(buffer);
                                buffer.append(this.lineSeparator);
                        }
                        lastNumberOfNewLines += realNewLineNumber;
                        line += realNewLineNumber;
                        column = 1;
                        needSpace = false;
                        this.pendingSpace = false;
                       }
                return String.valueOf(buffer);
        }

        public OptimizedReplaceEdit getLastEdit() {
                if (this.editsIndex > 0) {
                        return this.edits[this.editsIndex - 1];
                }
                return null;
        }


Clone Instance
2
Line Count
50
Source Line
354
Source File
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe2.java

        public String getEmptyLines(int linesNumber) {
                if (this.nlsTagCounter > 0) {
                        return EMPTY_STRING;
                }
                StringBuffer buffer = new StringBuffer();
                if (lastNumberOfNewLines == 0) {
                        linesNumber++; // add an extra line breaks
                        for (int i = 0; i < linesNumber; i++) {
                if (indentEmptyLines) printIndentationIfNecessary(buffer);
                                buffer.append(this.lineSeparator);
                        }
                        lastNumberOfNewLines += linesNumber;
                        line += linesNumber;
                        column = 1;
                        needSpace = false;
                        this.pendingSpace = false;
                }
                else   if (lastNumberOfNewLines == 1) {
                        for (int i = 0; i < linesNumber; i++) {
                if (indentEmptyLines) printIndentationIfNecessary(buffer);
                                buffer.append(this.lineSeparator);
                        }
                        lastNumberOfNewLines += linesNumber;
                        line += linesNumber;
                        column = 1;
                        needSpace = false;
                        this.pendingSpace = false;
                       }
                       else {
                        if ((lastNumberOfNewLines - 1) >= linesNumber) {
                                // there is no need to add new lines
                                return EMPTY_STRING;
                        }
                        final int realNewLineNumber = linesNumber - lastNumberOfNewLines + 1;
                        for (int i = 0; i < realNewLineNumber; i++) {
                if (indentEmptyLines) printIndentationIfNecessary(buffer);
                                buffer.append(this.lineSeparator);
                        }
                        lastNumberOfNewLines += realNewLineNumber;
                        line += realNewLineNumber;
                        column = 1;
                        needSpace = false;
                        this.pendingSpace = false;
                       }
                return String.valueOf(buffer);
        }

        public OptimizedReplaceEdit getLastEdit() {
                if (this.editsIndex > 0) {
                        return this.edits[this.editsIndex - 1];
                }
                return null;
        }


Clone AbstractionParameter Count: 0Parameter Bindings

public String getEmptyLines(int linesNumber) {
  if (this.nlsTagCounter > 0) {
    return EMPTY_STRING;
  }
  StringBuffer buffer = new StringBuffer();
  if (lastNumberOfNewLines == 0) {
    linesNumber++; // add an extra line breaks
    for (int i = 0; i < linesNumber; i++) {
      if (indentEmptyLines)
        printIndentationIfNecessary(buffer);
      buffer.append(this.lineSeparator);
    }
    lastNumberOfNewLines += linesNumber;
    line += linesNumber;
    column = 1;
    needSpace = false;
    this.pendingSpace = false;
  }
  else
    if (lastNumberOfNewLines == 1) {
      for (int i = 0; i < linesNumber; i++) {
        if (indentEmptyLines)
          printIndentationIfNecessary(buffer);
        buffer.append(this.lineSeparator);
      }
      lastNumberOfNewLines += linesNumber;
      line += linesNumber;
      column = 1;
      needSpace = false;
      this.pendingSpace = false;
    }
    else {
      if ((lastNumberOfNewLines - 1) >= linesNumber) {
        // there is no need to add new lines
        return EMPTY_STRING;
      }
      final int realNewLineNumber = linesNumber - lastNumberOfNewLines + 1;
      for (int i = 0; i < realNewLineNumber; i++) {
        if (indentEmptyLines)
          printIndentationIfNecessary(buffer);
        buffer.append(this.lineSeparator);
      }
      lastNumberOfNewLines += realNewLineNumber;
      line += realNewLineNumber;
      column = 1;
      needSpace = false;
      this.pendingSpace = false;
    }
  return String.valueOf(buffer);
}

public OptimizedReplaceEdit getLastEdit() {
  if (this.editsIndex > 0) {
    return this.edits[this.editsIndex - 1];
  }
  return null;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None