Results 1 to 1 of 1
Thread: Leaking this in constructor
- 11-11-2011, 12:07 AM #1
Member
- Join Date
- Nov 2011
- Posts
- 1
- Rep Power
- 0
Leaking this in constructor
The code below gives a warning: Leaking this in constructor.
I totally understand why this warning appear ('this' is not completely initialized).
Instead of suspend the warning is there any better approach to do the same thing?
This project is "under maintenance" so I want to avoid big changes. But from the other side, "a better approach" is always useful.
Java Code:public class ResizableTable extends JTable implements KeyListener, MouseListener, ..... { ..... public ResizableTable(ResizableTableModel rtm, boolean sort) { super(rtm); addKeyListener(this); if (sort) getTableHeader().addMouseListener(this); }
Similar Threads
-
What does this Constructor Do ?
By Ciwan in forum New To JavaReplies: 1Last Post: 10-02-2010, 06:24 PM -
Constructor
By arefeh in forum New To JavaReplies: 9Last Post: 01-11-2010, 11:38 AM -
Calling constructor of parent class from a constructor
By Java Tip in forum Java TipReplies: 0Last Post: 12-19-2007, 09:10 AM -
Calling constructor of same class from a constructor
By Java Tip in forum Java TipReplies: 0Last Post: 12-19-2007, 09:01 AM -
Constructor Help
By bluegreen7hi in forum New To JavaReplies: 2Last Post: 11-15-2007, 05:44 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks