#526 Fixed unnecessary 'overenginnering' in previous commit 🤦

This commit is contained in:
Ashish Chopra
2020-03-30 10:38:52 +05:30
parent 872523b0f0
commit 5315caf830
@@ -41,8 +41,8 @@ import java.awt.*;
public class SVGReadParam extends ImageReadParam { public class SVGReadParam extends ImageReadParam {
private Paint background; private Paint background;
private String baseURI; private String baseURI;
private boolean allowExternalResources = false; private boolean allowExternalResources =
private boolean isAllowExternalResourcesSetExplicitly = false; "true".equals(System.getProperty(SVGImageReader.ALLOW_EXTERNAL_RESOURCES_SYSTEM_PROP));
public SVGReadParam() { public SVGReadParam() {
super(); super();
@@ -66,16 +66,10 @@ public class SVGReadParam extends ImageReadParam {
public void setAllowExternalResources(boolean allow) { public void setAllowExternalResources(boolean allow) {
allowExternalResources = allow; allowExternalResources = allow;
isAllowExternalResourcesSetExplicitly = true;
} }
public boolean isAllowExternalResources() { public boolean isAllowExternalResources() {
if (isAllowExternalResourcesSetExplicitly) { return allowExternalResources;
return allowExternalResources;
} else {
// prefer the explicitly set value if invoked, read the system prop as a fallback if it wasn't
return "true".equals(System.getProperty(SVGImageReader.ALLOW_EXTERNAL_RESOURCES_SYSTEM_PROP));
}
} }
@Override @Override