at 2012-01-15 will be closed
CodeSearch будет закрыт, виной тому Google+ and Dart
proof
Gson gson = new Gson();
Data data = gson.fromJson(json, Data.class);
>>> alexey: GoogleJsonParse.main time =0= 62
>>> alexey: GoogleJsonParse.main time =1= 3
>>> alexey: GoogleJsonParse.main time =2= 6
>>> alexey: GoogleJsonParse.main time =3= 1
>>> alexey: GoogleJsonParse.main time =4= 1
>>> alexey: GoogleJsonParse.main time =5= 9
>>> alexey: GoogleJsonParse.main time =6= 1
>>> alexey: GoogleJsonParse.main time =7= 1
>>> alexey: GoogleJsonParse.main time =8= 2
>>> alexey: GoogleJsonParse.main time =9= 1
Type typeOfT = new TypeToken<Map<String, String>>(){}.getType();
Map<String, String> data = gson.fromJson(json, typeOfT);
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
public class MyDateUtilStuff {
private static DateFormat ISO_8601_DATE_TIME = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ");
static {
ISO_8601_DATE_TIME.setTimeZone(TimeZone.getTimeZone("UTC"));
}
public static void main(String[] args) {
String string = "1305637849064";
long startTime = System.currentTimeMillis();
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(Long.parseLong(string));
String outDate = ISO_8601_DATE_TIME.format(date);
long time = System.currentTimeMillis() - startTime;
System.out.println(">>> alexey: MyDateUtilStuff.main ii = " + time);
System.out.println(">>> alexey: MyDateUtilStuff.main outDate = "
+ outDate);
}
}
org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/rest] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Enumeration;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class JdbcListener implements ServletContextListener
{
private static final Logger LOG = Logger.getLogger(JdbcListener.class);
public void contextDestroyed(ServletContextEvent sce)
{
deregisterJdbcDriver();
}
public void contextInitialized(ServletContextEvent sce)
{
}
private void deregisterJdbcDriver()
{
// This manually deregisters JDBC driver, which prevents Tomcat 7 from complaining about memory leaks
Enumerationdrivers = DriverManager.getDrivers();
while (drivers.hasMoreElements())
{
Driver driver = drivers.nextElement();
try
{
DriverManager.deregisterDriver(driver);
LOG.info(String.format("Deregistering jdbc driver: %s", driver));
}
catch (SQLException e)
{
LOG.info(String.format("Error deregistering driver %s", driver), e);
}
}
}
}
org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/rest] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed
mysql
mysql-connector-java
5.1.17