Project

General

Profile

« Previous | Next » 

Revision 9047

Added by Jing Tao almost 10 years ago

Add a check that the sid shouldn't equals the pid in the update and create method.

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
422 422
                                                        +"However, it was used by another object.");
423 423
                    }
424 424
                }
425
                
425
                //the series id equals the pid (new pid hasn't been registered in the system, so IdentifierManager.getInstance().identifierExists method can't exclude this scenario)
426
                if(sidInSys.getValue().equals(newPid.getValue())) {
427
                    throw new InvalidSystemMetadata("1300", "The series id "+sidInSys.getValue()+" in the system metadata shouldn't have the same value of the pid.");
428
                }
426 429
            }
427 430

  
428 431
            isScienceMetadata = isScienceMetadata(sysmeta);
src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
399 399
                          "use CN.reserveIdentifier() to reserve one.");
400 400
            
401 401
        }
402
        //the series id equals the pid (new pid hasn't been registered in the system, so IdentifierManager.getInstance().identifierExists method can't exclude this scenario )
403
        if(sid.getValue().equals(pid.getValue())) {
404
            throw new InvalidSystemMetadata("1180", "The series id "+sid.getValue()+" in the system metadata shouldn't have the same value of the pid.");
405
        }
402 406
    }
403 407
    
404 408
    // TODO: this probably needs to be refined more

Also available in: Unified diff