Author: ssteiner Date: Tue Jan 15 10:11:26 2019 New Revision: 1851331 URL: http://svn.apache.org/viewvc?rev=1851331&view=rev Log: FOP-2733: Make boolean work as before
Removed: xmlgraphics/fop/branches/Temp_Avalon/fop/lib/avalon-framework-api-4.3.1.jar xmlgraphics/fop/branches/Temp_Avalon/fop/lib/avalon-framework-impl-4.3.1.jar xmlgraphics/fop/branches/Temp_Avalon/fop/lib/avalon-framework.LICENSE.txt xmlgraphics/fop/branches/Temp_Avalon/fop/lib/avalon-framework.NOTICE.TXT Modified: xmlgraphics/fop/branches/Temp_Avalon/fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java Modified: xmlgraphics/fop/branches/Temp_Avalon/fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Avalon/fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java?rev=1851331&r1=1851330&r2=1851331&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_Avalon/fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java (original) +++ xmlgraphics/fop/branches/Temp_Avalon/fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java Tue Jan 15 10:11:26 2019 @@ -173,7 +173,11 @@ public class DefaultConfiguration implem @Override public boolean getAttributeAsBoolean(String key, boolean defaultValue) { - return Boolean.parseBoolean(getAttribute(key)); + String result = getAttribute(key); + if (result == null || "".equals(result)) { + return defaultValue; + } + return "true".equalsIgnoreCase(result) || "yes".equalsIgnoreCase(result); } @Override @@ -224,8 +228,8 @@ public class DefaultConfiguration implem @Override public boolean getValueAsBoolean(boolean defaultValue) { - String result = getValue0(); - if (result == null || "".equals(result)) { + String result = getValue0().trim(); + if ("".equals(result)) { return defaultValue; } return Boolean.parseBoolean(result); --------------------------------------------------------------------- To unsubscribe, e-mail: fop-commits-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-commits-h...@xmlgraphics.apache.org