Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7323E200D34 for ; Thu, 19 Oct 2017 15:39:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7191A160BEE; Thu, 19 Oct 2017 13:39:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 90B42160BEC for ; Thu, 19 Oct 2017 15:39:52 +0200 (CEST) Received: (qmail 81049 invoked by uid 500); 19 Oct 2017 13:39:51 -0000 Mailing-List: contact commits-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list commits@brooklyn.apache.org Received: (qmail 80986 invoked by uid 99); 19 Oct 2017 13:39:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Oct 2017 13:39:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6CB05DFC4A; Thu, 19 Oct 2017 13:39:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tbouron@apache.org To: commits@brooklyn.apache.org Date: Thu, 19 Oct 2017 13:39:53 -0000 Message-Id: <102458cfa6444909b98dfda21d7790eb@git.apache.org> In-Reply-To: <3698e9f868064137ad891e1fe4241f6a@git.apache.org> References: <3698e9f868064137ad891e1fe4241f6a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/5] brooklyn-server git commit: Dumper: change methods to package-private archived-at: Thu, 19 Oct 2017 13:39:53 -0000 Dumper: change methods to package-private And fix deprecated code usage Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/7017d801 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/7017d801 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/7017d801 Branch: refs/heads/master Commit: 7017d8017e9de89149475204d4b3603ee385ecbc Parents: b7afb93 Author: Aled Sage Authored: Mon Oct 9 09:55:33 2017 +0100 Committer: Aled Sage Committed: Thu Oct 19 10:03:38 2017 +0100 ---------------------------------------------------------------------- .../org/apache/brooklyn/core/entity/Dumper.java | 32 +++++++++++--------- 1 file changed, 18 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/7017d801/core/src/main/java/org/apache/brooklyn/core/entity/Dumper.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/Dumper.java b/core/src/main/java/org/apache/brooklyn/core/entity/Dumper.java index 40c8909..4b487e8 100644 --- a/core/src/main/java/org/apache/brooklyn/core/entity/Dumper.java +++ b/core/src/main/java/org/apache/brooklyn/core/entity/Dumper.java @@ -18,7 +18,6 @@ */ package org.apache.brooklyn.core.entity; -import static org.apache.brooklyn.core.entity.Entities.isSecret; import static org.apache.brooklyn.core.entity.Entities.isTrivial; import java.io.IOException; @@ -43,6 +42,7 @@ import org.apache.brooklyn.api.sensor.Feed; import org.apache.brooklyn.api.sensor.Sensor; import org.apache.brooklyn.config.ConfigKey; import org.apache.brooklyn.config.ConfigKey.HasConfigKey; +import org.apache.brooklyn.core.config.Sanitizer; import org.apache.brooklyn.core.location.internal.LocationInternal; import org.apache.brooklyn.core.objs.BrooklynObjectInternal; import org.apache.brooklyn.util.core.flags.FlagUtils; @@ -78,11 +78,11 @@ public class Dumper { dumpInfo(e, out, "", " "); } - public static void dumpInfo(Entity e, String currentIndentation, String tab) throws IOException { + static void dumpInfo(Entity e, String currentIndentation, String tab) throws IOException { dumpInfo(e, new PrintWriter(System.out), currentIndentation, tab); } - public static void dumpInfo(Entity e, Writer out, String currentIndentation, String tab) throws IOException { + static void dumpInfo(Entity e, Writer out, String currentIndentation, String tab) throws IOException { out.append(currentIndentation+e.toString()+" "+e.getId()+"\n"); out.append(currentIndentation+tab+tab+"displayName = "+e.getDisplayName()+"\n"); @@ -198,12 +198,12 @@ public class Dumper { dumpInfo(loc, out, "", " "); } - public static void dumpInfo(Location loc, String currentIndentation, String tab) throws IOException { + static void dumpInfo(Location loc, String currentIndentation, String tab) throws IOException { dumpInfo(loc, new PrintWriter(System.out), currentIndentation, tab); } @SuppressWarnings("rawtypes") - public static void dumpInfo(Location loc, Writer out, String currentIndentation, String tab) throws IOException { + static void dumpInfo(Location loc, Writer out, String currentIndentation, String tab) throws IOException { out.append(currentIndentation+loc.toString()+"\n"); for (Object entryO : ((LocationInternal)loc).config().getBag().getAllConfig().entrySet()) { @@ -260,11 +260,11 @@ public class Dumper { dumpInfo(enr, out, "", " "); } - public static void dumpInfo(Enricher enr, String currentIndentation, String tab) throws IOException { + static void dumpInfo(Enricher enr, String currentIndentation, String tab) throws IOException { dumpInfo(enr, new PrintWriter(System.out), currentIndentation, tab); } - public static void dumpInfo(Enricher enr, Writer out, String currentIndentation, String tab) throws IOException { + static void dumpInfo(Enricher enr, Writer out, String currentIndentation, String tab) throws IOException { out.append(currentIndentation+enr.toString()+"\n"); for (ConfigKey key : sortConfigKeys(enr.getEnricherType().getConfigKeys())) { @@ -281,11 +281,11 @@ public class Dumper { out.flush(); } - public static void dumpInfo(Feed feed, String currentIndentation, String tab) throws IOException { + static void dumpInfo(Feed feed, String currentIndentation, String tab) throws IOException { dumpInfo(feed, new PrintWriter(System.out), currentIndentation, tab); } - public static void dumpInfo(Feed feed, Writer out, String currentIndentation, String tab) throws IOException { + static void dumpInfo(Feed feed, Writer out, String currentIndentation, String tab) throws IOException { out.append(currentIndentation+feed.toString()+"\n"); // TODO create a FeedType cf EnricherType ? @@ -316,11 +316,11 @@ public class Dumper { dumpInfo(pol, out, "", " "); } - public static void dumpInfo(Policy pol, String currentIndentation, String tab) throws IOException { + static void dumpInfo(Policy pol, String currentIndentation, String tab) throws IOException { dumpInfo(pol, new PrintWriter(System.out), currentIndentation, tab); } - public static void dumpInfo(Policy pol, Writer out, String currentIndentation, String tab) throws IOException { + static void dumpInfo(Policy pol, Writer out, String currentIndentation, String tab) throws IOException { out.append(currentIndentation+pol.toString()+"\n"); for (ConfigKey key : sortConfigKeys(pol.getPolicyType().getConfigKeys())) { @@ -338,7 +338,7 @@ public class Dumper { } @SuppressWarnings({ "rawtypes", "unchecked" }) - public static List> sortSensors(Set> sensors) { + static List> sortSensors(Set> sensors) { List result = new ArrayList(sensors); Collections.sort(result, new Comparator() { @Override @@ -351,7 +351,7 @@ public class Dumper { } @SuppressWarnings({ "rawtypes", "unchecked" }) - public static List> sortConfigKeys(Set> configs) { + static List> sortConfigKeys(Set> configs) { List result = new ArrayList(configs); Collections.sort(result, new Comparator() { @Override @@ -363,7 +363,7 @@ public class Dumper { return result; } - public static Map sortMap(Map map) { + static Map sortMap(Map map) { Map result = Maps.newLinkedHashMap(); List order = Lists.newArrayList(map.keySet()); Collections.sort(order, String.CASE_INSENSITIVE_ORDER); @@ -373,4 +373,8 @@ public class Dumper { } return result; } + + private static boolean isSecret(String name) { + return Sanitizer.IS_SECRET_PREDICATE.apply(name); + } }