Skip to content

Commit

Permalink
Replace "google.common.base.Objects" API with jdk API (alibaba#6463)
Browse files Browse the repository at this point in the history
* Replace "google.common.base.Objects" API with jdk API

* use java.utils.Objects.hash()
  • Loading branch information
ZZQ001010 authored Jul 29, 2021
1 parent 9beaacb commit a0208cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import com.alibaba.nacos.api.naming.pojo.healthcheck.AbstractHealthChecker;
import com.alibaba.nacos.api.utils.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Objects;

import java.util.Objects;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -89,7 +89,7 @@ public Map<String, String> getCustomHeaders() {

@Override
public int hashCode() {
return Objects.hashCode(path, headers, expectedResponseCode);
return Objects.hash(path, headers, expectedResponseCode);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import com.alibaba.nacos.api.naming.pojo.healthcheck.AbstractHealthChecker;
import com.alibaba.nacos.api.utils.StringUtils;
import com.google.common.base.Objects;

import java.util.Objects;

/**
* Implementation of health checker for MYSQL.
Expand Down Expand Up @@ -67,7 +68,7 @@ public void setPwd(final String pwd) {

@Override
public int hashCode() {
return Objects.hashCode(user, pwd, cmd);
return Objects.hash(user, pwd, cmd);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
package com.alibaba.nacos.api.naming.pojo.healthcheck.impl;

import com.alibaba.nacos.api.naming.pojo.healthcheck.AbstractHealthChecker;
import com.google.common.base.Objects;

import java.util.Objects;

/**
* Implementation of health checker for TCP.
Expand All @@ -36,7 +37,7 @@ public Tcp() {

@Override
public int hashCode() {
return Objects.hashCode(TYPE);
return Objects.hash(TYPE);
}

@Override
Expand Down

0 comments on commit a0208cd

Please sign in to comment.