if (id==null || vobj.getVorbaId()==null)
Cache.log.error("Failed to get id for "+(vobj.isRegisterable() ? "registerable" : "unregisterable") +" object "+vobj);
}
- if (vobj2jv.containsKey(vobj.getVorbaId()) || jv2vobj.containsKey(jvobj))
- {
- Cache.log.error("Duplicate object binding! "+vobj+" id " +vobj.getVorbaId().getId()+" to "+jvobj);
+
+ if (vobj2jv.containsKey(vobj.getVorbaId()) && !((VorbaId)vobj2jv.get(vobj.getVorbaId())).equals(jvobj)) {
+ Cache.log.debug("Warning? Overwriting existing vamsas id binding for "+vobj.getVorbaId(), new Exception("Overwriting vamsas id binding."));
}
- else
+ else if (jv2vobj.containsKey(jvobj) && !((VorbaId)jv2vobj.get(jvobj)).equals(vobj.getVorbaId()))
{
- vobj2jv.put(vobj.getVorbaId(), jvobj);// JBPNote - better implementing a
- // hybrid invertible hash.
- jv2vobj.put(jvobj, vobj.getVorbaId());
+ Cache.log.debug("Warning? Overwriting existing jalview object binding for "+jvobj, new Exception("Overwriting jalview object binding."));
}
+ /* Cache.log.error("Attempt to make conflicting object binding! "+vobj+" id " +vobj.getVorbaId()+" already bound to "+getvObj2jv(vobj)+" and "+jvobj+" already bound to "+getjv2vObj(jvobj),new Exception("Excessive call to bindjvvobj"));
+ }*/
+ // we just update the hash's regardless!
+ vobj2jv.put(vobj.getVorbaId(), jvobj);
+ // JBPNote - better implementing a hybrid invertible hash.
+ jv2vobj.put(jvobj, vobj.getVorbaId());
}
/**
valseq.getSequence().replace(valGapchar, gapChar),
valseq.getStart(),
valseq.getEnd() );
- alseq.setDatasetSequence((SequenceI)getvObj2jv((Vobject)valseq.getRefid())); // exceptions if AlignemntSequence reference isn't a simple SequenceI
+
+ Vobject datsetseq = (Vobject)valseq.getRefid();
+ if (datsetseq!=null) {
+ alseq.setDatasetSequence((SequenceI)getvObj2jv(datsetseq)); // exceptions if AlignemntSequence reference isn't a simple SequenceI
+ } else {
+ Cache.log.error("Invalid dataset sequence id (null) for alignment sequence "+valseq.getVorbaId());
+ }
bindjvvobj(alseq, valseq);
alseq.setVamsasId(valseq.getVorbaId().getId());
dsseqs.add(alseq);
}
return new Object[] { AeContent, rangeMap, anot[0], anot[1] };
} else {
- // no annotations to parse.
+ // no annotations to parse. Just return an empty annotationElement[] array.
+ return new Object[] { AeContent, rangeMap, anot[0], anot[1] };
}
- return null;
+ // return null;
}
/**
* @param jal the jalview alignment to which the annotation will be attached (ideally - freshly updated from corresponding vamsas alignment)
if (a_descr==null || a_descr.length()==0) {
a_descr = "Annotation of type '"+annotation.getType()+"'";
}
- if (parsedRangeAnnotation!=null) {
+ if (parsedRangeAnnotation==null) {
+ Cache.log.debug("Inserting empty annotation row elements for a whole-alignment annotation.");
+
+
+ } else {
if (parsedRangeAnnotation[3]!=null) {
Cache.log.warn("Ignoring 'After' annotation row in "+annotation.getVorbaId());
}
return jan;
- } else {
- Cache.log.debug("(Ignoring so ... not) Inserting empty annotation row for whole-alignment annotation.");
- }
+ }
return null;
}
se = getSegRange(dseta.getSeg(s), false);
int se_end=se[1-se[2]]+(se[2]==0 ? 1 : -1);
for (int p=se[se[2]]; p!=se_end; p+=se[2]==0 ? 1 : -1 ) {
- posList.add(Integer.valueOf(p));
+ posList.add(new Integer(p));
}
}
}
for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
{
pos = dseta.getPos(p).getI();
- posList.add(Integer.valueOf(pos));
+ posList.add(new Integer(pos));
}
}
}