Project

General

Profile

« Previous | Next » 

Revision 9258

Added by Jing Tao over 9 years ago

When compare the dateUploaded, now we use sysmetadata.getDateUploaded().getTime(). It used systemmetadata.getDateUploaded() (Date objects) to compare.

View differences:

src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
1619 1619
      
1620 1620
      //check the sid
1621 1621
      SystemMetadata currentSysmeta = HazelcastService.getInstance().getSystemMetadataMap().get(pid);
1622
      logMetacat.debug("The current dateUploaded is ============"+currentSysmeta.getDateUploaded());
1623
      logMetacat.debug("the dateUploaded in the new system metadata is "+sysmeta.getDateUploaded());
1624
      logMetacat.debug("The current dateUploaded is (by time) ============"+currentSysmeta.getDateUploaded().getTime());
1625
      logMetacat.debug("the dateUploaded in the new system metadata is (by time) "+sysmeta.getDateUploaded().getTime());
1622 1626
      if(currentSysmeta == null ) {
1623 1627
          //do we need throw an exception
1624 1628
      } else {
......
1695 1699
                        "different to the orginal one "+orgMeta.getSubmitter().getValue());
1696 1700
	        }
1697 1701
	        
1698
	        if(orgMeta.getDateUploaded() != null && newMeta.getDateUploaded() != null && !orgMeta.getDateUploaded().equals(newMeta.getDateUploaded())) {
1702
	        if(orgMeta.getDateUploaded() != null && newMeta.getDateUploaded() != null && orgMeta.getDateUploaded().getTime() != newMeta.getDateUploaded().getTime()) {
1699 1703
	            throw new InvalidRequest("4869", "The request is trying to modify an immutable field in the SystemMeta: the new system meta's date of uploaded "+newMeta.getDateUploaded()+" is "+
1700 1704
                        "different to the orginal one "+orgMeta.getDateUploaded());
1701 1705
	        }

Also available in: Unified diff