Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333779

Summary: update configuration when repository settings are changed
Product: z_Archived Reporter: Frank Becker <eclipse>
Component: MylynAssignee: Frank Becker <eclipse>
Status: RESOLVED FIXED QA Contact: Robert Elves <robert.elves>
Severity: normal    
Priority: P3 CC: robert.elves, steffen.pingel, tomasz.zarna
Version: unspecified   
Target Milestone: 3.5   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch
none
mylyn/context/zip
none
patch V2
none
mylyn/context/zip
none
patch V3
none
mylyn/context/zip
none
NPE patch
none
NPE patch V2 steffen.pingel: iplog+

Description Frank Becker CLA 2011-01-07 13:05:48 EST
as requested in bug#333434 we need a better way to handle changes in the configuration

(In reply to comment #5)
> Frank, can you check if the XML header reflects the database encoding? All
> Bugzilla instances I looked at returned UTF-8 but they might have all indeed
> been configured for UTF-8.
> 
> The earliest we could release support for parsing the header would be in
> February as part of Helios SR2 (Mylyn 3.4.3 ). To support older Mylyn versions
> we need the <db_encoding/> tag around for a while.
(In reply to comment #8)
> Thanks Denis.
> 
> Frank, let's make sure that we have an open bug and patch against Bugzilla to
> get this into the standard configuration schema.
Comment 1 Frank Becker CLA 2011-01-08 16:45:47 EST
Created attachment 186336 [details]
patch

this patch changes method applyTo to add an update of the configuration if important fields in the BugzillaRepositorSettingsPage changed.
Comment 2 Frank Becker CLA 2011-01-08 16:45:52 EST
Created attachment 186337 [details]
mylyn/context/zip
Comment 3 Frank Becker CLA 2011-01-10 15:50:56 EST
Created attachment 186424 [details]
patch V2

some cleanup for the previous patch and

validation for USE_XMLRPC option
Comment 4 Frank Becker CLA 2011-01-10 15:50:58 EST
Created attachment 186425 [details]
mylyn/context/zip
Comment 5 Sam Davis CLA 2011-01-14 17:36:42 EST
This is causing an NPE because compareTo assumes that it's argument is not null, but repository.getProperty(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE) returns null.

Steps:
#start a clean eclipse
#open add repository wizard
#enter bugzilla info
#click validate
#click finish



java.lang.NullPointerException
	at java.lang.String.compareTo(Unknown Source)
	at org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaRepositorySettingsPage.applyTo(BugzillaRepositorySettingsPage.java:470)
	at org.eclipse.mylyn.internal.tasks.ui.wizards.NewRepositoryWizard.performFinish(NewRepositoryWizard.java:103)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430)
	at org.eclipse.mylyn.tasks.ui.wizards.TaskRepositoryWizardDialog.buttonPressed(TaskRepositoryWizardDialog.java:125)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.mylyn.internal.tasks.ui.commands.AddTaskRepositoryHandler.execute(AddTaskRepositoryHandler.java:44)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:178)
	at org.eclipse.mylyn.internal.tasks.ui.actions.AddRepositoryAction.showWizard(AddRepositoryAction.java:81)
	at org.eclipse.mylyn.internal.tasks.ui.actions.AddRepositoryAction.run(AddRepositoryAction.java:75)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 6 Frank Becker CLA 2011-01-16 11:21:24 EST
Created attachment 186886 [details]
patch V3

fix for the NPE
Comment 7 Frank Becker CLA 2011-01-16 11:21:26 EST
Created attachment 186887 [details]
mylyn/context/zip
Comment 8 Sam Davis CLA 2011-01-26 14:51:00 EST
Created attachment 187674 [details]
NPE patch

I'm getting more NPEs which make it impossible to create a repository. Here's a fix that I believe does what you want.
Comment 9 Sam Davis CLA 2011-01-26 14:54:38 EST
Created attachment 187676 [details]
NPE patch V2
Comment 10 Frank Becker CLA 2011-01-30 14:18:13 EST
Thanks Sam, I commit your NPE patch V2
Comment 11 Steffen Pingel CLA 2011-01-30 21:45:24 EST
Frank, when applying contributions please make sure to always set the "iplog" flag for the attachment in question.
Comment 12 Steffen Pingel CLA 2011-02-08 16:42:20 EST
Is there anything left to do here?
Comment 13 Frank Becker CLA 2011-02-15 15:32:29 EST
(In reply to comment #12)
> Is there anything left to do here?

We are done here.

Please reopen if there is something left.
Comment 14 Steffen Pingel CLA 2011-04-13 17:14:57 EDT
*** Bug 340835 has been marked as a duplicate of this bug. ***
Comment 15 Steffen Pingel CLA 2011-04-14 11:35:24 EDT
*** Bug 340237 has been marked as a duplicate of this bug. ***