Community
Participate
Working Groups
I get this error during the sphinx based model update via transaction. Probably proxy management is not a thread safe java.lang.NegativeArraySizeException at java.util.AbstractCollection.toArray(AbstractCollection.java:136) at java.util.ArrayList.<init>(ArrayList.java:177) at org.eclipse.sphinx.emf.internal.ecore.proxymanagement.blacklist.MapModelIndex.updateIndexOnResourceLoaded(MapModelIndex.java:123) at org.eclipse.sphinx.emf.internal.ecore.proxymanagement.blacklist.ModelIndex.updateIndexOnResourceLoaded(ModelIndex.java:88) at org.eclipse.sphinx.emf.internal.ecore.proxymanagement.blacklist.ModelIndexUpdater.resourceSetChanged(ModelIndexUpdater.java:106) at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl$1.run(TransactionalEditingDomainImpl.java:781) at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328) at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.postcommit(TransactionalEditingDomainImpl.java:771) at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(TransactionalEditingDomainImpl.java:543) at org.eclipse.emf.transaction.impl.TransactionImpl.close(TransactionImpl.java:712) at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474) at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:155) at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:488) at org.eclipse.sphinx.emf.util.WorkspaceTransactionUtil.executeInWriteTransaction(WorkspaceTransactionUtil.java:191) at org.eclipse.sphinx.emf.util.WorkspaceTransactionUtil.executeInWriteTransaction(WorkspaceTransactionUtil.java:296)
We've experienced this as well. It's because the Set 'proxyURIs' is only initialized and thus has size = -1. When the ArrayList is created at updateIndexOnResourceLoaded:106 the Set size (-1) is used to set ArrayList size and exception is thrown. Something like changing the if above to 'resource != null && !resource.getContents().isEmpty() && !proxyURIs.isEmpty()' should fix the problem.
(In reply to Sebastian Engvall from comment #1) > We've experienced this as well. > > It's because the Set 'proxyURIs' is only initialized and thus has size = -1. > When the ArrayList is created at updateIndexOnResourceLoaded:106 the Set > size (-1) is used to set ArrayList size and exception is thrown. > > Something like changing the if above to 'resource != null && > !resource.getContents().isEmpty() && !proxyURIs.isEmpty()' should fix the > problem. Correction, new ArrayList is on Line 123 of course.
Closed stale issue before migration