diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Integer64Type.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Integer64Type.java index 1c6be9c93..96aec817b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Integer64Type.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Integer64Type.java @@ -55,7 +55,7 @@ package org.hl7.fhir.r5.model; import ca.uhn.fhir.model.api.annotation.DatatypeDef; /** - * Primitive type "integer" in FHIR: A signed 32-bit integer + * Primitive type "integer" in FHIR: A signed 64-bit integer */ @DatatypeDef(name = "integer64") public class Integer64Type extends PrimitiveType /* implements IBaseInteger64Datatype */ { @@ -95,12 +95,8 @@ public class Integer64Type extends PrimitiveType /* implements IBaseIntege * @throws IllegalArgumentException If the value is too large to fit in a signed integer */ public Integer64Type(Long theValue) { - if (theValue < java.lang.Long.MIN_VALUE || theValue > java.lang.Long.MAX_VALUE) { - throw new IllegalArgumentException - (theValue + " cannot be cast to int without changing its value."); - } if(theValue!=null) { - setValue((long)theValue.longValue()); + setValue(theValue); } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/IntegerType.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/IntegerType.java index 102eec1f3..830f22f05 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/IntegerType.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/IntegerType.java @@ -97,12 +97,12 @@ public class IntegerType extends PrimitiveType implements IBaseIntegerD * @throws IllegalArgumentException If the value is too large to fit in a signed integer */ public IntegerType(Long theValue) { - if (theValue < java.lang.Integer.MIN_VALUE || theValue > java.lang.Integer.MAX_VALUE) { - throw new IllegalArgumentException - (theValue + " cannot be cast to int without changing its value."); - } if(theValue!=null) { - setValue((int)theValue.longValue()); + if (theValue < java.lang.Integer.MIN_VALUE || theValue > java.lang.Integer.MAX_VALUE) { + throw new IllegalArgumentException + (theValue + " cannot be cast to int without changing its value."); + } + setValue(theValue.intValue()); } }