Bug 53565

Summary: deprecated
Product: Tomcat Modules Reporter: RP <riccardoprandini01>
Component: jdbc-poolAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description RP 2012-07-18 13:03:37 UTC
\org\apache\tomcat\jdbc\pool\interceptor\SlowQueryReport.java:300: warning: [deprecation] toGMTString() in Date has been deprecated
            buf.append(new java.util.Date(maxInvocationDate).toGMTString());

\org\apache\tomcat\jdbc\pool\interceptor\SlowQueryReport.java:305: warning: [deprecation] toGMTString() in Date has been deprecated
            buf.append(new java.util.Date(minInvocationDate).toGMTString());



to solve a possible solution is:



public String toString() {
            DateFormat df = new SimpleDateFormat("dd MMM yyyy kk:mm:ss z");
            df.setTimeZone(TimeZone.getTimeZone("GMT"));

            StringBuilder buf = new StringBuilder("QueryStats[query:");
            buf.append(query);
            buf.append(", nrOfInvocations:");
            buf.append(nrOfInvocations);
            buf.append(", maxInvocationTime:");
            buf.append(maxInvocationTime);
            buf.append(", maxInvocationDate:");
            //buf.append(new java.util.Date(maxInvocationDate).toGMTString());
            buf.append(df.format(new java.util.Date(maxInvocationDate)));
            buf.append(", minInvocationTime:");
            buf.append(minInvocationTime);
            buf.append(", minInvocationDate:");
            //buf.append(new java.util.Date(minInvocationDate).toGMTString());
            buf.append(df.format(new java.util.Date(minInvocationDate)));
            buf.append(", totalInvocationTime:");
            buf.append(totalInvocationTime);
            buf.append(", averageInvocationTime:");
Comment 1 Mark Thomas 2012-12-03 11:15:22 UTC
Fixed in trunk and 7.0.x and will be included in 7.0.34 onwards.