Community
Participate
Working Groups
package de.neze.bugreport.eclipse; //Code generator imported: import de.neze.bugreport.eclipse.GeneralConcept.Item; //Code generator imported: import de.neze.bugreport.eclipse.GeneralConcept.Problem; /** * Feature Missing in Eclispe M5: * * I like to write code like as noted below, and it seams that eclispe * handling of ambigouse inner class names is suboptimal during codeassistance. * And the code formater has problems with disambigouated names. * Note: The exampe below is optimzed for shortness and that make it look a * little bit stupid, but "real world" exmples are much longer .. . */ public abstract class AssistMyStyle { public static final class Problem extends Exception { } public static final class Item { } public static interface Factory { AssistMyStyle newAssistMyStyle() throws Problem; } abstract Item someMethod() throws Problem; } /** * and */ interface GeneralConcept { public static final class Problem extends Exception { } public static final class Item { } abstract Item anotherMethodWithLongNameToForceCodeformaterToBreakTheLine() throws Problem; } /** * ... and as a result I have many inner classes with the names * "Problem", "Factory" or "Item". * Now I Use code completation to procduce method stubs and got errors * as note in the method comments below. * I use "Automatically add import instead of qualified name" in * Window > Preferences > Java > Editor > Code Assist: */ class AssistMyStyleImpl extends AssistMyStyle implements GeneralConcept { public static final class Factory implements AssistMyStyle.Factory { public AssistMyStyle newAssistMyStyle() { return new AssistMyStyleImpl(); } } /** * <pre> * Item someMethod() throws Problem { * return null; * } * </pre> * Implies errors: * [1] The exception type Problem is ambiguous for the method someMethod * [2] The return type Item is ambiguous for the method someMethod * I fix this: */ AssistMyStyle.Item someMethod() throws AssistMyStyle.Problem { return null; } /** * anotherMethodWithLongNameToForceCodeformaterToBreakTheLine() * <pre> * public Item anotherMethodWithLongNameToForceCodeformaterToBreakTheLine() * throws Problem { * // XXX Auto-generated method stub * return null; * } * </pre> * Implies error: * [1] The exception type Problem is ambiguous for the method * anotherMethodWithLongNameToForceCodeformaterToBreakTheLine() * [2] The return type Item is ambiguous for the method * anotherMethodWithLongNameToForceCodeformaterToBreakTheLine * I fix this and used code format (looks ugly!!!!): */ public GeneralConcept .Item anotherMethodWithLongNameToForceCodeformaterToBreakTheLine() throws GeneralConcept.Problem { return null; } } /** * Note: There are more erros not noted here, you have to rewrite this example * to see all my struggles * Suggestion: * [1] In "Window > Preferences > Java > Editor > Code Assist" add an * flag "Don't import inner classes" or "Import only toplevel classes" * (and of course implemented it). * [2] Don't break disambigouated names above the line end during code format. * By the way: If you don't like "my style" the code generator has still a * problem becuse it producess buggy code. * So you may change this feature request to an bug report. * * Kind regards * * mle@neze.de **/
Oh - Horror! I read my example again and I have the strong need to apologise for my bad english grammar and orthography: Please excuse me.
Created attachment 7075 [details] Actual result with the new code formatter Here is the actual result with the new formatter. You can enable it in Preferences>Java>Work in progress. If you use the latest integration build, then you can also set the preferences through the code formatter preferences page.
No word about my problems with the code assistant?
Btw: The new code formater formats private final Object o( Object oBegin, Object oEnd, Object oSB // ) throws Throwable { ... as /** * openRelativePath() */ private final Object o(Object oBegin, Object oEnd, Object oSB // ) throws Throwable { ... and I don't like that (I tried that a few mont ago). Now I hope that becomes configureable if its new options page are available ... . I will wait patient.
What do you expect? You have a line comment in the parameters of your method declaration.
First of all the code formater is not my (min) issue in this report, I expect an code assist option "Import only toplevel classes" for the code assist functinality "Automatically add import instead of qualified name". Now to your (main?) issue: My line comments in my source code make the old code formater behave more as I like it .... . I hope the new code formaters option dialog makes that obsolete in the future.
Remark to #5: Now I believe understand your question (sorry I'm late). My "argument tower" is not hand made but is formated with the old code formater
Hello? Hello echo .. echoo oo oo oo (listen ... silence everywhere!). Is somebody (other then myself) interested in this report? Have I made a mistake or something like that?
You better reformulate your problem, as I read this bug report I don't understand what's you expectation. Is it a problem with code assit or with the formatter? If it is the latter, what are you currently seeing? What would you like to see?
This report is a combined bug-report and feature request and it is not intended for readers but for rewriters. My intension was that somebody copies the source code, deletes the class AssistMyStyleImpl and rewrittes it as outlined in the comments of class AssistMyStyleImpl. The kind rewriter runs in many problems, each of this problems may become a bug report of its own, but I have no time to write them. At the end I suggest a feature for eclispe: [1] In "Window > Preferences > Java > Editor > Code Assist" add an * flag "Don't import inner classes" or "Import only toplevel classes" I think this feature is self explanatory. If nobody is interested to rewrite my example you may close this report, because only people withthe same problems may understand it.
Closing then. Please enter concise bug reports in the future trying to focus on one problem each.