From 1808896b2828410c759395dabc863e93fa8076ce Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Tue, 15 Apr 2014 08:50:42 -0400 Subject: [PATCH] Site fixes --- hapi-fhir-base/pom.xml | 6 ++++++ .../ca/uhn/fhir/model/api/BasePrimitive.java | 19 +++++++++++++++++++ .../fhir/rest/method/SearchMethodBinding.java | 2 +- .../fhir/util/PrettyPrintWriterWrapper.java | 6 +++--- .../src/site/xdoc/doc_rest_operations.xml | 3 --- pom.xml | 2 ++ 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index daff8e7d398..50e3d7f9e83 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -223,6 +223,11 @@ maven-jxr-plugin 2.4 + + org.codehaus.mojo + findbugs-maven-plugin + 2.5.3 + org.apache.maven.plugins maven-project-info-reports-plugin @@ -411,6 +416,7 @@ + src/main/resources true diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BasePrimitive.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BasePrimitive.java index 931b4c31938..6c144743413 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BasePrimitive.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BasePrimitive.java @@ -1,5 +1,7 @@ package ca.uhn.fhir.model.api; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; public abstract class BasePrimitive extends BaseElement implements IPrimitiveDatatype { @@ -13,4 +15,21 @@ public abstract class BasePrimitive extends BaseElement implements IPrimitive return getClass().getSimpleName() + "[" + getValueAsString() + "]"; } + @Override + public int hashCode() { + return new HashCodeBuilder().append(getValue()).toHashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj.getClass() == getClass())) { + return false; + } + + BasePrimitive o = (BasePrimitive)obj; + + EqualsBuilder b = new EqualsBuilder(); + b.append(getValue(), o.getValue()); + return b.isEquals(); + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java index 8dc918f4c36..b5836ed7ec1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java @@ -65,7 +65,7 @@ public class SearchMethodBinding extends BaseResourceReturningMethodBinding { @Override public GetClientInvocation invokeClient(Object[] theArgs) throws InternalErrorException { - assert (myQueryName == null || ((theArgs != null ? theArgs.length : 0) == myParameters.size())) : "Wrong number of arguments: " + theArgs; + assert (myQueryName == null || ((theArgs != null ? theArgs.length : 0) == myParameters.size())) : "Wrong number of arguments: " + (theArgs!=null?theArgs.length:"null"); Map> queryStringArgs = new LinkedHashMap>(); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/PrettyPrintWriterWrapper.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/PrettyPrintWriterWrapper.java index e755459c8ba..7d932118601 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/PrettyPrintWriterWrapper.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/PrettyPrintWriterWrapper.java @@ -100,19 +100,19 @@ public class PrettyPrintWriterWrapper implements XMLStreamWriter { @Override public void writeEmptyElement(String theNamespaceURI, String theLocalName) throws XMLStreamException { indent(); - writeEmptyElement(theNamespaceURI, theLocalName); + myTarget.writeEmptyElement(theNamespaceURI, theLocalName); } @Override public void writeEmptyElement(String thePrefix, String theLocalName, String theNamespaceURI) throws XMLStreamException { indent(); - writeEmptyElement(thePrefix, theLocalName, theNamespaceURI); + myTarget.writeEmptyElement(thePrefix, theLocalName, theNamespaceURI); } @Override public void writeEmptyElement(String theLocalName) throws XMLStreamException { indent(); - writeEmptyElement(theLocalName); + myTarget.writeEmptyElement(theLocalName); } @Override diff --git a/hapi-fhir-base/src/site/xdoc/doc_rest_operations.xml b/hapi-fhir-base/src/site/xdoc/doc_rest_operations.xml index f86098b96b7..3f8a92dc99b 100644 --- a/hapi-fhir-base/src/site/xdoc/doc_rest_operations.xml +++ b/hapi-fhir-base/src/site/xdoc/doc_rest_operations.xml @@ -826,9 +826,6 @@ - - -

The following snippet shows how to define various history methods in a client.

diff --git a/pom.xml b/pom.xml index 04d68c3e0c2..e250dfa4f42 100644 --- a/pom.xml +++ b/pom.xml @@ -30,8 +30,10 @@ hapi-fhir-base hapi-tinder-plugin +