aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-11-21 10:58:48 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-11-21 11:08:41 +0100
commit4498173ba720d9ab3d10982894ad76d08c321802 (patch)
tree74e5e2e5048182b0a06eb6fbe4bf0809e22cf8f7 /sonar-batch
parent50050c7ea204110ee4ac3bf59e8f42f510622f12 (diff)
downloadsonarqube-4498173ba720d9ab3d10982894ad76d08c321802.tar.gz
sonarqube-4498173ba720d9ab3d10982894ad76d08c321802.zip
Centralize algorithm of UUID generation
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/DefaultResourcePersister.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultResourcePersister.java b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultResourcePersister.java
index ea6a2d640d7..0f7faddb25f 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultResourcePersister.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultResourcePersister.java
@@ -36,6 +36,7 @@ import org.sonar.api.resources.ResourceUtils;
import org.sonar.api.resources.Scopes;
import org.sonar.api.security.ResourcePermissions;
import org.sonar.api.utils.SonarException;
+import org.sonar.api.utils.internal.Uuids;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
@@ -46,7 +47,6 @@ import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.UUID;
public final class DefaultResourcePersister implements ResourcePersister {
@@ -306,7 +306,7 @@ public final class DefaultResourcePersister implements ResourcePersister {
model.setEnabled(Boolean.TRUE);
model.setDescription(resource.getDescription());
model.setKey(resource.getEffectiveKey());
- model.setUuid(UUID.randomUUID().toString());
+ model.setUuid(Uuids.create());
model.setPath(resource.getPath());
Language language = resource.getLanguage();
if (language != null) {