public static String formatDate(Date date, String pattern) { if (date == null) { return ""; } SimpleDateFormat format = new SimpleDateFormat(pattern); return format.format(date);
public static String formatCalendar(Calendar date, String pattern) { if (date == null) { return ""; } SimpleDateFormat format = new SimpleDateFormat(pattern); return format.format(date.getTime());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/Converter.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/Converter.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public static String formatDate(Date date, String pattern) {
1
public static String formatCalendar(Calendar date, String pattern) {
2
		if (date == null) {
2
		if (date == null) {
3
			return "";
3
			return "";
4
		}
4
		}
5
		SimpleDateFormat format = new SimpleDateFormat(pattern);
5
		SimpleDateFormat format = new SimpleDateFormat(pattern);
6
		return format.format(date);
6
		return format.format(date.getTime());
7
	
7
	
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