Skip to content

Commit 0ef29b2

Browse files
committed
GenericBeanDefinition's toString() takes parent definition into account
Issue: SPR-9671
1 parent 6f2e61b commit 0ef29b2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/GenericBeanDefinition.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -89,7 +89,12 @@ public boolean equals(Object other) {
8989

9090
@Override
9191
public String toString() {
92-
return "Generic bean: " + super.toString();
92+
StringBuilder sb = new StringBuilder("Generic bean");
93+
if (this.parentName != null) {
94+
sb.append(" with parent '").append(this.parentName).append("'");
95+
}
96+
sb.append(": ").append(super.toString());
97+
return sb.toString();
9398
}
9499

95100
}

0 commit comments

Comments
 (0)