Bug 53565 - deprecated
Summary: deprecated
Status: RESOLVED FIXED
Alias: None
Product: Tomcat Modules
Classification: Unclassified
Component: jdbc-pool (show other bugs)
Version: unspecified
Hardware: PC All
: P2 minor (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 13:03 UTC by RP
Modified: 2012-12-03 11:15 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.