if (minDate != null) { 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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (minDate != null) {
1
if (maxDate != null) {
2
			int y = selectedDate.get(Calendar.YEAR);
2
			int y = selectedDate.get(Calendar.YEAR);
3
			int y0 = minDate.get(Calendar.YEAR);
3
			int y1 = maxDate.get(Calendar.YEAR);
4
			int m = selectedDate.get(Calendar.MONTH);
4
			int m = selectedDate.get(Calendar.MONTH);
5
			int m0 = minDate.get(Calendar.MONTH);
5
			int m1 = maxDate.get(Calendar.MONTH);
6
			// b_lyear.setEnabled(y &gt; y0);
6
			// b_ryear.setEnabled(y &lt; y1);
7
			if (y == y0) {
7
			if (y == y1) {
8
				b_lmonth.setEnabled(m &gt; m0);
8
				b_rmonth.setEnabled(m &lt; m1);
9
				if (m == m0) {
9
				if (m == m1) {
10
					clipMin = true;
10
					clipMax = true;
11
					int d0 = minDate.get(Calendar.DATE);
11
					int d1 = maxDate.get(Calendar.DATE);
12
					if (selectedDay &lt; d0) {
12
					if (selectedDay &gt; d1) {
13
						selectedDate.set(Calendar.DATE, selectedDay = d0);
13
						selectedDate.set(Calendar.DATE, selectedDay = d1);
14
					}
14
					}
15
					// allow out-of-range selection
15
					// allow out-of-range selection
16
					// selectedDate.set(Calendar.DATE, selectedDay);
16
					// selectedDate.set(Calendar.DATE, selectedDay);
17
				}
17
				}
18
			}
18
			}
19
			clipAllMin = ((m &lt; m0) || (y &lt; y0));
19
			clipAllMax = ((m &gt; m1) || (y &gt; y1));
20
		}
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.0
Clones location
Number of node comparisons0