Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for UnsupportedOperationException trying to add additional fields #330

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vjrj
Copy link
Contributor

@vjrj vjrj commented Mar 26, 2019

I'm trying to indexing additional fields like habitat adding to additional.fields.to.index but I get a java.lang.UnsupportedOperationException because Scala is using a inmutable map for the fields in SolrIndexDAO.scala so does not have a put method.

The complete trace:

gbif18-cass3 2019-03-24 17:54:27,782 ERROR: [IndexRunner] - guid:f4953c71-1d1c-4120-81b5-a61a5370cb11, null
java.lang.UnsupportedOperationException
	at java.util.AbstractMap.put(AbstractMap.java:209)
	at au.org.ala.biocache.index.SolrIndexDAO$$anonfun$indexFromArray$3.apply(SolrIndexDAO.scala:1074)
	at au.org.ala.biocache.index.SolrIndexDAO$$anonfun$indexFromArray$3.apply(SolrIndexDAO.scala:1073)
	at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
	at au.org.ala.biocache.index.SolrIndexDAO.indexFromArray(SolrIndexDAO.scala:1073)
	at au.org.ala.biocache.index.IndexRunner$ProcessThread$1.run(IndexRunner.scala:164)
gbif18-cass3 2019-03-24 17:54:27,782 ERROR: [IndexRunner] - guid:019057b1-68e7-41f1

The tests fail if we add only new fields in the test config, but using a mutable map for the fields all tests past correctly.

I'm quite newbie here, so double check this PR ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant