Bug 502395 - Allows to setup breakpoint in default constructor and inherited methods
Summary: Allows to setup breakpoint in default constructor and inherited methods
Status: CLOSED DUPLICATE of bug 209460
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.7 M3   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-28 05:16 EDT by Stanislav Spiridonov CLA
Modified: 2016-10-03 02:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Spiridonov CLA 2016-09-28 05:16:23 EDT
I think now it is possible with condition breakpoint on the parent class. Will be greate if Eclipce will handle it automatically. E.g. in the outline view select inherited method and add breakpoint to it or add special section to condition breakpoints.
Comment 1 Sarika Sinha CLA 2016-09-28 12:58:28 EDT
Please explain the requirement.
Comment 2 Stanislav Spiridonov CLA 2016-09-29 02:41:10 EDT
Imagine I want to add new breakpoint to the toString method for the library class (e.g. java.util.ArrayList<E>). How can I do it? 

The same question how I can add a breakpoint to default constructor of the same class (java.util.ArrayList<E>).

I select the class just for example to demonstrate the issue.
Comment 3 Sarika Sinha CLA 2016-09-29 10:52:16 EDT
We can create a breakpoint for the classes which have been compiled with Line numbers.
We can create a breakpoint at toString or default constructor.
Comment 4 Stanislav Spiridonov CLA 2016-09-30 04:30:58 EDT
I am sorry, but how I can setup a breakpoint for toString method in java.util.ArrayList<E> or, for example, in such class:

public class A {

}
Comment 5 Stanislav Spiridonov CLA 2016-09-30 04:32:10 EDT
the same question for a default constructor.
Comment 6 Sarika Sinha CLA 2016-10-02 23:45:14 EDT
default constructor is defined for AbstractList<E> and not ArrayList, Similarly toString is defined in AbstractCollection class. 
You can open the class file by the shortcut (Ctrl + Shift + T)
Comment 7 Stanislav Spiridonov CLA 2016-10-03 02:33:14 EDT
Sorry, but with you solution the program will stop on any calling of toString for ANY child class. The goal is to to break the program execution only in case of calling the toString of ArrayList instance. Hope it is clear now. 

As I described in my initial comment, it is possible only if I will set the breakpoint in the parent class (as you correctly mentioned in your last comment) and will add the condition (this instanceof ArrayList).

The intention of this issue is somehow to automate this process.
Comment 8 Sarika Sinha CLA 2016-10-03 02:47:12 EDT
Oh!! Do you mean Bug 209460 ?
Comment 9 Stanislav Spiridonov CLA 2016-10-03 02:49:28 EDT
Yes, exactly it.
Comment 10 Sarika Sinha CLA 2016-10-03 02:55:49 EDT

*** This bug has been marked as a duplicate of bug 209460 ***