Bug 559910 - "Step through filters" has an impact even when "Use Step Filters" is disabled
Summary: "Step through filters" has an impact even when "Use Step Filters" is disabled
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.23   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-07 03:54 EST by Eike Stepper CLA
Modified: 2024-04-25 15:10 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Stepper CLA 2020-02-07 03:54:29 EST
Please have a look at this example code:

public class StepIntoLambda
{
  public static void main(String[] args)
  {
    Runnable r = () -> {
      doSomething();
    };

    r.run();
  }

  public static void doSomething()
  {
    System.out.println("Hello World");
  }
}

First Issue
===========

I was assuming that no step filtering applies when "Use Step Filters" is disabled. But when stepping into r.run() the behavior depends on the check state of the "Step through filters" checkbox, even though that checkbox is *disabled* together with the "Use Step Filters" setting and, hence, the entire preference page. This is very confusing and seems inconsistent.

Second Issue
============

The help description of the hard to understand "Step through filters" checkbox says: 

"This option controls step filters to always return from a filtered location or step through to a non-filtered location. For example, if java.util is a filtered location, stepping into code in HashMap could result in a call-back to your application code to check the equality of an object. If you choose to Step through filters a step into would end up in your application code. However, when the Step through filters option is disabled, a step into HashMap would behave like a step over."

In my code above, I think there's nothing that should be filtered out by any of the default filters, whether Step Filtering is enabled or not. So, why should this weird "Step through filters" checkbox make any difference at all in my case?

Third Issue
===========

If "Step through filters" is checked and I step into the r.run() call, why is the debugger's first stop *in* the doSomething() method and not in the lambda body where doSomething() is being called?

Fourth Issue
============

When I change the lambda to this:

    Runnable r = () -> {
      System.out.println();
      doSomething();
    };

I.e., when I insert a call *before* the method call that was ignored by the debugger (see issue three), only then the debugger stops on that inserted call, and then, when stepping further, stops on the doSomething() *call*. 

===

What's the reason for all this? Is this a combination of bugs? Or is it complete misunderstanding on my end?
Comment 1 Eike Stepper CLA 2020-03-21 13:01:52 EDT
Is it possible that you triage this bug and give some feedback?

Thank you ;-)
Comment 2 Sarika Sinha CLA 2020-03-22 02:58:45 EDT
(In reply to Eike Stepper from comment #1)
> Is it possible that you triage this bug and give some feedback?
> 
> Thank you ;-)

Will investigate!
Comment 3 Eike Stepper CLA 2020-03-22 03:07:24 EDT
Thanks! Please don't hesitate to ask if you find my description unclear...
Comment 4 Sarika Sinha CLA 2020-04-02 06:41:22 EDT
(In reply to Eike Stepper from comment #0)
> 
Too many issues here :) Answering some of them for which I could find the answer quickly -
Yes, ideally only the top filter section should be shown as disabled. I don't see this filter preference being used for below check boxes in code.


As the first sentence is method call it just goes inside and as stated in fourth issue it stops if there is any other statement there.
Comment 5 Sarika Sinha CLA 2020-04-02 07:21:07 EDT
If you enable "Use Step Filters", Uncheck "Step through Filters" and disbale "Use Step Filters" , it does not stop at doSomething(), so something in java base itself is getting filtered and hence it comes back to the next executable statement inside doSomething or sysout inside run.
Comment 6 Sarika Sinha CLA 2020-05-13 06:33:08 EDT
No time to work on this right now.
Comment 7 Eclipse Genie CLA 2022-05-04 02:16:05 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 8 Eike Stepper CLA 2022-05-05 01:16:50 EDT
None of the reported issues is resolved!
Comment 9 Eclipse Genie CLA 2024-04-25 15:10:42 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.