From 6db57c43d7f325e453a20c341ac90a55ecfc16fc Mon Sep 17 00:00:00 2001 From: mogoodrich Date: Tue, 3 Sep 2024 18:07:28 -0400 Subject: [PATCH] revert: TRUNK-6188: Add whitelisting for components loaded via Xstream --- .../serializer/ReportingSerializer.java | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java b/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java index da4e3e7bb..6b3f761de 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java @@ -85,8 +85,6 @@ public Object unmarshal(HierarchicalStreamReader reader, Object root) { xstream.registerConverter(new IndicatorConverter(mapper, converterLookup)); xstream.registerConverter(new ReportDefinitionConverter(mapper, converterLookup)); - - setupXStreamSecurity(xstream); } @Override @@ -117,22 +115,4 @@ public void serializeToStream(Object object, OutputStream out) { throw new IllegalStateException("Unsupported encoding", e); } } - - private void setupXStreamSecurity(XStream xstream) throws SerializationException { - try { - SimpleXStreamSerializer serializer = Context.getRegisteredComponent("simpleXStreamSerializer", SimpleXStreamSerializer.class); - if (serializer != null) { - try { - Method method = serializer.getClass().getMethod("initXStream", XStream.class); - method.invoke(serializer, xstream); - } - catch (Exception ex) { - throw new SerializationException("Failed to set up XStream Security", ex); - } - } - } - catch (APIException ex) { - //Ignore APIException("Error during getting registered component) for platform versions below 2.7.0 - } - } }