[
http://jira.dspace.org/jira/browse/DS-594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tim Donohue updated DS-594:
---------------------------
Fix Version/s: 1.7.0
Scheduling this issue for 1.7.0.
Robin Taylor sent me an update via email:
"DCDate - I have a tidied up version of the class. As soon as I can get time to
put together a unit test for it I'll commit it."
> DCDate parsing thread synchronization issue
> -------------------------------------------
>
> Key: DS-594
> URL: http://jira.dspace.org/jira/browse/DS-594
> Project: DSpace 1.x
> Issue Type: Bug
> Components: DSpace API
> Affects Versions: 1.6.1
> Reporter: Andrew Taylor
> Assignee: Robin Taylor
> Priority: Minor
> Fix For: 1.7.0
>
> Attachments: DCDateConcurrencyTest.java, DS-594.diff
>
>
> I have been getting a variety of exceptions coming from
> org.dspace.content.DCDate that look suspiciously like SimpleDateFormat thread
> synchronization issues (such as "java.lang.NumberFormatException: multiple
> points"). On closer inspection I noticed that the DCDate(String) constructor
> is calling the 'tryParse' method which is not 'static' synchronized and thus
> the locking is based on the DCDate instance itself and not the class. As such
> the 'synchronized' keyword on tryParse is redundent since that method is only
> called by the constructor (a time when no other code can get a lock on the
> DCDate instance).
> The fix would be to either add the 'static' keyword to tryParse, which would
> be a fairly major performance bottleneck, or to simply clone the
> SimpleDateFormat instance and use that to parse the string. Example code:
> private static Date tryParse(SimpleDateFormat sdf, String source)
> {
> try
> {
> SimpleDateFormat clone = (SimpleDateFormat) sdf.clone();
> return clone.parse(source);
> }
> catch (ParseException pe)
> {
> return null;
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.dspace.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel