Community
Participate
Working Groups
In a scrapbook page, if you type 'this.', you get CodeAssist suggestions showing the methods on Object. This makes it look to the user as if 'this' is valid in a scrapbook page. If you then actually code something like 'this.toString()', you get an error message when executing to the effect that "'this' cannot be used in a static context".
Is this a MacOS X specific problem? If not please change Platform to "All" (I'm tracking all problems where platform == Macintosh)
This is a problem on WinXP as well.
Hmm. We have to allow "this" for code like: Runnable r = new Runnable() { public void run() { System.out.println(this.toString()); } }; r.run();
The code completions actually come from our IEvaluationContext, which is genereated from the associated java project (i.e. IJavaProject#newEvaluationContext()). Moving to JDT core for comment. NOTE: not critical.
Is it possible to just disallow 'this' in the top-level context?
This is exactly what it should be already. Need to investigate, not critical though.
Actually, the code completion API doesn't carry the information about being in a static context. It will default to non-static. Would need to introduce a new API with isStatic flag (like evaluation APIs). Deferring
Deferring
reopen
Not for 3.0
Removing milestone of deferred item.
Reopen as LATER is deprecated...
Comment 3 code snippet is now accepted, I got following output while executing it: CodeSnippet_1$1@1a42792