Revision 3187
Added by Jing Tao over 17 years ago
test/edu/ucsb/nceas/metacattest/client/MetacatClientTest.java | ||
---|---|---|
755 | 755 |
} else { |
756 | 756 |
docid.append(time); |
757 | 757 |
} |
758 |
|
|
758 |
|
|
759 |
//sometimes this number is not unique, so we append a random number |
|
760 |
int random = (new Double(Math.random()*100)).intValue(); |
|
761 |
docid.append(random); |
|
762 |
|
|
759 | 763 |
return docid.toString(); |
760 | 764 |
} |
761 | 765 |
} |
Also available in: Unified diff
The generateId method somethimes couldn't generate a unique id if you put them
into a big for loop. So i added append to a random number at the end. It works wll