int maxTopHeight = size.height - bottomHeight - topButtonHeight - bottomButtonHeight - _topToolbars.height - _bottomToolbars.height; topHeight = Math.min(Math.max(0,maxTopHeight), topHeight); leftWidth = Math.min(Math.max(0, size.width - leftButtonWidth - rightButtonWidth - rightWidth),leftWidth);
int maxBottomHeight = size.height - topHeight - topButtonHeight - bottomButtonHeight - _topToolbars.height - _bottomToolbars.height; bottomHeight = Math.min(Math.max(0,maxBottomHeight), bottomHeight); rightWidth = Math.min(Math.max(0, size.width - leftButtonWidth - rightButtonWidth - leftWidth),rightWidth);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/DockableWindowManager.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/DockableWindowManager.java
Method name: int[] adjustDockingAreasToFit(Dimension, int, int, int, int, int, int, int, int, Dimension, Dimension) Method name: int[] adjustDockingAreasToFit(Dimension, int, int, int, int, int, int, int, int, Dimension, Dimension)
Number of AST nodes: 3 Number of AST nodes: 3
1
int maxTopHeight = size.height - bottomHeight
1
int maxBottomHeight = size.height - topHeight
2
				- topButtonHeight - bottomButtonHeight
2
				- topButtonHeight - bottomButtonHeight
3
				- _topToolbars.height - _bottomToolbars.height;
3
				- _topToolbars.height - _bottomToolbars.height;
4
			topHeight = Math.min(Math.max(0,maxTopHeight),
4
			bottomHeight = Math.min(Math.max(0,maxBottomHeight),
5
				topHeight);
5
				bottomHeight);
6
			leftWidth = Math.min(Math.max(0,
6
			rightWidth = Math.min(Math.max(0,
7
				size.width - leftButtonWidth
7
				size.width - leftButtonWidth
8
				- rightButtonWidth - rightWidth),leftWidth);
8
				- rightButtonWidth - leftWidth),rightWidth);
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 in the same method
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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
    int maxTopHeight = size.height - bottomHeight - topButtonHeight - bottomButtonHeight - _topToolbars.height - _bottomToolbars.height;
    1
    int maxTopHeight = size.height - bottomHeight - topButtonHeight - bottomButtonHeight - _topToolbars.height - _bottomToolbars.height;
    4
    int maxBottomHeight = size.height - topHeight - topButtonHeight - bottomButtonHeight - _topToolbars.height - _bottomToolbars.height;
    Differences
    Expression1Expression2Difference
    maxTopHeightmaxBottomHeightVARIABLE_NAME_MISMATCH
    bottomHeighttopHeightVARIABLE_NAME_MISMATCH
    4
    int maxBottomHeight = size.height - topHeight - topButtonHeight - bottomButtonHeight - _topToolbars.height - _bottomToolbars.height;
    2
    topHeight = Math.min(Math.max(0, maxTopHeight), topHeight);
    2
    topHeight = Math.min(Math.max(0, maxTopHeight), topHeight);
    5
    bottomHeight = Math.min(Math.max(0, maxBottomHeight), bottomHeight);
    Differences
    Expression1Expression2Difference
    topHeightbottomHeightVARIABLE_NAME_MISMATCH
    maxTopHeightmaxBottomHeightVARIABLE_NAME_MISMATCH
    topHeightbottomHeightVARIABLE_NAME_MISMATCH
    5
    bottomHeight = Math.min(Math.max(0, maxBottomHeight), bottomHeight);
    3
    leftWidth = Math.min(Math.max(0, size.width - leftButtonWidth - rightButtonWidth - rightWidth), leftWidth);
    3
    leftWidth = Math.min(Math.max(0, size.width - leftButtonWidth - rightButtonWidth - rightWidth), leftWidth);
    6
    rightWidth = Math.min(Math.max(0, size.width - leftButtonWidth - rightButtonWidth - leftWidth), rightWidth);
    Differences
    Expression1Expression2Difference
    leftWidthrightWidthVARIABLE_NAME_MISMATCH
    rightWidthleftWidthVARIABLE_NAME_MISMATCH
    leftWidthrightWidthVARIABLE_NAME_MISMATCH
    6
    rightWidth = Math.min(Math.max(0, size.width - leftButtonWidth - rightButtonWidth - leftWidth), rightWidth);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables topHeight, leftWidth , while Clone fragment #2 returns variables bottomHeight, rightWidth