Project

General

Profile

Bug #3009

NodelistUtil select methods buggy

Added by Rob Nahf almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
d1_common_java
Start date:
Due date:
% Done:

100%

Milestone:
CCI-1.0.2
Product Version:
*
Story Points:
Sprint:

Description

Node objects can't be added to a Set because, it doesn't implement Comparable interface.

These methods are probably only in use in d1_integration so far, so not an urgent fix.

***************** running test for testUpdateNodeCapabilities(...) vs. node: https://cn-dev-2.dataone.org/cn ***************** [org.dataone.integration.it.ContextAwareTestCaseDataone]
java.lang.ClassCastException: org.dataone.service.types.v1.Node cannot be cast to java.lang.Comparable
at java.util.TreeMap.put(TreeMap.java:542)
at java.util.TreeSet.add(TreeSet.java:238)
at org.dataone.service.types.v1.util.NodelistUtil.selectNodes(NodelistUtil.java:174)

History

#1 Updated by Rob Nahf almost 12 years ago

  • Category set to d1_common_java
  • Assignee set to Rob Nahf
  • Milestone changed from CCI-1.0.0 to CCI-1.1

#2 Updated by Rob Nahf almost 12 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
  • Milestone changed from CCI-1.1 to CCI-1.0.2

fixed in d1_common_java version 1.0.2, created in the 1.0 branch.
(libclient_java v1.0.3 uses this version)
TreeSets implement sorting, and need the objects of the set to be Comparable. Changed to HashSet, which doesn't have that restriction. Added unit tests, as well.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)