You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jd...@apache.org on 2005/06/19 20:02:09 UTC
svn commit: r191357 -
/maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/version/IntervalUtils.java
Author: jdcasey
Date: Sun Jun 19 11:02:07 2005
New Revision: 191357
URL: http://svn.apache.org/viewcvs?rev=191357&view=rev
Log:
Adding default interval type of minutes, in case W|D|H|M is not specified. This is to be consistent with the snapshot policy in the repository.
Modified:
maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/version/IntervalUtils.java
Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/version/IntervalUtils.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/version/IntervalUtils.java?rev=191357&r1=191356&r2=191357&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/version/IntervalUtils.java (original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/version/IntervalUtils.java Sun Jun 19 11:02:07 2005
@@ -26,7 +26,7 @@
public final class IntervalUtils
{
- private static final String PERIOD_PART_PATTERN = "[0-9]+[WwDdHhMm]";
+ private static final String PERIOD_PART_PATTERN = "[0-9]+[WwDdHhMm]?";
private static final Map PART_TYPE_CONTRIBUTIONS;
@@ -98,7 +98,21 @@
{
char type = part.charAt( part.length() - 1 );
- int coefficient = Integer.parseInt( part.substring( 0, part.length() -1 ) );
+ String coefficientPart;
+
+ if( Character.isLetter(type))
+ {
+ coefficientPart = part.substring( 0, part.length() - 1);
+ }
+ else
+ {
+ // if the interval doesn't specify a resolution, assume minutes.
+ coefficientPart = part;
+
+ type = 'm';
+ }
+
+ int coefficient = Integer.parseInt( coefficientPart );
Long period = (Long) PART_TYPE_CONTRIBUTIONS.get( "" + Character.toLowerCase( type ) );
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org