From f278d9d096a662a519362b8ea42096f6a8b4f579 Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Wed, 19 Mar 2014 11:40:06 -0400 Subject: [PATCH] Fix unit tests --- .../main/java/ca/uhn/fhir/context/FhirContext.java | 2 +- .../ca/uhn/fhir/rest/param/CollectionBinder.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java index d7ce61678e8..d60f53da505 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java @@ -119,7 +119,7 @@ public class FhirContext { idToElementDefinition.putAll(myIdToResourceDefinition); idToElementDefinition.putAll(scanner.getIdToResourceDefinition()); - myNameToElementDefinition = idToElementDefinition; + myNameToElementDefinition = nameToElementDefinition; myClassToElementDefinition = classToElementDefinition; myIdToResourceDefinition = idToElementDefinition; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/CollectionBinder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/CollectionBinder.java index 26fec8c18f3..ba3e68f620c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/CollectionBinder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/CollectionBinder.java @@ -16,13 +16,13 @@ public class CollectionBinder * @param thePositionDescription Just used in exceptions if theCollectionType is invalid */ @SuppressWarnings("unchecked") - public static Class> getInstantiableCollectionType(Class> theCollectionType, String thePositionDescription) { - if (theCollectionType == List.class || theCollectionType == ArrayList.class) { - return (Class>) ArrayList.class; - } else if (theCollectionType == Set.class || theCollectionType == HashSet.class) { - return (Class>) HashSet.class; - } else if (theCollectionType == Collection.class) { - return (Class>) ArrayList.class; + public static Class getInstantiableCollectionType(Class> theCollectionType, String thePositionDescription) { + if (theCollectionType.equals(List.class) || theCollectionType .equals(ArrayList.class)) { + return (Class) ArrayList.class; + } else if (theCollectionType .equals( Set.class )|| theCollectionType .equals( HashSet.class)) { + return (Class) HashSet.class; + } else if (theCollectionType.equals(Collection.class)) { + return (Class) ArrayList.class; } else { throw new ConfigurationException("Unsupported binding collection type '" + theCollectionType.getCanonicalName() + "' for " + thePositionDescription); }