title: Class add method throwing StackOverflowError on package declaration
body: <p>I am producing a library for personal use; in this particular class, extending <code>JPanel</code>, and my code still for some random reason, produces a <code>StackOverflowError</code> any tips?</p>
  <pre><code>public class XJPanel extends JPanel
  {
      static boolean isManaged = false;
  
      public XJPanel() {
          
      }
  
      public XJPanel(LayoutManager arg0) {
          super(arg0);
          isManaged = true;
      }
  
      public XJPanel(boolean arg0) {
          super(arg0);
          // TODO Auto-generated constructor stub
      }
  
      public XJPanel(LayoutManager arg0, boolean arg1) {
          super(arg0, arg1);
          isManaged = true;
      }
      public GridBagConstraints getConstraints()
      {
          if(isManaged = true)
          {
              return new GridBagConstraints();
          }
          throw new NullPointerException(&quot;No Layout Manager Found&quot;);
      }
      
  
      /*
      public XJPanel add(Component arg0)
      {
          JPanel p = getRoot();
          p.add(arg0);
          return null;
      }
  
      private JPanel getRoot() {
          return this;
      }*/
      
  </code></pre>
  <p>the error it reads is exactly as follows. I think I understand what a <code>StackOverflowError</code> is, but I'd like to know why the error message includes the package declaration -- it contains no code, so... why?</p>
  <pre><code>Exception in thread &quot;main&quot; java.lang.StackOverflowError
  at javar.swing.XJPanel.getRoot(XJPanel.java:61)
  at javar.swing.XJPanel.add(XJPanel.java:55)
  at javar.swing.XJPanel.add(XJPanel.java:1)
  ...
  at javar.swing.XJPanel.add(XJPanel.java:56)
  at javar.swing.XJPanel.add(XJPanel.java:1)
  at javar.swing.XJPanel.add(XJPanel.java:56)
  </code></pre>
  <p>the javar.swing.XJPanel.add(XJPanel.java:1) being my package declaration.</p>
  <h3>Note:</h3>
  <p>I'm sorry for being such a jerk, @SimonC I guess I had a case of the grumps, I'm well rested now and ready to shape up.</p>