Maven NetBeans Module Plugin

OpenIDE-Module-Build-Version's timestamp value uses a wrong format

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 3.2
  • Fix Version/s: 3.3
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

Current implementation creates a timestamp for OpenIDE-Module-Build-Version manifest's field with hours in 'am/pm' format like:

OpenIDE-Module-Build-Version: 201007010848

when run on

LANG=C date --utc
Thu Jul 1 17:48:13 UTC 2010

I've fixed this, see
http://github.com/manandbytes/nbm-maven-plugin/commits/build-version-timestamp for details.

What was changed:

Pattern was changed to represent hours in a 24h format.

java.text.SimpleDateFormat uses an instance of java.util.Calendar initialized with a default timezone provided by java.util.TimeZone.getDefault(). Configure date formatter with UTC
time-zone explicitly to prevent possible locale-dependent side-effects.

And as a final step code to create and format timestamp was extracted to a private method createTimestamp().

Now the timestamp will be created in a 24h format and independent from the local timezone:

OpenIDE-Module-Build-Version: 201007011745

when invoked on

LANG=C date --utc
Thu Jul 1 17:45:36 UTC 2010

Activity

Hide
Milos Kleint added a comment -

patch applied, thanks a lot.

Show
Milos Kleint added a comment - patch applied, thanks a lot.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: