Wednesday, 15 September 2010

java - Eclipse debug breakpoint stopping only on virtual invocation of specific subclass -



java - Eclipse debug breakpoint stopping only on virtual invocation of specific subclass -

let's have abstract class method onpoke(..).

abstract class basevaluepanel{ void onpoke(int depth){ //blah, blah, ... } } classes numbervaluepanel, attributevaluepanel, categoryvaluepanel extend basevaluepanel. among others, class decimalvaluepanel extends numbervaluepanel. among others, class estimationvaluepanel extends decimalvaluepanel. none of extension classes overrides onpoke(..) method.

now, wish place breakpoint on onpoke(..) when invoked thro object of class estimationvaluepanel.

because right now, if placed breakpoint on onpoke(..), debugger stop thousands of instances (because of extensive descendant classes of basevaluepanel) , 1 of due invocation thro estimationvaluepanel.

what sequence of set-up or strategy of breakpoint set-up need employ, in order allow debugger stop when method invoked thro estimationvaluepanel.

what meant virtual breakpoint ...: is, in java opposed c#, non-private, non-static, (overridable) methods naturally virtual. hence, virtual invocation here.

of course of study can override method in class estimationvaluepanel , set breakpoint there.

but can utilize conditional breakpoints: go properties of breakpoint on method onpoke() (right-click or ctrl + double-click) , select "conditional". in text area below can come in next condition:

this instanceof estimationvaluepanel

this means status evaluated everytime method entered. if experience perfomance issues, should prefer override method in estimationvaluepanel.

java eclipse debugging virtual-method

No comments:

Post a Comment