https://bz.apache.org/bugzilla/show_bug.cgi?id=58790

--- Comment #6 from Sebb <[email protected]> ---
(In reply to Philippe Mouawad from comment #5)
> (In reply to Sebb from comment #3)
> > (In reply to Philippe Mouawad from comment #2)
> > > > > But due to CheckDirty using getInstance() in its constructor to 
> > > > > register
> > > > > itself as a PreAction to ExitCommand, it leads to a 
> > > > > StackoverflowError.
> > > > 
> > > > Not sure I follow this.
> > > Try you will see
> > 
> > Try what exactly?
> > 
> > JMeter works fine for me if I try to exit without saving an updated test
> > plan.
> 
> Try the code that I wrote and run the junit tests.

Sorry, I see now, you meant that the fix causes the Stack Overflow.

IODH won't help here.

A possible work-round is for ActionRouter to add CheckDirty as a PreAction
Listener after it has finished populating the command map. i.e. we ban the use
of getInstance from classes that implement Command. I don't like that.

Another might be to get org.apache.jmeter.JMeter.startGui to run the
populateCommandMap code instead of doing it in getInstance. AFAICT that is the
first place where ActionRouter is created. This would mean making
populateCommandMap public, but it could protect itself from repeated
invocations by having a done flag (or seeing if there are any commands). A
quick test shows this seems to work.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to