aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-base/archiva-repository-layer
diff options
context:
space:
mode:
authorJoakim Erdfelt <joakime@apache.org>2007-10-19 14:21:13 +0000
committerJoakim Erdfelt <joakime@apache.org>2007-10-19 14:21:13 +0000
commit5242d36ec9429de283f8e903ba45b31019813c48 (patch)
treeb270aab56a06bdc649cafd31b5c86548b7893d6e /archiva-base/archiva-repository-layer
parentfc381bd29dca05df4f52f9e8d782e78f94e106e2 (diff)
downloadarchiva-5242d36ec9429de283f8e903ba45b31019813c48.tar.gz
archiva-5242d36ec9429de283f8e903ba45b31019813c48.zip
Cleaning up potential multi-threading issues with use of static SimpleDateFormat.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@586472 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-base/archiva-repository-layer')
-rw-r--r--archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java4
-rw-r--r--archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanStatistics.java4
2 files changed, 5 insertions, 3 deletions
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java
index d6a0f9134..960f3d798 100644
--- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java
+++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java
@@ -101,9 +101,9 @@ public class MetadataTools
private static final char NUMS[] = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
- private static final SimpleDateFormat lastUpdatedFormat;
+ private SimpleDateFormat lastUpdatedFormat;
- static
+ public MetadataTools()
{
lastUpdatedFormat = new SimpleDateFormat( "yyyyMMddHHmmss" );
lastUpdatedFormat.setTimeZone( DateUtils.UTC_TIME_ZONE );
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanStatistics.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanStatistics.java
index ba664af59..d7023b444 100644
--- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanStatistics.java
+++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanStatistics.java
@@ -23,6 +23,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.model.RepositoryContentStatistics;
+import java.text.SimpleDateFormat;
import java.util.List;
/**
@@ -39,6 +40,8 @@ public class RepositoryScanStatistics
private transient List<String> invalidConsumers;
private transient long startTimestamp;
+
+ private SimpleDateFormat df = new SimpleDateFormat();
public void triggerStart()
{
@@ -76,7 +79,6 @@ public class RepositoryScanStatistics
public String toDump( ManagedRepositoryConfiguration repo )
{
- java.text.SimpleDateFormat df = new java.text.SimpleDateFormat();
StringBuffer buf = new StringBuffer();
buf.append( "\n.\\ Scan of " ).append( this.getRepositoryId() );