JDK-6461042 : StackoverflowException in JComponent.toString()
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-08-17
  • Updated: 2012-10-10
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b07Fixed
Related Reports
Relates :  
Description
Exception appears when Border interface is implemented by the same class which extends JComponent:

class SomePanel extends JPanel implements Border{
public SomePanel(){
	setBorder(this);
}
[...]
}

Comments
EVALUATION Taking the approach that I recommended in the previous comment.
01-12-2006

EVALUATION Although this is a weird case, there's no reason why we shouldn't fix it. Code line in question is in JComponent.paramString(): String borderString = (border != null ? border.toString() : ""); I recommend something like: String borderString = (border == null ? "" : (border == this ? "this" : border.toString()));
17-08-2006