Potential ConcurrentModificationException in PersonImpl

Description

There is potential for the attributes Map in a PersonImpl object to be subject to concurrent modification due to its use in the toString of the class and ability for it to be modified by accessor methods.

Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
at java.util.HashMap$EntryIterator.next(HashMap.java:883)
at java.util.HashMap$EntryIterator.next(HashMap.java:881)
at java.util.AbstractMap.toString(AbstractMap.java:587)
at java.lang.String.valueOf(String.java:2615)
at java.lang.StringBuilder.append(StringBuilder.java:116)
at org.jasig.portal.security.provider.PersonImpl.toString(PersonImpl.java:273)
at java.lang.String.valueOf(String.java:2615)
at java.lang.StringBuffer.append(StringBuffer.java:220)
at org.jasig.portal.ChannelStaticData.toString(ChannelStaticData.java:390)
at org.jasig.portal.channels.CInlineFrame.getKey(CInlineFrame.java:104)
at org.jasig.portal.channels.CInlineFrame.generateKey(CInlineFrame.java:84)
at org.jasig.portal.ChannelRenderer$Worker.setCharacterCache(ChannelRenderer.java:743)
at sun.reflect.GeneratedMethodAccessor237.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.orm.jpa.JpaInterceptor.invoke(JpaInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at org.jasig.portal.$Proxy107.setCharacterCache(Unknown Source)
at org.jasig.portal.ChannelRenderer.setCharacterCache(ChannelRenderer.java:393)
at org.jasig.portal.ChannelManager.outputChannel(ChannelManager.java:433)
at org.jasig.portal.CharacterCachingChannelIncorporationFilter.endElement(CharacterCachingChannelIncorporationFilter.java:297)
at org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:263)
at org.apache.xml.dtm.ref.DTMTreeWalker.endNode(DTMTreeWalker.java:375)
at org.apache.xalan.transformer.TreeWalker2Result.endNode(TreeWalker2Result.java:87)
at org.apache.xml.dtm.ref.DTMTreeWalker.traverse(DTMTreeWalker.java:134)
at org.apache.xalan.transformer.TreeWalker2Result.traverse(TreeWalker2Result.java:74)
at org.apache.xalan.templates.ElemCopyOf.execute(ElemCopyOf.java:186)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
... 87 more

Environment

None

Activity

Show:
Eric Dalquist
September 2, 2009, 7:12 PM

Fixed in trunk and 3.0-patches by switching the internal attributes Map to a ConcurrentMap

Fixed

Assignee

Eric Dalquist

Reporter

Eric Dalquist

Labels

None

Estimated End Date

None

Fix versions

Affects versions

Priority

Major