fix(9700) : Fix inifite loop on tracking/untracking element
@@ -149,19 +149,23 @@ public class ORecordInternal {
public static void track(final ORecordElement pointer, final OIdentifiable pointed) {
ORecordElement firstRecord = pointer;
- while (!(firstRecord instanceof ORecord)) {
- firstRecord = pointer.getOwner();
+ while (firstRecord != null && !(firstRecord instanceof ORecord)) {
+ firstRecord = firstRecord.getOwner();
}
+ if (firstRecord instanceof ORecordAbstract) {
((ORecordAbstract) firstRecord).track(pointed);
}
+ }
public static void unTrack(final ORecordElement pointer, final OIdentifiable pointed) {
ORecordElement firstRecord = pointer;
- while (!(firstRecord instanceof ORecord)) {
- firstRecord = pointer.getOwner();
+ while (firstRecord != null && !(firstRecord instanceof ORecord)) {
+ firstRecord = firstRecord.getOwner();
}
+ if (firstRecord instanceof ORecordAbstract) {
((ORecordAbstract) firstRecord).unTrack(pointed);
}
+ }
public static ORecordSerializer getRecordSerializer(ORecord iRecord) {
return ((ORecordAbstract) iRecord).recordFormat;
