Project

General

Profile

« Previous | Next » 

Revision 5416

Added by berkley about 14 years ago

fixed bug in getLogRecords where the wrong id was getting set as the identifier

View differences:

test/edu/ucsb/nceas/metacat/dataone/CrudServiceTest.java
206 206
	        assertTrue(lrs.sizeLogEntryList() == 1);
207 207
	        LogEntry lrLogEvent = lrs.getLogEntry(0);
208 208
	        assertTrue(lrLogEvent.getEvent().name().equals("CREATE"));
209
	        assertTrue(lrLogEvent.getIdentifier().getValue().equals(id.getValue()));
209 210
	    }
210 211
	    catch(Exception e)
211 212
	    {
src/edu/ucsb/nceas/metacat/dataone/CrudService.java
814 814
            Identifier identifier = new Identifier();
815 815
            try
816 816
            {
817
                docid = docid.substring(0, docid.lastIndexOf("."));
817 818
                identifier.setValue(im.getGUID(docid, im.getLatestRevForLocalId(docid)));
818 819
            }
819 820
            catch(Exception ex)
820 821
            { //try to get the guid, if that doesn't work, just use the local id
821
                identifier.setValue(docid);
822
                throw new ServiceFailure("1030", "Error getting guid for localId " + 
823
                        docid + ": " + ex.getMessage());
822 824
            }
823 825
            
824 826
            le.setIdentifier(identifier);

Also available in: Unified diff