Bug 724678 (BRMS-571)

Summary: Wrong SimpleDateFormat in org.drools.agent.impl.PrintStreamSystemEventListener
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Jiri Locker <jlocker>
Component: BRE (Expert, Fusion)Assignee: Tihomir Surdilovic <tsurdilo>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: high    
Version: 5.1.0 GA   
Target Milestone: ---   
Target Release: 5.1.0.PostGA   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/BRMS-571
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-16 16:44:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jiri Locker 2011-03-16 15:54:28 UTC
securitylevel_name: Public

I have spotted a suspicious output from ResourceChangeScanner:

{noformat}
[java] [2011:03:74 16:03:70:debug] ResourceChangeScanner attempt to scan 10 resources
[java] [2011:03:74 16:03:125:debug] ResourceChangeScanner thread is waiting for 60 seconds.
{noformat}

It's caused by org.drools.agent.impl.PrintStreamSystemEventListener, line 29:
{noformat}
    private static SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy:MM:DD HH:MM:SS");
{noformat}
- {{D}} is day in year (should be '{{d}}' -- day in month)
- {{M}} is month in year (the first occurrence is OK, the second one should be '{{m}}' -- minute in hour)
- {{S}} is millisecond (should be '{{s}}' -- second in minute)

See [SimpleDateFormat|http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html].

I suggest to use {{"yyyy-MM-dd HH:mm:ss,SSS"}} pattern, which produces outputs like 2011-03-16 16:47:04,789.

Comment 1 Tihomir Surdilovic 2011-03-16 16:35:36 UTC
Link: Added: This issue depends JBRULES-2927


Comment 2 Tihomir Surdilovic 2011-03-16 16:44:43 UTC
Committed to 5.1.x branch