Selection s = getSelectionAtOffset(caret); boolean rectSelect = (s == null ? rectangularSelectionMode : s instanceof Selection.Rect); int magic = getMagicCaretPosition(); int newCaret = chunkCache.getAbovePosition(caretLine, caret - buffer.getLineStartOffset(caretLine),magic + 1, rectSelect && select);
Selection s = getSelectionAtOffset(caret); boolean rectSelect = (s == null ? rectangularSelectionMode : s instanceof Selection.Rect); int magic = getMagicCaretPosition(); int newCaret = chunkCache.getBelowPosition(caretLine, caret - buffer.getLineStartOffset(caretLine),magic + 1, rectSelect && select);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java
Method name: void goToPrevLine(boolean) Method name: void goToNextLine(boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
Selection s = getSelectionAtOffset(caret);
1
Selection s = getSelectionAtOffset(caret);
2
		boolean rectSelect = (s == null ? rectangularSelectionMode
2
		boolean rectSelect = (s == null ? rectangularSelectionMode
3
			: s instanceof Selection.Rect);
3
			: s instanceof Selection.Rect);
4
		int magic = getMagicCaretPosition();
4
		int magic = getMagicCaretPosition();
5
		int newCaret = chunkCache.getAbovePosition(caretLine,
5
		int newCaret = chunkCache.getBelowPosition(caretLine,
6
			caret - buffer.getLineStartOffset(caretLine),magic + 1,
6
			caret - buffer.getLineStartOffset(caretLine),magic + 1,
7
			rectSelect && select);
7
			rectSelect && select);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Selection s = getSelectionAtOffset(caret);
    1
    Selection s = getSelectionAtOffset(caret);
    2
    boolean rectSelect = (s == null ? rectangularSelectionMode : s instanceof Selection.Rect);
    2
    boolean rectSelect = (s == null ? rectangularSelectionMode : s instanceof Selection.Rect);
    3
    int magic = getMagicCaretPosition();
    3
    int magic = getMagicCaretPosition();
    4
    int newCaret = chunkCache.getAbovePosition(caretLine, caret - buffer.getLineStartOffset(caretLine), magic + 1, rectSelect && select);
    4
    int newCaret = chunkCache.getAbovePosition(caretLine, caret - buffer.getLineStartOffset(caretLine), magic + 1, rectSelect && select);
    4
    int newCaret = chunkCache.getBelowPosition(caretLine, caret - buffer.getLineStartOffset(caretLine), magic + 1, rectSelect && select);
    Differences
    Expression1Expression2Difference
    getAbovePositiongetBelowPositionMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression chunkCache.getAbovePosition(caretLine,caret - buffer.getLineStartOffset(caretLine),magic + 1,rectSelect && select) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression chunkCache.getBelowPosition(caretLine,caret - buffer.getLineStartOffset(caretLine),magic + 1,rectSelect && select) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    int newCaret = chunkCache.getBelowPosition(caretLine, caret - buffer.getLineStartOffset(caretLine), magic + 1, rectSelect && select);
    Precondition Violations (3)
    Row Violation
    1Expression chunkCache.getAbovePosition(caretLine,caret - buffer.getLineStartOffset(caretLine),magic + 1,rectSelect && select) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression chunkCache.getBelowPosition(caretLine,caret - buffer.getLineStartOffset(caretLine),magic + 1,rectSelect && select) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables newCaret, magic , while Clone fragment #2 returns variables newCaret, magic