From d538ca30c0e4bf25d404b516e75fa302f35ddee1 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Wed, 16 Nov 2016 16:32:55 -0600 Subject: [PATCH] feat: Adds a toString to MappingCandidateHarvester. --- .../harvest/MappingCandidateHarvester.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/ice4j/ice/harvest/MappingCandidateHarvester.java b/src/main/java/org/ice4j/ice/harvest/MappingCandidateHarvester.java index e39a016..34da645 100644 --- a/src/main/java/org/ice4j/ice/harvest/MappingCandidateHarvester.java +++ b/src/main/java/org/ice4j/ice/harvest/MappingCandidateHarvester.java @@ -100,14 +100,12 @@ public class MappingCandidateHarvester if (face == null || mask == null) { logger.warning("Harvester not configured: face=" + face - + ", mask="+mask); + + ", mask=" + mask); return null; } - /* - * Report the LocalCandidates gathered by this CandidateHarvester so - * that the harvest is sure to be considered successful. - */ + // Report the LocalCandidates gathered by this CandidateHarvester so + // that the harvest is sure to be considered successful. Collection candidates = new HashSet<>(); for (Candidate cand : component.getLocalCandidates()) @@ -164,4 +162,18 @@ public class MappingCandidateHarvester { return face; } + + /** + * {@inheritDoc} + */ + @Override + public String toString() + { + TransportAddress face = getFace(); + TransportAddress mask = getMask(); + return + this.getClass().getName() + + ", face=" + (face == null ? "null" : face.getAddress()) + + ", mask=" + (mask == null ? "null" : mask.getAddress()); + } }