From 45d1f2c9e2ab31992e1efd965bcb5fd180234247 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Tue, 12 Dec 2023 14:05:16 -0800 Subject: [PATCH] Ignore test for location in checkstyle --- .../src/main/java/ca/uhn/fhir/checks/HapiErrorCodeCheck.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-checkstyle/src/main/java/ca/uhn/fhir/checks/HapiErrorCodeCheck.java b/hapi-fhir-checkstyle/src/main/java/ca/uhn/fhir/checks/HapiErrorCodeCheck.java index 90ab3b487a8..13dfbc71c15 100644 --- a/hapi-fhir-checkstyle/src/main/java/ca/uhn/fhir/checks/HapiErrorCodeCheck.java +++ b/hapi-fhir-checkstyle/src/main/java/ca/uhn/fhir/checks/HapiErrorCodeCheck.java @@ -73,7 +73,10 @@ public final class HapiErrorCodeCheck extends AbstractCheck { } else { String location = getFilePath() + ":" + instantiation.getLineNo() + ":" + instantiation.getColumnNo() + "(" + code + ")"; - ourCache.put(code, location); + //Ignore errors thrown in test for duplicates, as some fake implementations are throwing the same codes for test purpsoes. + if (!location.contains("/test/")) { + ourCache.put(code, location); + } } } else { log(theAst.getLineNo(), "Called Msg.code() with a non-integer argument");