Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsJDT Debug - How to watch non-public variables ?
https://www.eclipse.org/forums/index.php/mv/msg/1092686/1785057/#msg_1785057
programming but I am just learning the Java language and Eclipse. I want to see how Java works internally for some of the various "standard" imported classes using Eclipse's debug facilities (JDT Debug). My setup (Oxygen w/ JDK SE8 on Windows 8.1) works fine as far as single stepping through the code but many of the imported Class variables are unable to be placed into a watchlist or expression monitor, which I think is because they are not defined as "public".
As an example: I want to learn how java.math.BigInteger works so I wrote a quick program which uses the pow() method. The program runs successfully, and when using debug mode I am able to track the flow fine as well. What I cannot seem to do is to see the values of the internal "default" (no access modifier) variables. Below are three such variables found in BigInteger.java (lines 2225-2231):
int powersOfTwo = partToSquare.getLowestSetBit();
long bitsToShift = (long)powersOfTwo * exponent;
if (bitsToShift > Integer.MAX_VALUE) {
reportOverflow();
}
int remainingBits;
Any suggestions on how to expose these variables to JDT Debug for learning purposes?]]>Matthew Ambrose2018-04-08T20:50:11-00:00Re: JDT Debug - How to watch non-public variables ?
https://www.eclipse.org/forums/index.php/mv/msg/1092686/1785078/#msg_1785078
Normally if all the debugging properties are available, the values should be available without any extra work.]]>Sarika Sinha2018-04-09T08:41:41-00:00