Skip to content

Commit d6714d2

Browse files
authored
remove duplicated check for time is null
in builder's build, it had checked the time is null so that the time for point never be null. So it can be removed to avoid duplicated check and improve the code coverage.
1 parent c59e0fc commit d6714d2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/java/org/influxdb/dto/Point.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public Builder fields(final Map<String, Object> fieldsToAdd) {
181181
* @return the Builder instance.
182182
*/
183183
public Builder time(final long timeToSet, final TimeUnit precisionToSet) {
184-
Preconditions.checkNotNull(precisionToSet, "Precision must be not null!");
184+
Preconditions.checkNotNull(precisionToSet, "Precision must be not null!");
185185
this.time = timeToSet;
186186
this.precision = precisionToSet;
187187
return this;
@@ -352,9 +352,6 @@ private StringBuilder concatenateFields() {
352352

353353
private StringBuilder formatedTime() {
354354
final StringBuilder sb = new StringBuilder();
355-
if (null == this.time) {
356-
this.time = this.precision.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
357-
}
358355
sb.append(" ").append(TimeUnit.NANOSECONDS.convert(this.time, this.precision));
359356
return sb;
360357
}

0 commit comments

Comments
 (0)