You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/03/14 15:03:28 UTC

[ignite-teamcity-bot] 02/02: Removal of guava objects usage for equals/hash code & code commenting

This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit 94c80229ee44c49301c54c7aec0aacc20e8c300c
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Thu Mar 14 18:01:07 2019 +0300

    Removal of guava objects usage for equals/hash code & code commenting
---
 .../ignite/ci/web/model/current/TestFailure.java   | 32 +++++++++++-----------
 .../ci/web/model/current/TestFailuresSummary.java  | 14 ++++++----
 .../ignite/ci/web/model/hist/TestHistory.java      | 12 ++++----
 .../ignite/ci/web/rest/parms/FullQueryParams.java  | 30 ++++++++++----------
 4 files changed, 45 insertions(+), 43 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailure.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailure.java
index 1448222..a99deb4 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailure.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailure.java
@@ -17,10 +17,10 @@
 
 package org.apache.ignite.ci.web.model.current;
 
-import com.google.common.base.Objects;
 import com.google.common.base.Strings;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import javax.annotation.Nonnull;
@@ -253,25 +253,25 @@ import static org.apache.ignite.ci.web.model.current.SuiteCurrentStatus.branchFo
             return false;
         TestFailure failure = (TestFailure)o;
         return investigated == failure.investigated &&
-            Objects.equal(name, failure.name) &&
-            Objects.equal(suiteName, failure.suiteName) &&
-            Objects.equal(testName, failure.testName) &&
-            Objects.equal(curFailures, failure.curFailures) &&
-            Objects.equal(webUrl, failure.webUrl) &&
-            Objects.equal(webIssueUrl, failure.webIssueUrl) &&
-            Objects.equal(webIssueText, failure.webIssueText) &&
-            Objects.equal(durationPrintable, failure.durationPrintable) &&
-            Objects.equal(warnings, failure.warnings) &&
-            Objects.equal(histBaseBranch, failure.histBaseBranch) &&
-            Objects.equal(histCurBranch, failure.histCurBranch)&&
-            Objects.equal(webUrlBaseBranch, failure.webUrlBaseBranch)  ;
+            Objects.equals(name, failure.name) &&
+            Objects.equals(suiteName, failure.suiteName) &&
+            Objects.equals(testName, failure.testName) &&
+            Objects.equals(curFailures, failure.curFailures) &&
+            Objects.equals(webUrl, failure.webUrl) &&
+            Objects.equals(webIssueUrl, failure.webIssueUrl) &&
+            Objects.equals(webIssueText, failure.webIssueText) &&
+            Objects.equals(durationPrintable, failure.durationPrintable) &&
+            Objects.equals(warnings, failure.warnings) &&
+            Objects.equals(problemRef, failure.problemRef) &&
+            Objects.equals(histCurBranch, failure.histCurBranch) &&
+            Objects.equals(histBaseBranch, failure.histBaseBranch) &&
+            Objects.equals(webUrlBaseBranch, failure.webUrlBaseBranch);
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        return Objects.hashCode(name, suiteName, testName, curFailures,
-            webUrl, webIssueUrl, webIssueText, investigated, durationPrintable, warnings, histBaseBranch, histCurBranch,
-            webUrlBaseBranch);
+        return Objects.hash(name, suiteName, testName, curFailures, webUrl, webIssueUrl, webIssueText, investigated,
+            durationPrintable, warnings, problemRef, histCurBranch, histBaseBranch, webUrlBaseBranch);
     }
 
     /** {@inheritDoc} */
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailuresSummary.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailuresSummary.java
index cc2a57e..1f92eb6 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailuresSummary.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailuresSummary.java
@@ -17,9 +17,9 @@
 
 package org.apache.ignite.ci.web.model.current;
 
-import com.google.common.base.Objects;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 
@@ -62,20 +62,22 @@ import org.jetbrains.annotations.Nullable;
         hashCodeHex = Integer.toHexString(U.safeAbs(hashCode()));
     }
 
