Community
Participate
Working Groups
Testing on build I-3.3.0-20110331154142 Create JPA 2.0, generic 2.0 project Create an entity with two attributes Map 1st atribute as the Id Map 2nd as one-to-many In details section for 2nd attribute click on join columns override default checkbox and receive the following error: org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalArgumentException: Index out of bounds) at org.eclipse.swt.SWT.error(SWT.java:4277) at org.eclipse.swt.SWT.error(SWT.java:4192) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4125) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3742) 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(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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) Caused by: java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:4258) at org.eclipse.swt.SWT.error(SWT.java:4192) at org.eclipse.swt.SWT.error(SWT.java:4163) at org.eclipse.swt.widgets.Widget.error(Widget.java:468) at org.eclipse.swt.widgets.Table.remove(Table.java:3232) at org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter.listItemsRemoved(TableModelAdapter.java:417) at org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter$2.itemsRemoved(TableModelAdapter.java:244) at org.eclipse.jpt.common.ui.internal.listeners.SWTListChangeListenerWrapper.itemsRemoved_(SWTListChangeListenerWrapper.java:177) at org.eclipse.jpt.common.ui.internal.listeners.SWTListChangeListenerWrapper$2.run(SWTListChangeListenerWrapper.java:101) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) ... 23 more
I fix the bug reported for M7. However, if the user clicks on "Override Default" check box many times rapidly, then the same exception and others will be thrown.
Recent changes fixed the remaining issue.
Still seeing these problems...Nan will comment further.
1. Go to "Java" entity -> Inheritance -> Primary key join columns 2. Try to select Override default checkbox The same exception as what described in the bug description is thrown.
Java/Orm Entity: 1. In JPA Details, go to entity -> Secondary Tables 2. Add a secondary table and select it 3. Try to select Primary key join columns -> Override default checkbox The same exception as what described in the bug description is thrown. Orm Entity: 1. Go to Java entity -> Secondary Tables to add a secondary table 2. Add the Java entity to the mapping xml 3. Go to Orm entity -> Secondary Tables 4. Try to select "Define in XML" check box 5. Select the secondary table in the list and then try to select Primary key join columns -> Override default checkbox The same exception as what described in the bug description is thrown at both step 4 & 5.
Moving JPA specific bugs to new JPA component in bugzilla.
*** Bug 310720 has been marked as a duplicate of this bug. ***
Please check the duplicate bug 310720 for more use cases.
Created attachment 205528 [details] proposed patch against maintenance
Tested patch against maintenance. I was unable to reproduce the original problem. I was able to get the exception using Secondary Tables, but it was difficult to reproduce (required rapid clicking of Override checkbox for over 10 seconds). As you mentioned this patch wasn't expected to solve issue of Secondary Tables join column override selection.
This patch is causing issues with adding multiple join columns to a relationship mapping and then changing the joining strategy to mappedBy or joinTable. There is going to need to be a larger fix to fix this issue.
The exceptions are happening because the UI is editing the model while changes are happening in the update thread. I have pushed the code in the UI down to the model where it belongs. Then the model changes can be completed in a batch fashion and not cause the update to happen while the context model is still changing. To fix this issue I need to add the following provisional API methods: org.eclipse.jpt.jpa.core.context.Entity PrimaryKeyJoinColumn getSpecifiedPrimaryKeyJoinColumn(int index); void convertDefaultPrimaryKeyJoinColumnsToSpecified(); void clearSpecifiedPrimaryKeyJoinColumns(); org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy void convertDefaultJoinColumnsToSpecified(); void clearSpecifiedJoinColumns(); org.eclipse.jpt.jpa.core.context.SecondaryTable PrimaryKeyJoinColumn getSpecifiedPrimaryKeyJoinColumn(int index); void convertDefaultPrimaryKeyJoinColumnsToSpecified(); void clearSpecifiedPrimaryKeyJoinColumns(); org.eclipse.jpt.jpa.core.context.ReferenceTable void clearSpecifiedJoinColumns(); The other related provisional API already existed including JoinTable.clearSpecifiedInverseJoinColumns() etc
Created attachment 214936 [details] proposed patch against HEAD
Neil could you review this patch? I am running unit tests right now and I have sent a note out to the dev list about the provisional API changes.
Patch looks good. Testing looks good.
Requesting PMC approval for a provisional API addition to fix a nasty UI regression. The fix is a bit on the large side, but isolated to the problem areas, as the new API and implementation are only used in the places where the UI functionality was broken. This is a movement of behavior out of the UI and into the model where it should have originally been. See comment 12 for additional information.
Agree on the change with the usual caution on the need for adequate testing.
Patch committed to head.
*** Bug 347218 has been marked as a duplicate of this bug. ***
Verified in Build I-3.4.0-20120507135259 Verified that no errors appear when you click on the override defaults checkbox in the different areas of the application. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.2_M7