Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 7075 Details for
Bug 48131
Code assistance and format for ambiguous inner Java class name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Actual result with the new code formatter
A_out.java (text/plain), 2.79 KB, created by
Olivier Thomann
on 2003-12-05 08:19:46 EST
(
hide
)
Description:
Actual result with the new code formatter
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2003-12-05 08:19:46 EST
Size:
2.79 KB
patch
obsolete
>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; > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 48131
: 7075