From 9a2d3d8613cdb2f6e4ce5a1616262700a752d946 Mon Sep 17 00:00:00 2001 From: Christian Posta Date: Fri, 1 Feb 2013 00:02:30 +0000 Subject: [PATCH] Fix for https://issues.apache.org/jira/browse/AMQ-4289 activemq-perf-maven-plugin is unusable because of bug in ReflectionUtil helper class also added test to show error git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1441270 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/tool/properties/ReflectionUtil.java | 3 ++- .../java/org/apache/activemq/tool/ReflectionUtilTest.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java b/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java index 974fffffd7..e20c49d415 100644 --- a/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java +++ b/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java @@ -213,7 +213,8 @@ public final class ReflectionUtil { } else { try { Object val = getterMethods[i].invoke(targetObject, null); - if (val != null) { +// if (val != null && val != targetObject) { + if (val != null ) { props.putAll(retrieveClassProperties(propertyName + ".", val.getClass(), val)); } } catch (InvocationTargetException e) { diff --git a/activemq-tooling/activemq-perf-maven-plugin/src/test/java/org/apache/activemq/tool/ReflectionUtilTest.java b/activemq-tooling/activemq-perf-maven-plugin/src/test/java/org/apache/activemq/tool/ReflectionUtilTest.java index 3f219b7d2f..8542aee261 100644 --- a/activemq-tooling/activemq-perf-maven-plugin/src/test/java/org/apache/activemq/tool/ReflectionUtilTest.java +++ b/activemq-tooling/activemq-perf-maven-plugin/src/test/java/org/apache/activemq/tool/ReflectionUtilTest.java @@ -280,6 +280,10 @@ public class ReflectionUtilTest extends TestCase { public void setTestData(TestClass3 testData) { this.testData = testData; } + + public TestClass3 getRecursiveData() { + return this; + } } public class TestClass4 {