Bug 317045 - Debug variables hover does not show value of fields of outer class
Summary: Debug variables hover does not show value of fields of outer class
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement with 4 votes (vote)
Target Milestone: 4.13 M3   Edit
Assignee: Andrey Loskutov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 285657 286237 350442 531673 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-16 10:00 EDT by Lysathor CLA
Modified: 2019-09-03 02:53 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lysathor CLA 2010-06-16 10:00:23 EDT
During debug (pause): Hovering mouse over fields should display the name. If within an inner class only the values of fields of the inner class are shown, outer class fields values are not resolved (not the value but the type is displayed).
In the following excample. If breakpointis in assign: b will be displayed, but not a. When pasting "a" and "b" to "Expresseions" both values are displayed.
class A 
{
 int a;
  class B
  {
    int b;
    void assign()
    {
    	b=a;
    }
  }
}


-- Configuration Details --
Product: Eclipse 1.3.0.20100609-1425 (org.eclipse.epp.package.java.product)
Installed Features:
 org.eclipse.jdt 3.6.0.v20100526-0800-7z8XFUJFMTfCWGoVuHImpms9H155
Comment 1 Lysathor CLA 2010-08-18 17:01:15 EDT
*** Bug 285657 has been marked as a duplicate of this bug. ***
Comment 2 Lysathor CLA 2010-08-18 17:17:45 EDT
*** Bug 286237 has been marked as a duplicate of this bug. ***
Comment 3 Victor Zverovich CLA 2012-04-17 07:15:57 EDT
I have a similar issue (hover doesn't display values of variables) for local variables and parameters in methods of generic classes. Here is a small example that reproduces the issue:

class A<T> {
    T f(T t) {
        return t;
    }
}

class B {
    Integer f(Integer t) {
        return t;
    }
}

public class App {
    public static void main(String[] args) {
        new A<Integer>().f(1);
        new B().f(1);
    }
}

If you break in B.f and hover over t, the type and value (1) information is displayed in the tooltip.

However, if you break in A<T>.f and hover over t, no value is reported in the tooltip, only the following text: T t - A.f(T)
Comment 4 Dani Megert CLA 2015-11-25 08:09:03 EST
Same with the simpler case as well:

public class DebugHoverBug {
	public static void main(String[] args) {
		Data d= new Data();
		System.out.println(d.i);
		System.out.println(d.s);
	}
}
class Data {
	int i= 1;
	String s= "bug";
}
Comment 5 Dani Megert CLA 2015-11-25 09:29:43 EST
(In reply to Dani Megert from comment #4)
> Same with the simpler case as well:

This is bug 221886.
Comment 6 chen bo CLA 2018-08-24 02:12:10 EDT
I really can't stand this bug,
Why do you want to display value is so troublesome, I just want to hover to see the value directly.
Instead of looking in other windows, I don't want to use a watch or the like.
In contrast to chrome, the value of the variable is displayed directly in the editor, which is the most convenient.
If you can, I hope eclipse can also achieve such a function.
But before this, I hope to hover directly to see the value of the variable.
Thank you!
Comment 7 Sarika Sinha CLA 2018-08-24 02:20:29 EDT
Eclipse is working on Code mining feature which will enable displaying of values without hovering.
Comment 8 Andrey Loskutov CLA 2019-08-14 11:59:17 EDT
*** Bug 350442 has been marked as a duplicate of this bug. ***
Comment 9 Andrey Loskutov CLA 2019-08-14 12:02:20 EDT
*** Bug 531673 has been marked as a duplicate of this bug. ***
Comment 10 Andrey Loskutov CLA 2019-08-14 12:15:13 EDT
I have a fix.

To reproduce, try to run this snippet in debugger and hover over "text" values.

public class DebugTest {

	private String text = "Hello";

	public static void main(String[] args) throws Exception {
		new DebugTest().doStuff();
	}

	public void doStuff() {
		new Runnable() {
			@Override
			public void run() {
				System.out.println(text); // bp here
				new Runnable() {
					@Override
					public void run() {
						System.out.println(text); // bp here
					}
				}.run();
			}
		}.run();
		new InnerClass().doInnerClassStuff();
	}

	class InnerClass {
		public void doInnerClassStuff() {
			System.out.println(text); // bp here
		}

	}
}
Comment 11 Eclipse Genie CLA 2019-08-14 12:24:45 EDT
New Gerrit change created: https://git.eclipse.org/r/147724
Comment 13 Sarika Sinha CLA 2019-08-20 01:28:53 EDT
Eclipse SDK

Version: 2019-09 (4.13)
Build id: I20190818-1800