synchronized (dbrefs)
{
if (refModCount == dbrefs.getModCount() && primaryRefs != null)
- return primaryRefs;
- {
- refModCount = dbrefs.getModCount();
- DBRefUtils.ensurePrimaries(this);
- primaryRefs = null;
- }
+ return primaryRefs; // no changes
+ refModCount = dbrefs.getModCount();
List<DBRefEntry> primaries = (primaryRefs == null ? (primaryRefs = new ArrayList<>()) : primaryRefs);
primaries.clear();
if (tmpList == null) {
}
primaries.add(ref);
}
+
+ DBRefUtils.ensurePrimaries(this, primaries);
return primaries;
}
}
*
* @param sequence
*/
- public static void ensurePrimaries(SequenceI sequence)
+ public static void ensurePrimaries(SequenceI sequence, List<DBRefEntry> pr)
{
- List<DBRefEntry> pr = sequence.getPrimaryDBRefs();
if (pr.size() == 0)
{
// nothing to do