IJ feature that has always bugged me....

Often I end up creating a variable to return from a method like this:

List<StageCycleTime> cycleTimeForStages = processStageMetricsProvider.getCycleTimeForStages(stageCycleTime, startTime, endTime);
return cycleTimeForStages;

the only reason I create this return variable is so that I can see it in the debugger.  Of course IJ shows this as a code warning: "Local variable 'cycleTimeForStages' is redundant"

is there a better way to see this return variable other than creating one like this?

0
1 comment

If you press the "gear" button in the debug toolwindow, you'll find the "Watch method return values" option there. It should give you what you need. Note that it's disabled by default because it impacts debugging performance.

Note also that the "Redundant local variable" inspection has an option "Ignore immediately returned or thrown variables" to ignore cases like yours.

0

Please sign in to leave a comment.