Project

General

Profile

Actions

bug #7883

closed

IndexOutOfBoundsException in TermComboElement

Added by Patrick Plitzner over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
New
Assignee:
Patrick Plitzner
Category:
taxeditor
Target version:
Start date:
Due date:
% Done:

50%

Estimated time:
Severity:
normal
Found in Version:

Description

The combo element does not filter its elements according to the feature. It always shows all terms.

Example: Configure a feature to be quantitative and allow only meter as measurement unit.

login : admin

editor version : 5.4.0

server : test.e-taxonomy.eu (edit-test) / cyprus

schema version : 5.0.0.0.20180514

os : Windows Server 2012 R2 6.3 amd64

java : 1.8.0_121

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

                at java.util.ArrayList.rangeCheck(ArrayList.java:653)

                at java.util.ArrayList.get(ArrayList.java:429)

                at eu.etaxonomy.taxeditor.ui.combo.TermComboElement.widgetSelected(TermComboElement.java:286)

                at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)

                at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

                at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)

                at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)

                at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103)

                at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1088)

                at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:802)

                at org.eclipse.swt.custom.CCombo.listEvent(CCombo.java:1175)

                at org.eclipse.swt.custom.CCombo$1.handleEvent(CCombo.java:116)

                at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

                at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)

                at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)

                at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236)

                at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824)

                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)

                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)

                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)

                at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)

                at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)

                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)

                at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)

                at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)

                at eu.etaxonomy.taxeditor.Application.start(Application.java:24)

                at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

                at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)

                at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)

                at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)

                at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:498)

                at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)

                at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)

                at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Actions #1

Updated by Patrick Plitzner over 5 years ago

Fixed the problem by removing ambiguous method setTerms() which "overwrote" the actual filtering of the terms according to the definition of the feature.


    public void setTerms(List<T> terms) //#1

    public void setTerms(ArrayList<T> terms) //#2

This is a real tricky case because the methods are actually different and are called depending on the type of the reference of the list.

    List list = new ArrayList();
    setTerms(list); //calls #1


    ArrayList list = new ArrayList();
    setTerms(list); //calls #2

@Katja: Aside from the method, you changed a lot of class members from private to protected and also added getters and setters. I suppose this was for MisappliedRelationshipComboElement. But in the end you did not use those methods so I removed them. Please review.

Actions #2

Updated by Patrick Plitzner over 5 years ago

  • Status changed from New to Resolved
  • Assignee changed from Patrick Plitzner to Katja Luther
  • % Done changed from 0 to 50
Actions #3

Updated by Katja Luther over 5 years ago

  • Status changed from Resolved to Closed
  • Assignee changed from Katja Luther to Patrick Plitzner

this works as expected.

Actions

Also available in: Atom PDF