reduce redundant declaration for simple date formatter

using predefined GenericFormatter.SIMPLE_FORMATTER
pull/97/head
reger 8 years ago
parent 38d676c7e4
commit 193b2ab1fc

@ -26,13 +26,12 @@
//if the shell's current path is HTROOT
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import org.apache.http.entity.mime.content.ContentBody;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.encoding.ASCII;
import net.yacy.cora.document.encoding.UTF8;
import net.yacy.cora.protocol.RequestHeader;
@ -49,9 +48,8 @@ import net.yacy.utils.crypt;
public class MessageSend_p {
private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);
public static String dateString(final Date date) {
return SimpleFormatter.format(date);
return GenericFormatter.SIMPLE_FORMATTER.format(date);
}

@ -26,12 +26,11 @@
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.Locale;
import java.util.TreeMap;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.encoding.UTF8;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
@ -48,11 +47,10 @@ import com.google.common.io.Files;
public class Messages_p {
private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);
private static final String PEERSKNOWN = "peersKnown_";
public static String dateString(final Date date) {
return SimpleFormatter.format(date);
return GenericFormatter.SIMPLE_FORMATTER.format(date);
}
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {

@ -31,13 +31,12 @@
// if the shell's current path is HTROOT
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.encoding.UTF8;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
@ -57,9 +56,8 @@ public class Wiki {
//private static String ListLevel = "";
//private static String numListLevel = "";
private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);
public static String dateString(final Date date) {
return SimpleFormatter.format(date);
return GenericFormatter.SIMPLE_FORMATTER.format(date);
}

@ -31,13 +31,11 @@ import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.encoding.UTF8;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.util.CommonPattern;
import net.yacy.cora.util.ConcurrentLog;
@ -56,9 +54,8 @@ import com.google.common.io.Files;
public final class message {
private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);
public static String dateString(final Date date) {
return SimpleFormatter.format(date);
return GenericFormatter.SIMPLE_FORMATTER.format(date);
}
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {

Loading…
Cancel
Save