From a3fd54fe779a9dacf3b4abc11f8f3545f7489014 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Tue, 15 Apr 2025 14:57:50 +0800 Subject: [PATCH] update by following copilot --- .../tests/data/data-resteasy/JAXBElementProvider.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rules/rules-reviewed/eap7/eap6/tests/data/data-resteasy/JAXBElementProvider.java b/rules/rules-reviewed/eap7/eap6/tests/data/data-resteasy/JAXBElementProvider.java index 8cd71eee..df42e985 100644 --- a/rules/rules-reviewed/eap7/eap6/tests/data/data-resteasy/JAXBElementProvider.java +++ b/rules/rules-reviewed/eap7/eap6/tests/data/data-resteasy/JAXBElementProvider.java @@ -88,12 +88,8 @@ public JAXBElement readFrom(Class> type, unmarshaller = decorateUnmarshaller(type, annotations, mediaType, unmarshaller); // Disable external entity resolution to prevent XXE attacks - try { - unmarshaller.setProperty(javax.xml.XMLConstants.ACCESS_EXTERNAL_DTD, ""); - unmarshaller.setProperty(javax.xml.XMLConstants.ACCESS_EXTERNAL_SCHEMA, ""); - } catch (IllegalArgumentException ex) { - throw new JAXBUnmarshalException("Failed to disable external entity resolution", ex); - } + unmarshaller.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); + unmarshaller.setProperty(XMLInputFactory.SUPPORT_DTD, false); if (needsSecurity()) {