diff --git a/build.gradle b/build.gradle index 17e2074..f6bbede 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ repositories { } archivesBaseName = 'Simple Code Generator' -version = '1.1.3' +version = '1.1.4' apply plugin: 'maven' tasks.withType(JavaCompile) { diff --git a/src/main/java/speiger/src/builder/misc/IdGenerator.java b/src/main/java/speiger/src/builder/misc/IdGenerator.java index e4e8919..cc8c0d5 100644 --- a/src/main/java/speiger/src/builder/misc/IdGenerator.java +++ b/src/main/java/speiger/src/builder/misc/IdGenerator.java @@ -1,19 +1,18 @@ package speiger.src.builder.misc; -import java.util.Random; +import java.util.concurrent.atomic.AtomicInteger; public class IdGenerator { - StringBuilder builder = new StringBuilder(); - Random rand = new Random(24912012592L); + AtomicInteger integer = new AtomicInteger(); public void appendId() { - builder.insert(0, rand.nextInt(10)); + integer.incrementAndGet(); } public String getId() { - return "#ignoreLine"+builder.toString()+"suffix"; + return "#ignoreLine"+integer.get()+"suffix"; } }