int y = selectedDate.get(Calendar.YEAR); int y0 = minDate.get(Calendar.YEAR); int m = selectedDate.get(Calendar.MONTH); int m0 = minDate.get(Calendar.MONTH); // b_lyear.setEnabled(y > y0); if (y == y0) { b_lmonth.setEnabled(m > m0); if (m == m0) { clipMin = true; int d0 = minDate.get(Calendar.DATE); if (selectedDay < d0) { selectedDate.set(Calendar.DATE, selectedDay = d0); } // allow out-of-range selection // selectedDate.set(Calendar.DATE, selectedDay); } } clipAllMin = ((m < m0) || (y < y0));
if (maxDate != null) { int y = selectedDate.get(Calendar.YEAR); int y1 = maxDate.get(Calendar.YEAR); int m = selectedDate.get(Calendar.MONTH); int m1 = maxDate.get(Calendar.MONTH); // b_ryear.setEnabled(y < y1); if (y == y1) { b_rmonth.setEnabled(m < m1); if (m == m1) { clipMax = true; int d1 = maxDate.get(Calendar.DATE); if (selectedDay > d1) { selectedDate.set(Calendar.DATE, selectedDay = d1); } // allow out-of-range selection // selectedDate.set(Calendar.DATE, selectedDay); } } clipAllMax = ((m > m1) || (y > y1)); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/base/DateChooser.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/base/DateChooser.java
Method name: void _refresh() Method name: void _refresh()
Number of AST nodes: 12 Number of AST nodes: 13
1
if (maxDate != null) {
1
int y = selectedDate.get(Calendar.YEAR);
2
			int y = selectedDate.get(Calendar.YEAR);
2
			int y0 = minDate.get(Calendar.YEAR);
3
			int y1 = maxDate.get(Calendar.YEAR);
3
			int m = selectedDate.get(Calendar.MONTH);
4
			int m = selectedDate.get(Calendar.MONTH);
4
			int m0 = minDate.get(Calendar.MONTH);
5
			int m1 = maxDate.get(Calendar.MONTH);
5
			// b_lyear.setEnabled(y &gt; y0);
6
			// b_ryear.setEnabled(y &lt; y1);
6
			if (y == y0) {
7
			if (y == y1) {
7
				b_lmonth.setEnabled(m &gt; m0);
8
				b_rmonth.setEnabled(m &lt; m1);
8
				if (m == m0) {
9
				if (m == m1) {
9
					clipMin = true;
10
					clipMax = true;
10
					int d0 = minDate.get(Calendar.DATE);
11
					int d1 = maxDate.get(Calendar.DATE);
11
					if (selectedDay &lt; d0) {
12
					if (selectedDay &gt; d1) {
12
						selectedDate.set(Calendar.DATE, selectedDay = d0);
13
						selectedDate.set(Calendar.DATE, selectedDay = d1);
13
					}
14
					}
14
					// allow out-of-range selection
15
					// allow out-of-range selection
15
					// selectedDate.set(Calendar.DATE, selectedDay);
16
					// selectedDate.set(Calendar.DATE, selectedDay);
16
				}
17
				}
17
			}
18
			}
18
			clipAllMin = ((m &lt; m0) || (y &lt; y0));
19
			clipAllMax = ((m &gt; m1) || (y &gt; y1));
20
		}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons1