We upgraded to 3.6.1 recently and now we are having problems when creating links to issues. I have checked all the permissions, they are all good. I can create a link to an issue, it will show up in the issue where I created it from as long as there is no other links there. As soon as I get more than one link, the links and attachments are no longer visible.
This is the error in the log:
SEVERE: METHOD: "showIssueDetails", exception:
java.lang.ClassCastException
at com.atlassian.jira.issue.comparator.IssueKeyComparator.compare(IssueKeyComparator.java:18)
at org.apache.commons.collections.comparators.ComparatorChain.compare(ComparatorChain.java:277)
The problem is that IssueKeyComparator is expecting a Issue object for certain compare's and GenericValues for others. The attached recompiled class file contains a fix. The code below replaces the code in the 'compare' routine:
String key1 = null;
String key2 = null;
if (o1 == null && o2 == null)
return 0;
else if (o2 == null) // any value is greater than null
return 1;
else if (o1 == null) // null is less than any value
return -1;
if(o1 instanceof GenericValue && o2 instanceof GenericValue)
{
key1 = ((GenericValue ) o1).getString("key");
key2 = ((GenericValue ) o2).getString("key");
}
else if(o1 instanceof Issue && o2 instanceof Issue)
{
key1 = ((Issue ) o1).getKey();
key2 = ((Issue ) o2).getKey();
}
return KeyComparator.COMPARATOR.compare(key1, key2);
Thanks for this report.
The code change you suggest looks good - however, we are unable to reproduce this problem locally at present. We would like to see which client of the IssueKeyComparator passes it an issue object to fully evaluate the fix.
Would it be possible to attach the entire exception that is generated when you encounter this issue?
Can you also detail the steps taken to reproduce the exception?
Many Thanks,
Keith