year = Month.evaluateAsYear(s2); if (year != null) { month = SerialDate.stringToMonthCode(s1); if (month == -1) { throw new TimePeriodFormatException( "Can't evaluate the month." ); } result = new Month(month, year); } else { throw new TimePeriodFormatException( "Can't evaluate the year."
y = Week.evaluateAsYear(s2); if (y != null) { w = Week.stringToWeek(s1); if (w == -1) { throw new TimePeriodFormatException( "Can't evaluate the week."); } result = new Week(w, y); } else { throw new TimePeriodFormatException( "Can't evaluate the year."); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/Month.java File path: /jfreechart-1.0.10/src/org/jfree/data/time/Week.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
year = Month.evaluateAsYear(s2);
1
y = Week.evaluateAsYear(s2);
2
                    if (year != null) {
2
                    if (y != null) {
3
                        month = SerialDate.stringToMonthCode(s1);
3
                        w = Week.stringToWeek(s1);
4
                        if (month == -1) {
4
                        if (w == -1) {
5
                            throw new TimePeriodFormatException(
5
                            throw new TimePeriodFormatException(
6
                                "Can't evaluate the month."
6
                                    "Can't evaluate the 
7
                            );
7
week.");
8
                        }
8
                        }
9
                        result = new Month(month, year);
9
                        result = new Week(w, y);
10
                    }
10
                    }
11
                    else {
11
                    else {
12
                        throw new TimePeriodFormatException(
12
                        throw new TimePeriodFormatException(
13
                            "Can't evaluate the year."
13
                                "Can't evaluate the year.");
14
                        
14
                    }
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