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'
|
||||
version = '1.1.3'
|
||||
version = '1.1.4'
|
||||
apply plugin: 'maven'
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue