Project

General

Profile

« Previous | Next » 

Revision 7025

do not allow blank node references to be used.
https://redmine.dataone.org/issues/2362

View differences:

src/edu/ucsb/nceas/metacat/dataone/SystemMetadataFactory.java
725 725
    }
726 726

  
727 727
    /**
728
     * Extract a List of NodeReferences froma String listing the node identifiers where
728
     * Extract a List of NodeReferences from a String listing the node identifiers where
729 729
     * each identifier is separated by whitespace, comma, or semicolon characters.
730 730
     * @param nodeString the string containing the list of nodes
731
     * @return the List of NodeReference objects parsed fromt he input string
731
     * @return the List of NodeReference objects parsed from the input string
732 732
     */
733 733
    private static List<NodeReference> extractNodeReferences(String nodeString) {
734 734
        List<NodeReference> nodeList = new ArrayList<NodeReference>();
735 735
        String[] result = nodeString.split("[,;\\s]");
736 736
        for (String r : result) {
737
            NodeReference noderef = new NodeReference();
738
            noderef.setValue(r);
739
            nodeList.add(noderef);
737
        	if (r != null && r.length() > 0) {
738
	            NodeReference noderef = new NodeReference();
739
	            noderef.setValue(r);
740
	            nodeList.add(noderef);
741
	        }
740 742
        }
741 743
        return nodeList;
742 744
    }

Also available in: Unified diff