Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 461001 - Debug/Display on anomymous class methods is broken
Summary: Debug/Display on anomymous class methods is broken
Status: CLOSED DUPLICATE of bug 45507
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.4.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.5 M6   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-26 16:41 EST by Zorzella Mising name CLA
Modified: 2015-02-27 00:49 EST (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 Zorzella Mising name CLA 2015-02-26 16:41:05 EST
/**
 * Put a breakpoint where indicated below, and "Debug As Java Application".
 * Once the breakpoint hits, select each of the things in the allInScope array,
 * and hit Shift+Ctrl+D ("Display") to display their values (or use the
 * "Display View"). Of the 4 things that are in scope, only the "local"
 * variable can be displayed. For the others, you get a
 * '... cannot be resolved to a variable".
 */
public class AnonClassDebugDisplayBug {
  public static void main(final String[] args) {    
    final String bar = "bar";
    new Runnable() {
      
      String baz = "baz";
      
      @Override public void run() {
        String local = "local";
        Object[] allInScope = new Object[]{args, bar, baz, local};
        System.out.println(allInScope.length); // PUT A BREAKPOINT HERE
      }
    }.run();
  }  
}
Comment 1 Sarika Sinha CLA 2015-02-27 00:49:02 EST
It has been fixed in 4.5 M5.

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