Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
Merge branch 'shawnsmith-guava21' into 'master'
Browse files Browse the repository at this point in the history
#21

See merge request !59
  • Loading branch information
Jack Humphrey committed Apr 24, 2017
2 parents 5fd57b3 + 614912b commit 0b2dbf1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.indeed.proctor.common.model;

import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
import com.fasterxml.jackson.core.JsonGenerator;
Expand Down Expand Up @@ -31,7 +30,8 @@ private TestType(@Nonnull final String id) {
@Nonnull
public static TestType register(@Nonnull final String name) {
final TestType testType = new TestType(name);
return Objects.firstNonNull(TYPES.putIfAbsent(testType.name(), testType), testType);
final TestType previous = TYPES.putIfAbsent(testType.name(), testType);
return previous != null ? previous : testType;
}

// Emulate enum
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.indeed.proctor.consumer;

import com.google.common.base.Objects;
import com.google.common.collect.Maps;
import com.indeed.proctor.common.ProctorResult;
import com.indeed.proctor.common.model.ConsumableTestDefinition;
Expand Down Expand Up @@ -119,7 +118,7 @@ protected Payload getPayload(final String testName, @Nonnull final Bucket<?> fal
}
}

return Objects.firstNonNull(payload, Payload.EMPTY_PAYLOAD);
return payload != null ? payload : Payload.EMPTY_PAYLOAD;
}

/**
Expand Down

0 comments on commit 0b2dbf1

Please sign in to comment.