You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2021/09/10 01:03:14 UTC

[brooklyn-server] 03/05: fix log exclusion and formatting for old-style conversion

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

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit f6e895fb02d00c7a7f328852eb5d0bad645660d3
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Fri Sep 10 01:42:00 2021 +0100

    fix log exclusion and formatting for old-style conversion
---
 .../brooklyn/spi/creation/BrooklynEntityDecorationResolver.java  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/creation/BrooklynEntityDecorationResolver.java b/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/creation/BrooklynEntityDecorationResolver.java
index 6ab7936..eb89faa 100644
--- a/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/creation/BrooklynEntityDecorationResolver.java
+++ b/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/creation/BrooklynEntityDecorationResolver.java
@@ -208,8 +208,9 @@ public abstract class BrooklynEntityDecorationResolver<DT> {
                 try {
                     result = instantiator.from(decorationJson).prefix(typeKeyPrefix).newInstance(EntityInitializer.class);
                     if (type!=null) {
-                        // make a note of this because the new syntax should do everything the old one does except if the type is specified as 'initializerType'
-                        if (EntityInitializer.class.isInstance(type)) {
+                        // make a note of these because the new syntax should do everything the old one does except if the type is specified as 'initializerType'
+                        // which still need to be upgraded
+                        if (EntityInitializer.class.isInstance(result)) {
                             // expected for initializers still, to require the old style instantiation not beans often
                             /*
                             Initializer for type 'org.apache.brooklyn.core.sensor.http.HttpRequestSensor' instantiated via old syntax
@@ -219,9 +220,9 @@ public abstract class BrooklynEntityDecorationResolver<DT> {
                             processing class org.apache.brooklyn.util.core.config.ConfigBag,
                             processing class org.apache.brooklyn.core.sensor.http.HttpRequestSensor)
                              */
-                            log.trace("Initializer for type '{}' instantiated via old syntax (due to {})", type, e);
+                            log.trace("Initializer for type {} instantiated via old syntax (due to {})", new Object[] { type, e });
                         } else {
-                            log.debug("Initializer for type '{}' instantiated via old syntax (due to {})", type, e);
+                            log.debug("Initializer for type {} instantiated via old syntax (due to {})", new Object[] { type, e });
                         }
                     }
                 } catch (Exception e2) {