From 807f585490fcc0cc197848bc18ba66f27de0cffc Mon Sep 17 00:00:00 2001 From: chicoreus Date: Fri, 2 Aug 2024 08:11:53 -0400 Subject: [PATCH] Bugfixes to handling of problems with source authority in tdwg/bdq#284 and tdwg/bdq#286, need to throw exception on invalid. --- .../java/org/filteredpush/qc/metadata/DwCMetadataDQ.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/filteredpush/qc/metadata/DwCMetadataDQ.java b/src/main/java/org/filteredpush/qc/metadata/DwCMetadataDQ.java index 67545ab..8e2e85c 100644 --- a/src/main/java/org/filteredpush/qc/metadata/DwCMetadataDQ.java +++ b/src/main/java/org/filteredpush/qc/metadata/DwCMetadataDQ.java @@ -1988,11 +1988,11 @@ public static DQResponse amendmentSexStandardized( try { MetadataSourceAuthority sourceAuthorityObject = new MetadataSourceAuthority(sourceAuthority); if (sourceAuthorityObject.getAuthority().equals(EnumMetadataSourceAuthority.INVALID)) { - result.setResultState(ResultState.EXTERNAL_PREREQUISITES_NOT_MET); + throw new SourceAuthorityException("Invalid source authority"); } if (!MetadataSingleton.getInstance().isLoaded()) { result.addComment("Error accessing sourceAuthority: " + MetadataSingleton.getInstance().getLoadError() ); - result.setResultState(ResultState.EXTERNAL_PREREQUISITES_NOT_MET); + throw new SourceAuthorityException("Error loading data from sourceAuthority"); } else { if (MetadataSingleton.getInstance().getSexTerms().containsKey(sex)) { result.addComment("Provided value of dwc:sex found in the sourceAuthority"); @@ -2161,11 +2161,11 @@ public static DQResponse amendmentTypestatusStandardized( try { MetadataSourceAuthority sourceAuthorityObject = new MetadataSourceAuthority(sourceAuthority); if (sourceAuthorityObject.getAuthority().equals(EnumMetadataSourceAuthority.INVALID)) { - result.setResultState(ResultState.EXTERNAL_PREREQUISITES_NOT_MET); + throw new SourceAuthorityException("Invalid source authority"); } if (!MetadataSingleton.getInstance().isLoaded()) { result.addComment("Error accessing sourceAuthority: " + MetadataSingleton.getInstance().getLoadError() ); - result.setResultState(ResultState.EXTERNAL_PREREQUISITES_NOT_MET); + throw new SourceAuthorityException("Error loading data from sourceAuthority"); } else { if (MetadataSingleton.getInstance().getTypeStatusTerms().containsKey(typeStatus)) { result.addComment("Provided value of dwc:typeStatus found in the sourceAuthority");