Skip to content

Commit b13c5b2

Browse files
committed
GenericBeanDefinition's toString() takes parent definition into account
Issue: SPR-9671 (cherry picked from commit 0ef29b2)
1 parent 779a6b7 commit b13c5b2

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.
@@ -87,7 +87,12 @@ public boolean equals(Object other) {
8787

8888
@Override
8989
public String toString() {
90-
return "Generic bean: " + super.toString();
90+
StringBuilder sb = new StringBuilder("Generic bean");
91+
if (this.parentName != null) {
92+
sb.append(" with parent '").append(this.parentName).append("'");
93+
}
94+
sb.append(": ").append(super.toString());
95+
return sb.toString();
9196
}
9297

9398
}

0 commit comments

Comments
 (0)