+    /** {@inheritDoc} */
     @Override public boolean equals(Object o) {
         if (this == o)
             return true;
         if (o == null || getClass() != o.getClass())
             return false;
         TestFailuresSummary summary = (TestFailuresSummary)o;
-        return Objects.equal(servers, summary.servers) &&
-            Objects.equal(failedTests, summary.failedTests) &&
-            Objects.equal(failedToFinish, summary.failedToFinish);
-        //todo add tracked branch to equals
+        return Objects.equals(servers, summary.servers) &&
+            Objects.equals(failedTests, summary.failedTests) &&
+            Objects.equals(failedToFinish, summary.failedToFinish) &&
+            Objects.equals(trackedBranch, summary.trackedBranch);
     }
 
+    /** {@inheritDoc} */
     @Override public int hashCode() {
-        return Objects.hashCode(servers, failedTests, failedToFinish);
+        return Objects.hash(servers, failedTests, failedToFinish, trackedBranch);
     }
 
     /** {@inheritDoc} */
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/hist/TestHistory.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/hist/TestHistory.java
index f18fe20..888ecce 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/hist/TestHistory.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/hist/TestHistory.java
@@ -17,8 +17,8 @@
 
 package org.apache.ignite.ci.web.model.hist;
 
-import com.google.common.base.Objects;
 import java.util.List;
+import java.util.Objects;
 import javax.annotation.Nullable;
 import org.apache.ignite.ci.teamcity.ignited.IRunHistory;
 
@@ -62,14 +62,14 @@ public class TestHistory {
         if (o == null || getClass() != o.getClass())
             return false;
         TestHistory hist = (TestHistory)o;
-
-        return Objects.equal(allTime, hist.allTime) &&
-            Objects.equal(recent, hist.recent) &&
-            Objects.equal(latestRuns, hist.latestRuns);
+        return Objects.equals(allTime, hist.allTime) &&
+            Objects.equals(recent, hist.recent) &&
+            Objects.equals(latestRuns, hist.latestRuns) &&
+            Objects.equals(flakyComments, hist.flakyComments);
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        return Objects.hashCode(allTime, recent, latestRuns);
+        return Objects.hash(allTime, recent, latestRuns, flakyComments);
     }
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/parms/FullQueryParams.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/parms/FullQueryParams.java
index 47fac6f..323691b 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/parms/FullQueryParams.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/parms/FullQueryParams.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.ci.web.rest.parms;
 
 import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
+import java.util.Objects;
 import javax.annotation.Nonnull;
 import javax.ws.rs.QueryParam;
 import org.jetbrains.annotations.Nullable;
@@ -122,25 +122,25 @@ public class FullQueryParams {
         if (o == null || getClass() != o.getClass())
             return false;
 
-        FullQueryParams param = (FullQueryParams)o;
+        FullQueryParams params = (FullQueryParams)o;
 
-        return Objects.equal(branch, param.branch) &&
-            Objects.equal(serverId, param.serverId) &&
-            Objects.equal(suiteId, param.suiteId) &&
-            Objects.equal(branchForTc, param.branchForTc) &&
-            Objects.equal(action, param.action) &&
-            Objects.equal(count, param.count) &&
-            Objects.equal(checkAllLogs, param.checkAllLogs) &&
-            Objects.equal(buildId, param.buildId) &&
-            Objects.equal(projectId, param.projectId) &&
-            Objects.equal(testName, param.testName) &&
-            Objects.equal(baseBranchForTc, param.baseBranchForTc);
+        return Objects.equals(branch, params.branch) &&
+            Objects.equals(serverId, params.serverId) &&
+            Objects.equals(suiteId, params.suiteId) &&
+            Objects.equals(branchForTc, params.branchForTc) &&
+            Objects.equals(action, params.action) &&
+            Objects.equals(count, params.count) &&
+            Objects.equals(checkAllLogs, params.checkAllLogs) &&
+            Objects.equals(buildId, params.buildId) &&
+            Objects.equals(baseBranchForTc, params.baseBranchForTc) &&
+            Objects.equals(projectId, params.projectId) &&
+            Objects.equals(testName, params.testName);
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        return Objects.hashCode(branch, serverId, suiteId, branchForTc, action, count, checkAllLogs, buildId,
-            baseBranchForTc, testName, projectId);
+        return Objects.hash(branch, serverId, suiteId, branchForTc, action, count, checkAllLogs, buildId,
+            baseBranchForTc, projectId, testName);
     }
 
     public void setBranch(@Nullable String branch) {