From 49e7415df1c6a2b9682e5df77c5bf65d09314457 Mon Sep 17 00:00:00 2001 From: "Kajur, Harish (vk250x)" Date: Thu, 23 Aug 2018 09:32:21 -0400 Subject: Update xsd element to generate boolean to false Issue-ID: AAI-1536 Change-Id: If1cc9291e28dd0381115a0bf6c5a44faa7fdbe01 Signed-off-by: Kajur, Harish (vk250x) --- .../java/org/onap/aai/util/genxsd/PutRelationPathSet.java | 14 +++++++------- .../src/main/java/org/onap/aai/util/genxsd/XSDElement.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'aai-core/src/main/java') diff --git a/aai-core/src/main/java/org/onap/aai/util/genxsd/PutRelationPathSet.java b/aai-core/src/main/java/org/onap/aai/util/genxsd/PutRelationPathSet.java index 0b0fd946..3d055b81 100644 --- a/aai-core/src/main/java/org/onap/aai/util/genxsd/PutRelationPathSet.java +++ b/aai-core/src/main/java/org/onap/aai/util/genxsd/PutRelationPathSet.java @@ -138,13 +138,6 @@ public class PutRelationPathSet { e.printStackTrace(); return; } - finally{ - try { - fop.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } try { if(relations.size() > 0) {fop.write("[\n".getBytes());} fop.write(String.join(",\n", relations).getBytes()); @@ -155,6 +148,13 @@ public class PutRelationPathSet { e.printStackTrace(); return; } + finally{ + try { + fop.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } logger.debug(String.join(",\n", relations)); return; } diff --git a/aai-core/src/main/java/org/onap/aai/util/genxsd/XSDElement.java b/aai-core/src/main/java/org/onap/aai/util/genxsd/XSDElement.java index 91c9459d..f9ce7c11 100644 --- a/aai-core/src/main/java/org/onap/aai/util/genxsd/XSDElement.java +++ b/aai-core/src/main/java/org/onap/aai/util/genxsd/XSDElement.java @@ -297,7 +297,7 @@ public class XSDElement implements Element { sbElement.append(" type=\"xs:int\""); if ( elementType.equals("java.lang.Boolean")) sbElement.append(" type=\"xs:boolean\""); - if ( elementIsRequired == null || !elementIsRequired.equals("true")||addType != null) { + if ( ("java.lang.Boolean".equals(elementType)) || (elementIsRequired == null || !elementIsRequired.equals("true")||addType != null)) { sbElement.append(" minOccurs=\"0\""); } if ( elementContainerType != null && elementContainerType.equals("java.util.ArrayList")) { -- cgit 1.2.3-korg