Remove superfluous Preconditions check which has shown up in profiles.
After recording the task we again check whether the description is `null` for
the tasks that we actually recorded, see:
https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/profiler/Profiler.java;l=141;drc=f0ed5ca13d7c1c011588e8ae4f744c8f04b61257
@@ -722,7 +722,6 @@ public final class Profiler {
* @param description task description. May be stored until the end of the build.
*/
public SilentCloseable profile(ProfilerTask type, String description) {
- Preconditions.checkNotNull(description);
return (isActive() && isProfiling(type)) ? reallyProfile(type, description) : NOP;
}
@@ -731,9 +730,7 @@ public final class Profiler {
* profiling.
*/
public SilentCloseable profile(ProfilerTask type, Supplier<String> description) {
- return (isActive() && isProfiling(type))
- ? reallyProfile(type, Preconditions.checkNotNull(description.get()))
- : NOP;
+ return (isActive() && isProfiling(type)) ? reallyProfile(type, description.get()) : NOP;
}
/**
