Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
13 | 2 | 3 | 0.956 | method_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 13 | 1144 | E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/axis/PeriodAxis.java |
2 | 13 | 83 | E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/data/time/RegularTimePeriod.java |
| |||||
/** * A utility method used to create a particular subclass of the * {@link RegularTimePeriod} class that includes the specified millisecond, * assuming the specified time zone. * * @param periodClass the class. * @param millisecond the time. * @param zone the time zone. * * @return The time period. */ private RegularTimePeriod createInstance(Class periodClass, Date millisecond, TimeZone zone) { RegularTimePeriod result = null; try { Constructor c = periodClass.getDeclaredConstructor(new Class[] { Date.class , TimeZone.class } ); result = (RegularTimePeriod) c.newInstance(new Object[] { millisecond, zone } ); } catch (Exception e) { // do nothing } return result; } |
| |||||
/** * Creates a time period that includes the specified millisecond, assuming * the given time zone. * * @param c the time period class. * @param millisecond the time. * @param zone the time zone. * * @return The time period. */ public static RegularTimePeriod createInstance(Class c, Date millisecond, TimeZone zone) { RegularTimePeriod result = null; try { Constructor constructor = c.getDeclaredConstructor(new Class[] { Date.class , TimeZone.class } ); result = (RegularTimePeriod) constructor.newInstance(new Object[] { millisecond, zone } ); } catch (Exception e) { // do nothing, so null is returned } return result; } |
| |||
[[#variable1a9f5d40]]RegularTimePeriod createInstance(Class [[#variable1a9f5ce0]], Date millisecond, TimeZone zone) { RegularTimePeriod result = null; try { Constructor [[#variable1a9f5cc0]]= [[#variable1a9f5ce0]].getDeclaredConstructor(new Class[] { Date.class , TimeZone.class } ); result = (RegularTimePeriod) [[#variable1a9f5cc0]].newInstance(new Object[] { millisecond, zone } ); } catch (Exception e) { // do nothing, so null is returned // do nothing } return result; } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#1a9f5d40]] | /** * A utility method used to create a particular subclass of the * {@link RegularTimePeriod} class that includes the specified millisecond, * assuming the specified time zone. * * @param periodClass the class. * @param millisecond the time. * @param zone the time zone. * * @return The time period. */ private |
1 | 2 | [[#1a9f5d40]] | /** * Creates a time period that includes the specified millisecond, assuming * the given time zone. * * @param c the time period class. * @param millisecond the time. * @param zone the time zone. * * @return The time period. */ public static |
2 | 1 | [[#1a9f5ce0]] | periodClass |
2 | 2 | [[#1a9f5ce0]] | c |
3 | 1 | [[#1a9f5cc0]] | c |
3 | 2 | [[#1a9f5cc0]] | constructor |