Bug 117982 - Problem with field prefix list in codestyle option page
Summary: Problem with field prefix list in codestyle option page
Status: RESOLVED DUPLICATE of bug 114086
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-24 21:38 EST by Evermind CLA
Modified: 2005-12-14 07:57 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evermind CLA 2005-11-24 21:38:40 EST
According to the Field Name Convensions dialog, multiple field prefix's are comma separated. In my team, three prefix's are used: 'f', '_', and ''(no prefix) because of individual preference and legacy code. So we have to add three of them to eclipse's field prefix list.

    Thus, when I configure the field prefix as "f,_,", which means the last prefix is "no prefix", the dialog just omits the last prefix. If it is configured as ",f,_" or "f,,_", where "no prefix" is at the first or in the middle, an exception will occur when I invoke Menu->Source->Generate Getters and Setters. The log information is as follows:


-----------------------------------------------------------------
!ENTRY org.eclipse.ui 4 4 2005-11-25 10:34:28.000
!MESSAGE "Show Source Quick Menu" did not complete normally.  Please see the log for more information.

!ENTRY org.eclipse.ui 4 0 2005-11-25 10:34:28.000
!MESSAGE -1
!STACK 0
java.lang.ArrayIndexOutOfBoundsException: -1
	at org.eclipse.jdt.core.NamingConventions.removePrefixAndSuffix(NamingConventions.java:245)
	at org.eclipse.jdt.core.NamingConventions.removePrefixAndSuffixForFieldName(NamingConventions.java:364)
	at org.eclipse.jdt.core.NamingConventions.suggestAccessorName(NamingConventions.java:894)
	at org.eclipse.jdt.core.NamingConventions.suggestGetterName(NamingConventions.java:750)
	at org.eclipse.jdt.core.NamingConventions.suggestGetterName(NamingConventions.java:789)
	at org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil.getGetterName(GetterSetterUtil.java:50)
	at org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil.getGetterName(GetterSetterUtil.java:46)
	at org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil.getGetter(GetterSetterUtil.java:65)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.createGetterSetterMapping(AddGetterSetterAction.java:728)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:271)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:525)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:226)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:198)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:544)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:494)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:406)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:896)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3236)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2856)
	at org.eclipse.jdt.internal.ui.actions.QuickMenuAction.run(QuickMenuAction.java:79)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:182)
	at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:108)
	at org.eclipse.core.commands.Command.execute(Command.java:287)
	at org.eclipse.core.commands.ParameterizedCommand.execute(ParameterizedCommand.java:401)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:459)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:781)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:828)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:550)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:493)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:117)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:975)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:895)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:920)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:905)
	at org.eclipse.swt.widgets.Control.traverse(Control.java:2885)
	at org.eclipse.swt.widgets.Control.translateMnemonic(Control.java:2726)
	at org.eclipse.swt.widgets.Composite.translateMnemonic(Composite.java:877)
	at org.eclipse.swt.widgets.Control.translateMnemonic(Control.java:2744)
	at org.eclipse.swt.widgets.Display.translateMnemonic(Display.java:3735)
	at org.eclipse.swt.widgets.Display.filterMessage(Display.java:989)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2852)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1774)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1738)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:376)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
-----------------------------------------------------------------

    Our team feels the capability of eclipse that processes both prefixed and non-prefixed fields important. The order of the prefix's is also important to us since it determines the order of proposed field names which follow different convensions. I wish the problem be solved easily.

    Thank you and your organization for what you have done for us.
Comment 1 Frederic Fusier CLA 2005-11-25 04:57:24 EST
Target is set to indicate when the bug is supposed to be fixed, not on which version it does occur. For this, you have the 'Version' field.

As this Version field is not enough precise (bugs are theoretically opened on a official delivered version, e.g. 3.1, 3.1.1, etc... ), it's really helpful to add in bug comment what is the build ID, as you can use milestones delivery or even though integration builds...

Thx

Comment 2 Evermind CLA 2005-11-25 08:35:27 EST
Sorry for misunderstanding the Target field. The following lines are copied from Help->About Eclipse SDK dialog. I hope this useful to you. BTW: The problem occurs even when no plugins are installed.

----------------------------
Eclipse SDK

Version: 3.2.0
Build id: I20051102-1600
Comment 3 Jerome Lanneluc CLA 2005-12-14 07:57:19 EST

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