#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

View File

@ -41,8 +41,8 @@ import java.awt.*;
public class SVGReadParam extends ImageReadParam {
private Paint background;
private String baseURI;
private boolean allowExternalResources = false;
private boolean isAllowExternalResourcesSetExplicitly = false;
private boolean allowExternalResources =
"true".equals(System.getProperty(SVGImageReader.ALLOW_EXTERNAL_RESOURCES_SYSTEM_PROP));
public SVGReadParam() {
super();
@ -66,16 +66,10 @@ public class SVGReadParam extends ImageReadParam {
public void setAllowExternalResources(boolean allow) {
allowExternalResources = allow;
isAllowExternalResourcesSetExplicitly = true;
}
public boolean isAllowExternalResources() {
if (isAllowExternalResourcesSetExplicitly) {
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));
}
return allowExternalResources;
}
@Override