Skip to content

Commit

Permalink
Merge pull request #1021 from holy12345/master
Browse files Browse the repository at this point in the history
Use a more elegant way to judge
  • Loading branch information
qiangdavidliu authored Dec 18, 2017
2 parents 05d5783 + 9b414f1 commit 5e259c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public synchronized void initializedResponseCache() {

protected void initRemoteRegionRegistry() throws MalformedURLException {
Map<String, String> remoteRegionUrlsWithName = serverConfig.getRemoteRegionUrlsWithName();
if (remoteRegionUrlsWithName.size() > 0) {
if (!remoteRegionUrlsWithName.isEmpty()) {
allKnownRemoteRegions = new String[remoteRegionUrlsWithName.size()];
int remoteRegionArrayIndex = 0;
for (Map.Entry<String, String> remoteRegionUrlWithName : remoteRegionUrlsWithName.entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Response getById(@PathParam("version") String version,
@PathParam("id") String id) {
CurrentRequestVersion.set(Version.toEnum(version));
List<InstanceInfo> list = registry.getInstancesById(id);
if (list != null && list.size() > 0) {
if (list != null && !list.isEmpty()) {
return Response.ok(list.get(0)).build();
} else {
logger.info("Not Found: {}", id);
Expand Down

0 comments on commit 5e259c5

Please sign in to comment.