import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.btf.core.event.BtfEvent;
import org.eclipse.tracecompass.btf.core.trace.BtfColumnNames;
import org.eclipse.tracecompass.btf.core.trace.BtfTrace;
private static class TmfNamedStateValue {
private final String fName;
- private final TmfStateValue fValue;
+ private final @NonNull TmfStateValue fValue;
- public TmfNamedStateValue(TmfStateValue value, String name) {
+ public TmfNamedStateValue(@NonNull TmfStateValue value, String name) {
fValue = value;
fName = name;
}
- public TmfStateValue getValue() {
+ public @NonNull TmfStateValue getValue() {
return fValue;
}
//--------------------------------------------------------------------------
@Override
- public void modifyAttribute(long t, ITmfStateValue value, int attributeQuark)
+ public void modifyAttribute(long t, @NonNull ITmfStateValue value, int attributeQuark)
throws TimeRangeException, StateValueTypeException {
- if (value == null) {
- /*
- * TODO Replace with @NonNull parameter (will require fixing all the
- * state providers!)
- */
- throw new IllegalArgumentException();
- }
transState.processStateChange(t, value, attributeQuark);
}
}
@Override
- public void pushAttribute(long t, ITmfStateValue value, int attributeQuark)
+ public void pushAttribute(long t, @NonNull ITmfStateValue value, int attributeQuark)
throws TimeRangeException, StateValueTypeException {
int stackDepth;
int subAttributeQuark;
* If the inserted state value's type does not match what is
* already assigned to this attribute.
*/
- void modifyAttribute(long t, ITmfStateValue value, int attributeQuark)
+ void modifyAttribute(long t, @NonNull ITmfStateValue value, int attributeQuark)
throws StateValueTypeException;
/**
* If the attribute 'attributeQuark' already exists, but is not
* of integer type.
*/
- void pushAttribute(long t, ITmfStateValue value, int attributeQuark)
+ void pushAttribute(long t, @NonNull ITmfStateValue value, int attributeQuark)
throws StateValueTypeException;
/**
value = TmfStateValue.nullValue();
break;
}
- ss.modifyAttribute(ts, value, info.getStatusQuark());
+ ss.modifyAttribute(ts, NonNullUtils.checkNotNull(value), info.getStatusQuark());
} catch (StateValueTypeException e) {
Activator.logError("failed to update scenario status"); //$NON-NLS-1$
}