[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Eclipse: set breakpoint when value changes - II

Posted on 2011-10-04
6
Medium Priority
?
750 Views
Last Modified: 2012-05-12
I've got a HashMap. Looking at in the Eclipse Expressions view, it looks like so:
- "tableMap" = LinkedHashMap<K,V> (id=26)
  + [0] LinkedHashMap$Entry<K,V> (id=43)
  + [1] LinkedHashMap$Entry<K,V> (id=47)
 
So at that point it is initialized.Then later it gets modified. My problem is that I can't find where this modification is happening. I would like to set a breakpoint such that the code stops when this map is written to, but I can't see how to do that.
Is there a way?

I've asked a very similar question before here:
http://www.experts-exchange.com/Programming/Editors_IDEs/Q_26941506.html
but never resolved it.

One thing that is different here is that I want to see when it changes, but don't know what it is changing to (and it doesn't really matter what is changing, just when). Also, the data within the map is changing, not the map reference itself.

One link:
http://stackoverflow.com/questions/1709929/is-there-a-way-in-the-eclipse-debugger-to-be-notified-when-the-state-of-a-java-ob
suggests:
To set a watch point, select a variable in the 'Outline' view in the 'Debug' perspective. Right click the variable, and press 'Toggle Watchpoint'. But I don't get the "Toggle Watchpoint" point when right-clicking on the variable. I do get it for variables that are of a Class, but not this map.

 
0
Comment
Question by:allelopath
  • 3
  • 3
6 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 36913218
>> Is there a way?

Well if all else fails, you can place a breakpoint in the map's put method
0
 
LVL 1

Author Comment

by:allelopath
ID: 36913381
That's a good idea, but leads to another question, which I will post shortly.
0
 
LVL 1

Author Comment

by:allelopath
ID: 36917497
Can anyone say why I don't get "Toggle Watchpoint" when right-clicking on the the map variable, but I do get it for variables that are of a Class?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Expert Comment

by:CEHJ
ID: 36917587
What happens when you do it with your own new subclass?
0
 
LVL 1

Author Comment

by:allelopath
ID: 37014156
Haven't had time to get back to this. Will close now and ask again if necessary.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 37014161
:)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month18 days, 21 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question