Skip to content

Commit

Permalink
Use longer unique identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillipus committed Nov 17, 2016
1 parent da8a54f commit 4549c6e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ private boolean isHeaderRecord(CSVRecord csvRecord, String[] fields) {
String generateID() {
String id;
do {
id = UUID.randomUUID().toString().split("-")[0]; //$NON-NLS-1$
id = UUID.randomUUID().toString();
}
while(newConcepts.containsKey(id));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void registerID(String id) {
public String getNewID() {
String id;
do {
id = UUID.randomUUID().toString().split("-")[0]; //$NON-NLS-1$
id = UUID.randomUUID().toString();
}
while(fUsedIDs.contains(id));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public AbstractTemplate() {
*/
public AbstractTemplate(String id) {
if(id == null) {
id = UUID.randomUUID().toString().split("-")[0]; //$NON-NLS-1$
id = UUID.randomUUID().toString();
}
fID = id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void testGetID() {
model.setDefaults();
id = model.getId();
assertNotNull(id);
assertEquals(8, id.length());
assertEquals(36, id.length());
}

@Test
Expand Down Expand Up @@ -283,7 +283,7 @@ public void testIDAddedToElement() {
model.getDefaultFolderForObject(element).getElements().add(element);
String id = element.getId();
assertNotNull(id);
assertEquals(8, id.length());
assertEquals(36, id.length());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void testRegisterID() throws Exception {
public void testGetNewID() throws Exception {
IDAdapter adapter = new IDAdapter();
String id = adapter.getNewID();
assertEquals(8, id.length());
assertEquals(36, id.length());

List<String> usedIDs = getPrivateIDList(adapter);
assertTrue(usedIDs.contains(id));
Expand Down

0 comments on commit 4549c6e

Please sign in to comment.