return false; // shouldn't happen
}
- /*
- * id has to match (ignoring case)
- */
- if (!getId().equalsIgnoreCase(newId))
- {
- return false;
- }
+ boolean idMatches = getId().equalsIgnoreCase(newId);
/*
* Don't update if associated with different structure files
*/
String newFile = newEntry.getFile();
- if (newFile != null && getFile() != null && !newFile.equals(getFile()))
+ if (newFile != null && getFile() != null)
{
- return false;
+ if (!newFile.equals(getFile()))
+ {
+ return false;
+ }
+ else
+ {
+ // files match.
+ if (!idMatches)
+ {
+ // this shouldn't happen, but could do if the id from the
+ // file is not the same as the id from the authority that provided
+ // the file
+ return false;
+ }
+ }
+ }
+ else
+ {
+ // one has data, one doesn't ..
+ if (!idMatches)
+ {
+ return false;
+ } // otherwise maybe can update
}
/*
assertTrue(pdb1.updateFrom(pdb2));
assertEquals(pdb1.getFile(), "filePath");
assertEquals(pdb1.getType(), Type.FILE.toString());
-
+ assertEquals(pdb1.getChainCode(),"B");
/*
* change of file is not allowed
*/
{
System.out.println("setup");
StructureImportSettings.setShowSeqFeatures(true);
- c = new PDBChain("1GAQ", "A", false);
+ c = new PDBChain("1GAQ", "A");
}
@Test(groups = { "Functional" })