Reduced String generation while still fixing the original bug
This commit is contained in:
parent
2fe297b708
commit
b60f4ff1fd
|
@ -5,7 +5,7 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
archivesBaseName = 'Simple Code Generator'
|
archivesBaseName = 'Simple Code Generator'
|
||||||
version = '1.1.3'
|
version = '1.1.4'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
package speiger.src.builder.misc;
|
package speiger.src.builder.misc;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
public class IdGenerator
|
public class IdGenerator
|
||||||
{
|
{
|
||||||
StringBuilder builder = new StringBuilder();
|
AtomicInteger integer = new AtomicInteger();
|
||||||
Random rand = new Random(24912012592L);
|
|
||||||
|
|
||||||
public void appendId()
|
public void appendId()
|
||||||
{
|
{
|
||||||
builder.insert(0, rand.nextInt(10));
|
integer.incrementAndGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId()
|
public String getId()
|
||||||
{
|
{
|
||||||
return "#ignoreLine"+builder.toString()+"suffix";
|
return "#ignoreLine"+integer.get()+"suffix";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue