Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mylyn-integrators] Can TaskComment be subclassed?

These classes are very attribute containers, most of the setter/getter methods are just convenience methods hiding the repository key. If these are to become final you lose the flexibility of the attribute container scheme. So it is no longer extensible.

I think the solution is to refactor the deepCopy operation inside TaskDataManager$ObjectCloner.deepCopy so it no longer needs serialization.

If you go for making final, then these classes need a fully orthogonal set of getters/setters.
For example TaskComment misses the following:
- getAuthor(String)
- getTaskId()
- setAuthorName(String)
- setCreated(String)
- setTaskId(String)
- setText(String)

And AbstractTask misses the following:
- getEstimatedTimeHours see bug 222196: [api]renameAbstractTask.getEstimateTimeHoursto getEstimatedTimeHours

If you have some attributes with convenience getters setters and others without, you become less flexible.


Op 26 mrt 2008, om 00:39 heeft Robert Elves het volgende geschreven:
Shawn and I were just discussing this further and are of the mind that the class loading issue could be resolved if Mylyn participated in buddy policies. But since this is not ideal nor likely (at least for 3.0) you will have to make use the the standard TaskComment class. This raises an interesting issue wrt the api: TaskComment and all TaskData related classes should be final. I'll create a new bug report to address this.

The stack track you reported below appears to be a result of this same problem.

-Rob

Maarten Meijer wrote:
Hi Rob,

yes I'm exporting the com.industrialtsi.db.core package in my MANIFEST.MF

The other error I get when clicking on 'the task has incoming changes' is:

java.lang.NullPointerException
at org.eclipse.mylyn.tasks.ui.editors.AbstractRepositoryTaskEditor $1.getSelection(AbstractRepositoryTaskEditor.java:385) at org .eclipse .ui .internal .AbstractSelectionService .getSelection(AbstractSelectionService.java:220) at org .eclipse .ui .internal .services .CurrentSelectionSourceProvider .updateWindows(CurrentSelectionSourceProvider.java:137) at org .eclipse.ui.internal.services.CurrentSelectionSourceProvider.access $0(CurrentSelectionSourceProvider.java:124) at org.eclipse.ui.internal.services.CurrentSelectionSourceProvider $1.handleEvent(CurrentSelectionSourceProvider.java:67) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java: 84)
   at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1107)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1552)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1577)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1558)
at org.eclipse.swt.widgets.Shell.kEventWindowActivated(Shell.java:922)
   at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2027)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:4080)
   at org.eclipse.swt.internal.carbon.OS.DisposeWindow(Native Method)
   at org.eclipse.swt.widgets.Shell.destroyWidget(Shell.java:588)
   at org.eclipse.swt.widgets.Widget.release(Widget.java:1433)
   at org.eclipse.swt.widgets.Widget.dispose(Widget.java:668)
   at org.eclipse.jface.window.Window.close(Window.java:335)
   at org.eclipse.jface.dialogs.Dialog.close(Dialog.java:978)
   at org.eclipse.jface.dialogs.TrayDialog.close(TrayDialog.java:143)
at org.eclipse.jface.wizard.WizardDialog.hardClose(WizardDialog.java: 797) at org.eclipse.jface.wizard.WizardDialog.close(WizardDialog.java: 427) at org .eclipse.jface.wizard.WizardDialog.cancelPressed(WizardDialog.java: 414) at org.eclipse.jface.wizard.WizardDialog $1.widgetSelected(WizardDialog.java:293) at org .eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java: 227) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java: 84)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1553)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1577)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1562)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java: 1353) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3409) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java: 3007)
   at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
   at org.eclipse.jface.window.Window.open(Window.java:801)
at org .eclipse .mylyn .tasks.ui.TasksUiUtil.openEditRepositoryWizard(TasksUiUtil.java:451) at org.eclipse.mylyn.tasks.ui.editors.AbstractRepositoryTaskEditor $6$1.linkActivated(AbstractRepositoryTaskEditor.java:660) at org .eclipse .ui .forms .widgets.AbstractHyperlink.handleActivate(AbstractHyperlink.java:228) at org .eclipse .ui .forms .widgets.AbstractHyperlink.handleMouseUp(AbstractHyperlink.java:316) at org.eclipse.ui.forms.widgets.AbstractHyperlink.access $2(AbstractHyperlink.java:300) at org.eclipse.ui.forms.widgets.AbstractHyperlink $4.handleEvent(AbstractHyperlink.java:119) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java: 84)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1553)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1577)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1562)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java: 1353) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3409) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java: 3007) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java: 2392)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2356)
   at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2222)
   at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:474)
