diff --git a/lib/base/array-script.cpp b/lib/base/array-script.cpp index b9535ef98..d97873819 100644 --- a/lib/base/array-script.cpp +++ b/lib/base/array-script.cpp @@ -30,7 +30,7 @@ static double ArrayLen(void) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->GetLength(); } @@ -38,7 +38,7 @@ static void ArraySet(int index, const Value& value) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); self->Set(index, value); } @@ -46,7 +46,7 @@ static Value ArrayGet(int index) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->Get(index); } @@ -54,7 +54,7 @@ static void ArrayAdd(const Value& value) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); self->Add(value); } @@ -62,7 +62,7 @@ static void ArrayRemove(int index) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); self->Remove(index); } @@ -70,7 +70,7 @@ static bool ArrayContains(const Value& value) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->Contains(value); } @@ -78,7 +78,7 @@ static void ArrayClear(void) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); self->Clear(); } @@ -94,7 +94,7 @@ static Array::Ptr ArraySort(const std::vector& args) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); Array::Ptr arr = self->ShallowClone(); @@ -118,7 +118,7 @@ static Array::Ptr ArrayShallowClone(void) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->ShallowClone(); } @@ -126,7 +126,7 @@ static Value ArrayJoin(const Value& separator) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); Value result; bool first = true; @@ -149,7 +149,7 @@ static Array::Ptr ArrayReverse(void) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->Reverse(); } @@ -157,7 +157,7 @@ static Array::Ptr ArrayMap(const Function::Ptr& function) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); if (vframe->Sandboxed && !function->IsSideEffectFree()) BOOST_THROW_EXCEPTION(ScriptError("Map function must be side-effect free.")); @@ -178,7 +178,7 @@ static Value ArrayReduce(const Function::Ptr& function) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); if (vframe->Sandboxed && !function->IsSideEffectFree()) BOOST_THROW_EXCEPTION(ScriptError("Reduce function must be side-effect free.")); @@ -203,7 +203,7 @@ static Array::Ptr ArrayFilter(const Function::Ptr& function) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); if (vframe->Sandboxed && !function->IsSideEffectFree()) BOOST_THROW_EXCEPTION(ScriptError("Filter function must be side-effect free.")); @@ -225,7 +225,7 @@ static bool ArrayAny(const Function::Ptr& function) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); if (vframe->Sandboxed && !function->IsSideEffectFree()) BOOST_THROW_EXCEPTION(ScriptError("Filter function must be side-effect free.")); @@ -245,7 +245,7 @@ static bool ArrayAll(const Function::Ptr& function) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); if (vframe->Sandboxed && !function->IsSideEffectFree()) BOOST_THROW_EXCEPTION(ScriptError("Filter function must be side-effect free.")); @@ -264,7 +264,7 @@ static Array::Ptr ArrayUnique(void) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Array::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); std::set result; diff --git a/lib/base/configobject-script.cpp b/lib/base/configobject-script.cpp index 30d22ceff..a9de57d40 100644 --- a/lib/base/configobject-script.cpp +++ b/lib/base/configobject-script.cpp @@ -29,7 +29,7 @@ static void ConfigObjectModifyAttribute(const String& attr, const Value& value) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); ConfigObject::Ptr self = vframe->Self; - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->ModifyAttribute(attr, value); } @@ -37,7 +37,7 @@ static void ConfigObjectRestoreAttribute(const String& attr) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); ConfigObject::Ptr self = vframe->Self; - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->RestoreAttribute(attr); } diff --git a/lib/base/datetime-script.cpp b/lib/base/datetime-script.cpp index 2e2f2f10b..dd8207d63 100644 --- a/lib/base/datetime-script.cpp +++ b/lib/base/datetime-script.cpp @@ -29,7 +29,7 @@ static String DateTimeFormat(const String& format) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); DateTime::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->Format(format); } diff --git a/lib/base/dictionary-script.cpp b/lib/base/dictionary-script.cpp index 9059a0a51..04e90aa69 100644 --- a/lib/base/dictionary-script.cpp +++ b/lib/base/dictionary-script.cpp @@ -29,7 +29,7 @@ static double DictionaryLen(void) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Dictionary::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->GetLength(); } @@ -37,7 +37,7 @@ static void DictionarySet(const String& key, const Value& value) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Dictionary::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); self->Set(key, value); } @@ -45,7 +45,7 @@ static Value DictionaryGet(const String& key) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Dictionary::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->Get(key); } @@ -53,7 +53,7 @@ static void DictionaryRemove(const String& key) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Dictionary::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); self->Remove(key); } @@ -61,7 +61,7 @@ static bool DictionaryContains(const String& key) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Dictionary::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->Contains(key); } @@ -69,7 +69,7 @@ static Dictionary::Ptr DictionaryShallowClone(void) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Dictionary::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->ShallowClone(); } @@ -78,7 +78,7 @@ static Array::Ptr DictionaryKeys(void) ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Dictionary::Ptr self = static_cast(vframe->Self); Array::Ptr keys = new Array(); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); ObjectLock olock(self); for (const Dictionary::Pair& kv : self) { @@ -92,7 +92,7 @@ static Array::Ptr DictionaryValues(void) ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Dictionary::Ptr self = static_cast(vframe->Self); Array::Ptr keys = new Array(); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); ObjectLock olock(self); for (const Dictionary::Pair& kv : self) { diff --git a/lib/base/function-script.cpp b/lib/base/function-script.cpp index cd40feacb..ac7fed4ba 100644 --- a/lib/base/function-script.cpp +++ b/lib/base/function-script.cpp @@ -32,7 +32,7 @@ static Value FunctionCall(const std::vector& args) ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Function::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); std::vector uargs(args.begin() + 1, args.end()); return self->Invoke(args[0], uargs); @@ -42,7 +42,7 @@ static Value FunctionCallV(const Value& thisArg, const Array::Ptr& args) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Function::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); std::vector uargs; diff --git a/lib/base/object-script.cpp b/lib/base/object-script.cpp index 27bc487da..df136b496 100644 --- a/lib/base/object-script.cpp +++ b/lib/base/object-script.cpp @@ -29,7 +29,7 @@ static String ObjectToString(void) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Object::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->ToString(); } @@ -37,7 +37,7 @@ static void ObjectNotifyAttribute(const String& attribute) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Object::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); self->NotifyField(self->GetReflectionType()->GetFieldId(attribute)); } @@ -45,7 +45,7 @@ static Object::Ptr ObjectClone(void) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Object::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); return self->Clone(); } diff --git a/lib/base/object.hpp b/lib/base/object.hpp index 6159c5b5e..dc585665b 100644 --- a/lib/base/object.hpp +++ b/lib/base/object.hpp @@ -62,7 +62,7 @@ extern I2_BASE_API Value Empty; DECLARE_PTR_TYPEDEFS(klass); \ IMPL_TYPE_LOOKUP(); -#define RequireNotNull(ptr) RequireNotNullInternal(ptr, #ptr) +#define REQUIRE_NOT_NULL(ptr) RequireNotNullInternal(ptr, #ptr) I2_BASE_API void RequireNotNullInternal(const intrusive_ptr& object, const char *description); diff --git a/lib/base/typetype-script.cpp b/lib/base/typetype-script.cpp index 591de4667..c9d42f731 100644 --- a/lib/base/typetype-script.cpp +++ b/lib/base/typetype-script.cpp @@ -37,7 +37,7 @@ static void TypeRegisterAttributeHandler(const String& fieldName, const Function { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Type::Ptr self = static_cast(vframe->Self); - RequireNotNull(self); + REQUIRE_NOT_NULL(self); int fid = self->GetFieldId(fieldName); self->RegisterAttributeHandler(fid, boost::bind(&InvokeAttributeHandlerHelper, callback, _1, _2)); diff --git a/lib/icinga/checkable-script.cpp b/lib/icinga/checkable-script.cpp index f7ba56e80..89b98d3c8 100644 --- a/lib/icinga/checkable-script.cpp +++ b/lib/icinga/checkable-script.cpp @@ -30,7 +30,7 @@ static void CheckableProcessCheckResult(const CheckResult::Ptr& cr) { ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); Checkable::Ptr self = vframe->Self; - RequireNotNull(self); + REQUIRE_NOT_NULL(self); self->ProcessCheckResult(cr); } diff --git a/lib/icinga/macroprocessor.cpp b/lib/icinga/macroprocessor.cpp index ac45f1c90..a295156f7 100644 --- a/lib/icinga/macroprocessor.cpp +++ b/lib/icinga/macroprocessor.cpp @@ -41,7 +41,7 @@ Value MacroProcessor::ResolveMacros(const Value& str, const ResolverList& resolv bool useResolvedMacros, int recursionLevel) { if (useResolvedMacros) - RequireNotNull(resolvedMacros); + REQUIRE_NOT_NULL(resolvedMacros); Value result; @@ -458,7 +458,7 @@ Value MacroProcessor::ResolveArguments(const Value& command, const Dictionary::P const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros, int recursionLevel) { if (useResolvedMacros) - RequireNotNull(resolvedMacros); + REQUIRE_NOT_NULL(resolvedMacros); Value resolvedCommand; if (!arguments || command.IsObjectType() || command.IsObjectType()) diff --git a/lib/methods/clusterchecktask.cpp b/lib/methods/clusterchecktask.cpp index 513a5a475..0f3935181 100644 --- a/lib/methods/clusterchecktask.cpp +++ b/lib/methods/clusterchecktask.cpp @@ -38,8 +38,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, ClusterCheck, &ClusterCheckTask::ScriptFunc void ClusterCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { - RequireNotNull(checkable); - RequireNotNull(cr); + REQUIRE_NOT_NULL(checkable); + REQUIRE_NOT_NULL(cr); if (resolvedMacros && !useResolvedMacros) return; diff --git a/lib/methods/clusterzonechecktask.cpp b/lib/methods/clusterzonechecktask.cpp index 699ef9bf3..593b927d7 100644 --- a/lib/methods/clusterzonechecktask.cpp +++ b/lib/methods/clusterzonechecktask.cpp @@ -34,8 +34,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, ClusterZoneCheck, &ClusterZoneCheckTask::Sc void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { - RequireNotNull(checkable); - RequireNotNull(cr); + REQUIRE_NOT_NULL(checkable); + REQUIRE_NOT_NULL(cr); ApiListener::Ptr listener = ApiListener::GetInstance(); diff --git a/lib/methods/exceptionchecktask.cpp b/lib/methods/exceptionchecktask.cpp index 120264327..9045155e8 100644 --- a/lib/methods/exceptionchecktask.cpp +++ b/lib/methods/exceptionchecktask.cpp @@ -31,11 +31,11 @@ using namespace icinga; REGISTER_SCRIPTFUNCTION_NS(Internal, ExceptionCheck, &ExceptionCheckTask::ScriptFunc, "checkable:cr:resolvedMacros:useResolvedMacros"); -void ExceptionCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr, +void ExceptionCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { - RequireNotNull(service); - RequireNotNull(cr); + REQUIRE_NOT_NULL(checkable); + REQUIRE_NOT_NULL(cr); if (resolvedMacros && !useResolvedMacros) return; diff --git a/lib/methods/icingachecktask.cpp b/lib/methods/icingachecktask.cpp index d96dfedd1..b288b6be2 100644 --- a/lib/methods/icingachecktask.cpp +++ b/lib/methods/icingachecktask.cpp @@ -32,11 +32,11 @@ using namespace icinga; REGISTER_SCRIPTFUNCTION_NS(Internal, IcingaCheck, &IcingaCheckTask::ScriptFunc, "checkable:cr:resolvedMacros:useResolvedMacros"); -void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr, +void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { - RequireNotNull(service); - RequireNotNull(cr); + REQUIRE_NOT_NULL(checkable); + REQUIRE_NOT_NULL(cr); if (resolvedMacros && !useResolvedMacros) return; @@ -115,5 +115,5 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResul } else cr->SetState(ServiceOK); - service->ProcessCheckResult(cr); + checkable->ProcessCheckResult(cr); } diff --git a/lib/methods/nullchecktask.cpp b/lib/methods/nullchecktask.cpp index 50d2409a1..d9b1a9e5f 100644 --- a/lib/methods/nullchecktask.cpp +++ b/lib/methods/nullchecktask.cpp @@ -35,8 +35,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, NullCheck, &NullCheckTask::ScriptFunc, "che void NullCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { - RequireNotNull(checkable); - RequireNotNull(cr); + REQUIRE_NOT_NULL(checkable); + REQUIRE_NOT_NULL(cr); if (resolvedMacros && !useResolvedMacros) return; diff --git a/lib/methods/nulleventtask.cpp b/lib/methods/nulleventtask.cpp index f80edd4e0..21a96c230 100644 --- a/lib/methods/nulleventtask.cpp +++ b/lib/methods/nulleventtask.cpp @@ -27,5 +27,5 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, NullEvent, &NullEventTask::ScriptFunc, "che void NullEventTask::ScriptFunc(const Checkable::Ptr& checkable, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { - RequireNotNull(checkable); + REQUIRE_NOT_NULL(checkable); } diff --git a/lib/methods/pluginchecktask.cpp b/lib/methods/pluginchecktask.cpp index ddd8dba38..bb1c25d2f 100644 --- a/lib/methods/pluginchecktask.cpp +++ b/lib/methods/pluginchecktask.cpp @@ -38,8 +38,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, PluginCheck, &PluginCheckTask::ScriptFunc, void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { - RequireNotNull(checkable); - RequireNotNull(cr); + REQUIRE_NOT_NULL(checkable); + REQUIRE_NOT_NULL(cr); CheckCommand::Ptr commandObj = checkable->GetCheckCommand(); diff --git a/lib/methods/plugineventtask.cpp b/lib/methods/plugineventtask.cpp index a1a49f066..5c0dc79ee 100644 --- a/lib/methods/plugineventtask.cpp +++ b/lib/methods/plugineventtask.cpp @@ -36,7 +36,7 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, PluginEvent, &PluginEventTask::ScriptFunc, void PluginEventTask::ScriptFunc(const Checkable::Ptr& checkable, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { - RequireNotNull(checkable); + REQUIRE_NOT_NULL(checkable); EventCommand::Ptr commandObj = checkable->GetEventCommand(); diff --git a/lib/methods/pluginnotificationtask.cpp b/lib/methods/pluginnotificationtask.cpp index 730ae6770..bfab41cc0 100644 --- a/lib/methods/pluginnotificationtask.cpp +++ b/lib/methods/pluginnotificationtask.cpp @@ -39,8 +39,8 @@ void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification, const String& author, const String& comment, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { - RequireNotNull(notification); - RequireNotNull(user); + REQUIRE_NOT_NULL(notification); + REQUIRE_NOT_NULL(user); NotificationCommand::Ptr commandObj = notification->GetCommand(); diff --git a/lib/methods/randomchecktask.cpp b/lib/methods/randomchecktask.cpp index 7afa0c7af..23ac841a7 100644 --- a/lib/methods/randomchecktask.cpp +++ b/lib/methods/randomchecktask.cpp @@ -35,8 +35,8 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, RandomCheck, &RandomCheckTask::ScriptFunc, void RandomCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { - RequireNotNull(checkable); - RequireNotNull(cr); + REQUIRE_NOT_NULL(checkable); + REQUIRE_NOT_NULL(cr); if (resolvedMacros && !useResolvedMacros) return; diff --git a/lib/methods/timeperiodtask.cpp b/lib/methods/timeperiodtask.cpp index 92c57b3cf..e76949f7b 100644 --- a/lib/methods/timeperiodtask.cpp +++ b/lib/methods/timeperiodtask.cpp @@ -27,7 +27,7 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, EvenMinutesTimePeriod, &TimePeriodTask::Eve Array::Ptr TimePeriodTask::EmptyTimePeriodUpdate(const TimePeriod::Ptr& tp, double, double) { - RequireNotNull(tp); + REQUIRE_NOT_NULL(tp); Array::Ptr segments = new Array(); return segments; @@ -36,7 +36,7 @@ Array::Ptr TimePeriodTask::EmptyTimePeriodUpdate(const TimePeriod::Ptr& tp, doub Array::Ptr TimePeriodTask::EvenMinutesTimePeriodUpdate(const TimePeriod::Ptr& tp, double begin, double end) { Array::Ptr segments = new Array(); - RequireNotNull(tp); + REQUIRE_NOT_NULL(tp); for (long t = begin / 60 - 1; t * 60 < end; t++) { if ((t % 2) == 0) {