tmf: annotate TmfContext#location as nullable
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / trace / experiment / TmfExperiment.java
index b2e3cea3a9462e4f73e7fcabf79c646716d784bc..a426fd3732d6d4c90c244ffe0a5a588fcda40c07 100644 (file)
@@ -299,9 +299,7 @@ public class TmfExperiment extends TmfTrace implements ITmfPersistentlyIndexable
         int length = getNbChildren();
 
         // Initialize the location array if necessary
-        TmfLocationArray locationArray = ((location == null) ?
-                new TmfLocationArray(length) :
-                ((TmfExperimentLocation) location).getLocationInfo());
+        TmfLocationArray locationArray = ((location == null) ? new TmfLocationArray(length) : ((TmfExperimentLocation) location).getLocationInfo());
 
         ITmfLocation[] locations = locationArray.getLocations();
         long[] ranks = locationArray.getRanks();
@@ -424,10 +422,13 @@ public class TmfExperiment extends TmfTrace implements ITmfPersistentlyIndexable
                 }
 
                 // Update the experiment location
-                TmfLocationArray locationArray = new TmfLocationArray(
-                        ((TmfExperimentLocation) expContext.getLocation()).getLocationInfo(),
-                        trace, traceContext.getLocation(), traceContext.getRank());
-                expContext.setLocation(new TmfExperimentLocation(locationArray));
+                ITmfLocation location = expContext.getLocation();
+                if (location instanceof TmfExperimentLocation) {
+                    TmfLocationArray locationArray = new TmfLocationArray(
+                            ((TmfExperimentLocation) location).getLocationInfo(),
+                            trace, traceContext.getLocation(), traceContext.getRank());
+                    expContext.setLocation(new TmfExperimentLocation(locationArray));
+                }
             }
         }
 
@@ -610,8 +611,7 @@ public class TmfExperiment extends TmfTrace implements ITmfPersistentlyIndexable
                         }
                         safeTimestamp = endTimestamp;
                         if (timeRange != null) {
-                            final TmfTraceRangeUpdatedSignal signal =
-                                    new TmfTraceRangeUpdatedSignal(TmfExperiment.this, TmfExperiment.this, timeRange);
+                            final TmfTraceRangeUpdatedSignal signal = new TmfTraceRangeUpdatedSignal(TmfExperiment.this, TmfExperiment.this, timeRange);
                             broadcast(signal);
                         }
                     }
This page took 0.02479 seconds and 5 git commands to generate.