From 4498173ba720d9ab3d10982894ad76d08c321802 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 21 Nov 2014 10:58:48 +0100 Subject: Centralize algorithm of UUID generation --- .../src/main/java/org/sonar/batch/index/DefaultResourcePersister.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sonar-batch/src') 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) { -- cgit v1.2.3