PeriodUtils.getDateFromPattern returns wrong Date for "Endof_thisweek" on IBM
1.4.2 JVM
----------------------------------------------------------------------------------------
Key: MOJO-1176
URL: http://jira.codehaus.org/browse/MOJO-1176
Project: Mojo
Issue Type: Bug
Components: dashboard
Environment: Debian GNU/Linux (unstable), IBM JVM 1.4.2 SR11
Reporter: Duncan Doyle
Priority: Blocker
This may sound rather strange, but I have an issue with the Dashboard plugin on
an IBM 1.4.2 JVM on Linux. When I run the goal "dashboard" (after the "persist"
goal) I get this error:
[ERROR] The graph Configuration (id = cobertura.currentweek) is wrong.
startPeriod (Startof_thisweek = Mon Jul 14 00:00:00 CEST 2008) is not before
the endPeriod (Endof_thisweek = Sun Jul 13 23:59:59 CEST 2008).
[ERROR] DashBoardHistoricReportMojo executeReport() failed.
org.apache.maven.reporting.MavenReportException: The maven-dashboard-config.xml
is not valid. see error messages above or see the maven-dashboard-config.xsd
file.
at
org.codehaus.mojo.dashboard.report.plugin.DashBoardReportMojo.executeReport(DashBoardReportMojo.java:334)
at
org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:73)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
This only seems to happen on Linux with the IBM JVM. The SUN JVM does work, the
IBM JVM on Windows also works.
I have been playing around a bit with the PeriodUtils class (which determines
the date) and found the following:
1) When I insert this line
"System.out.println("Calendar: " + cal.get(Calendar.YEAR) +", " +
cal.get(Calendar.MONTH) + ", " + cal.get(Calendar.DAY_OF_MONTH) + ";" +
cal.get(Calendar.DAY_OF_WEEK) +
cal.get(Calendar.HOUR) + ":" + cal.get(Calendar.MINUTE) + ":" +
cal.get(Calendar.SECOND));"
before the "cal.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);" statement in the
"ENDOF_THISWEEK" code path, the returned date is correct (how strange is that,
it's just a System.out.println() and some 'get' statements on the Calendar
object??????).
2) When I switch the statements :
cal.setTime(currentDate);
cal.setFirstDayOfWeek(Calendar.MONDAY);
so the statements are in this order:
cal.setFirstDayOfWeek(Calendar.MONDAY);
cal.setTime(currentDate);
the correct date is displayed as well.
I have currently have NO explanation for this issue, or the solutions, but the
dashboard plugin in its current state just doesn't work on an IBM JVM 1.4.2 on
Linux.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email