at org .eclipse .core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org .eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java: 469) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org .eclipse .ui .internal.ide.application.IDEApplication.start(IDEApplication.java: 106) at org .eclipse .equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org .eclipse .core .runtime .internal .adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java: 106) at org .eclipse .core .runtime .internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java: 76) at org .eclipse .core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:362) at org .eclipse .core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun .reflect .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun .reflect .DelegatingMethodAccessorImpl .invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 564)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1251)
   at org.eclipse.equinox.launcher.Main.main(Main.java:1227)

Op 25 mrt 2008, om 23:12 heeft Robert Elves het volgende geschreven:
Hi Maarten,
Is com.industrialtsi.db.core being exported on the runtime tab of your plugin.xml/manifest editor? Barring that it could be related to the serialization that takes place as part of the deepCopy.

-Rob

Maarten Meijer wrote:
I'm trying to read some comment data directly from an SQL database. For easier use of the ibatis library I've subclassed TaskComment with more setters and getters.
Sometimes it works, sometimes it doesn't, then I get:

java.lang.ClassNotFoundException: com.industrialtsi.db.core.IbatisComment at org .eclipse .osgi .framework .internal.core.BundleLoader.findClassInternal(BundleLoader.java: 467) at org .eclipse .osgi .framework.internal.core.BundleLoader.findClass(BundleLoader.java: 383) at org .eclipse .osgi .framework.internal.core.BundleLoader.findClass(BundleLoader.java: 371) at org .eclipse .osgi .internal .baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java: 87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java: 585) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java: 1544) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java: 1466) at java .io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java: 1699) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java: 1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at java.util.ArrayList.readObject(ArrayList.java:591)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun .reflect .DelegatingMethodAccessorImpl .invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java: 946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java: 1809) at java .io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java: 1719) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java: 1305) at java .io.ObjectInputStream.defaultReadFields(ObjectInputStream.java: 1908) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java: 1832) at java .io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java: 1719) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java: 1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.eclipse.mylyn.internal.tasks.core.TaskDataManager $ObjectCloner.deepCopy(TaskDataManager.java:288) at org .eclipse .mylyn .internal .tasks.core.TaskDataManager.getEditableCopy(TaskDataManager.java: 146) at org .eclipse .mylyn .tasks .ui .editors .AbstractRepositoryTaskEditorInput .refreshInput(AbstractRepositoryTaskEditorInput.java:129) at org .eclipse .mylyn .tasks .ui .editors .AbstractRepositoryTaskEditor .refreshEditor(AbstractRepositoryTaskEditor.java:3648) at org .eclipse.mylyn.internal.tasks.ui.actions.SynchronizeEditorAction $1$1.run(SynchronizeEditorAction.java:82)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org .eclipse .swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:130) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java: 3273) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java: 3011) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java: 2392)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2356)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2222)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:474)
at org .eclipse .core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org .eclipse .ui.internal.Workbench.createAndRunWorkbench(Workbench.java:469) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java: 149) at org .eclipse .ui .internal .ide.application.IDEApplication.start(IDEApplication.java:106) at org .eclipse .equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java: 193) at org .eclipse .core .runtime .internal .adaptor .EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org .eclipse .core .runtime .internal .adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org .eclipse .core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:362) at org .eclipse .core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun .reflect .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun .reflect .DelegatingMethodAccessorImpl .invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:564)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1251)
at org.eclipse.equinox.launcher.Main.main(Main.java:1227)

Is there something I missed in TaskDataManager $ObjectCloner.deepCopy() or something else.

Maarten
------------------------------------------------------------------------

_______________________________________________
mylyn-integrators mailing list
mylyn-integrators@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mylyn-integrators



--
Robert Elves
Mylyn Committer, http://eclipse.org/mylyn

_______________________________________________
mylyn-integrators mailing list
mylyn-integrators@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mylyn-integrators


_______________________________________________
mylyn-integrators mailing list
mylyn-integrators@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mylyn-integrators



--
Robert Elves
Mylyn Committer, http://eclipse.org/mylyn

_______________________________________________
mylyn-integrators mailing list
mylyn-integrators@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mylyn-integrators




Back to the top