Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344645 - IllegalStateException when clicking Daily expiry radio button more than once
Summary: IllegalStateException when clicking Daily expiry radio button more than once
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard: fix_ready
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 17:49 EDT by Nan Li CLA
Modified: 2011-08-04 15:47 EDT (History)
3 users (show)

See Also:


Attachments
proposed patch against head (1003 bytes, patch)
2011-06-15 09:11 EDT, Karen Butzke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nan Li CLA 2011-05-03 17:49:41 EDT
Build Identifier: I20110427-1300

1. At entity level, go to JPA Details view -> Caching -> Advanced
2. Try to click the radio button of Daily expiry more than once
3. The following exception will be thrown:

--------------
java.lang.IllegalStateException: expiry time of day already exists: EclipseLinkJavaTimeOfDay[6D-43-0F-4E]
	at org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkCachingImpl.addExpiryTimeOfDay(JavaEclipseLinkCachingImpl.java:371)
	at org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkExpiryComposite$3.setValue_(EclipseLinkExpiryComposite.java:204)
	at org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkExpiryComposite$3.setValue_(EclipseLinkExpiryComposite.java:1)
	at org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter.setValue(AspectPropertyValueModelAdapter.java:92)
	at org.eclipse.jpt.common.ui.internal.utility.swt.BooleanButtonModelBinding.buttonSelected(BooleanButtonModelBinding.java:170)
	at org.eclipse.jpt.common.ui.internal.utility.swt.BooleanButtonModelBinding$2.widgetSelected(BooleanButtonModelBinding.java:119)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
	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:4163)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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:344)
	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:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
----------

We should have a better way to handle this situation.

Reproducible: Always
Comment 1 Karen Butzke CLA 2011-06-15 09:11:39 EDT
Created attachment 198015 [details]
proposed patch against head

This patch just adds a check for a null expiryTimeOfDay object before adding it in the the model
Comment 2 Karen Butzke CLA 2011-06-29 10:46:05 EDT
checked in to 3.0 maintenance and HEAD
Comment 3 Jolene Moffitt CLA 2011-08-04 15:47:30 EDT
Verified in Build I-3.4.0-20110731180834

Verified you can click twice on Daily Expiry radio button without error.  See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.0.1