From f2d530112ef1bcd785c53cd98692a02fd59c8162 Mon Sep 17 00:00:00 2001 From: Yogthos Date: Thu, 27 Feb 2014 12:07:12 -0500 Subject: [PATCH 1/2] cleaned up getting the return type for the resource method --- .../src/main/java/ca/uhn/fhir/ws/ResourceMethod.java | 4 ++-- hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/Service.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/ResourceMethod.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/ResourceMethod.java index 6e0d01ef95e..a505c827ad5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/ResourceMethod.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/ResourceMethod.java @@ -36,8 +36,8 @@ public class ResourceMethod { this.resourceType = resourceType; } - public IResource getResourceType() throws IllegalAccessException, InstantiationException { - return (IResource)resourceType.newInstance(); + public Class getResourceType() throws IllegalAccessException, InstantiationException { + return resourceType.getClass(); } public RequestType getRequestType() { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/Service.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/Service.java index 9f358bfb297..2fba28550c5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/Service.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/Service.java @@ -165,7 +165,7 @@ public class Service extends HttpServlet { ResourceMethod resourceMethod = resource.getMethod(params.keySet()); if (null == resourceMethod) throw new MethodNotFoundException("No resource method available for the supplied parameters " + params); - FhirContext ctx = new FhirContext(resourceMethod.getResourceType().getClass()); + FhirContext ctx = new FhirContext(resourceMethod.getResourceType()); XmlParser p = new XmlParser(ctx); response.getWriter().write(p.encodeResourceToString(resourceMethod.invoke(params))); } catch (Throwable t) { From 3fdb05d208b1ec524462733c1a9504c2f83a8b8f Mon Sep 17 00:00:00 2001 From: Yogthos Date: Thu, 27 Feb 2014 12:07:27 -0500 Subject: [PATCH 2/2] updated dependencies --- hapi-fhir-base/pom.xml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index be185fce7ec..1e5cb0d9774 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -57,6 +57,17 @@ true + + javax.servlet + javax.servlet-api + 3.1.0 + + + log4j + log4j + 1.2.17 + + junit @@ -76,6 +87,33 @@ 1.5 test + + + org.eclipse.jetty + jetty-server + 9.1.1.v20140108 + test + + + org.eclipse.jetty + jetty-servlet + 9.1.1.v20140108 + test + + + + commons-httpclient + commons-httpclient + 3.1 + test + + + + directory-naming + naming-java + 0.8 + test +