Project

General

Profile

« Previous | Next » 

Revision 6948

fix a bug in MNodeService.replicate() where the checksum value was being compared to the computed checksum object, not its value.

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
545 545
                computedChecksum = ChecksumUtil.checksum(object,
546 546
                        givenChecksum.getAlgorithm());
547 547
                object.reset();
548

  
548 549
            } catch (Exception e) {
549 550
                String msg = "Error computing checksum on replica: "
550 551
                        + e.getMessage();
......
552 553
                sf.initCause(e);
553 554
                throw sf;
554 555
            }
555
            if (!givenChecksum.getValue().equals(computedChecksum)) {
556
            if (!givenChecksum.getValue().equals(computedChecksum.getValue())) {
557
                logMetacat.debug("Given    checksum for " + pid.getValue() + 
558
                    "is " + givenChecksum.getValue());
559
                logMetacat.debug("Computed checksum for " + pid.getValue() + 
560
                    "is " + computedChecksum.getValue());
556 561
                throw new ServiceFailure("2151",
557 562
                        "Computed checksum does not match declared checksum");
558 563
            }

Also available in: Unified diff