Project

General

Profile

Actions

bug #8482

closed

java.lang.IllegalArgumentException: Collection is empty in DescriptionType.includesType(DescriptionType.java:151)

Added by Andreas Kohlbecker over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
normal
Found in Version:

Description

Can be reproduced by:

http://int.e-taxonomy.eu/cdmserver/integration_palmae/portal/taxon/ce870eca-0422-4a3c-b849-0f5ca0370b1f/descriptions.json

Caused by: net.sf.json.JSONException: java.lang.reflect.InvocationTargetException
    at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:818)
    at net.sf.json.JSONObject._fromBean(JSONObject.java:699)
    at net.sf.json.JSONObject.fromObject(JSONObject.java:172)
    at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274)
    at net.sf.json.JSONArray._processValue(JSONArray.java:2513)
    at net.sf.json.JSONArray.processValue(JSONArray.java:2538)
    at net.sf.json.JSONArray.addValue(JSONArray.java:2525)
    at net.sf.json.JSONArray._fromCollection(JSONArray.java:1056)
    at net.sf.json.JSONArray.fromObject(JSONArray.java:123)
    at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:240)
    at net.sf.json.JSONObject._processValue(JSONObject.java:2655)
    at net.sf.json.JSONObject.processValue(JSONObject.java:2721)
    at net.sf.json.JSONObject.setInternal(JSONObject.java:2736)
    at net.sf.json.JSONObject.setValue(JSONObject.java:1424)
    at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:765)
    at net.sf.json.JSONObject._fromBean(JSONObject.java:699)
    at net.sf.json.JSONObject.fromObject(JSONObject.java:172)
    at eu.etaxonomy.cdm.remote.view.JsonView.render(JsonView.java:128)
    at eu.etaxonomy.cdm.remote.view.JsonView.render(JsonView.java:188)
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1243)
    at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
    ... 61 more
Caused by: java.lang.reflect.InvocationTargetException
    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.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2116)
    at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1267)
    at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:808)
    at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:884)
    at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:464)
    at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:749)
    ... 84 more
Caused by: java.lang.IllegalArgumentException: Collection is empty
    at java.util.EnumSet.copyOf(EnumSet.java:174)
    at eu.etaxonomy.cdm.model.description.DescriptionType.includesType(DescriptionType.java:151)
    at eu.etaxonomy.cdm.model.description.DescriptionBase.isCloneForSource(DescriptionBase.java:361)
    ... 94 more

Related issues

Related to EDIT - task #8483: Return EnumSets in EnumeratedTermVoc.getGeneralizationOf and similar methodsNewAndreas Müller

Actions
Actions #1

Updated by Andreas Müller over 4 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50
Actions #2

Updated by Andreas Müller over 4 years ago

  • Related to task #8483: Return EnumSets in EnumeratedTermVoc.getGeneralizationOf and similar methods added
Actions #3

Updated by Andreas Müller over 4 years ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker
Actions #4

Updated by Andreas Kohlbecker over 4 years ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Kohlbecker to Andreas Müller
  • % Done changed from 50 to 90

The problems obviously is fixed and the implementation looks good. Why did you comment the commit with "workaround"? Is there a more sophisticated solution to be implemented, otherwise you can close this ticket.

Actions #5

Updated by Andreas Müller over 4 years ago

  • Status changed from Feedback to Closed

The more sophisticated way is to adapt the underlying method to return an EnumSet, not an ordinary Set. With EnumSet an empty set copy should work. See related ticket #8483.

Actions #6

Updated by Andreas Müller over 4 years ago

  • % Done changed from 90 to 100
Actions

Also available in: Atom PDF