Source:
<code>private AbstractExpression parseValueExpression(VoltXMLElement exprNode) { String isParam = exprNode.attributes.get("isparam"); String isPlannerGeneratedAttr = exprNode.attributes.get("isplannergenerated"); boolean isPlannerGenerated = isPlannerGeneratedAttr == null ? false : <START> (isPlannerGeneratedAttr.equalsIgnoreCase("true") ? true : false); <END> boolean needParameter = (isParam != null) && (isParam.equalsIgnoreCase("true")); ConstantValueExpression cve = null; boolean needConstant = (needParameter == false) || isPlannerGenerated; if (needConstant) { String type = exprNode.attributes.get("valuetype"); VoltType vt = VoltType.typeFromString(type); assert(vt != VoltType.VOLTTABLE); cve = new ConstantValueExpression(); cve.setValueType(vt); if ((vt != VoltType.NULL) && (vt != VoltType.NUMERIC)) { int size = vt.getMaxLengthInBytes(); cve.setValueSize(size); } if ( ! needParameter && vt != VoltType.NULL) { String valueStr = exprNode.attributes.get("value"); if (valueStr != null) { try { switch (vt) { case BIGINT: case TIMESTAMP: Long.valueOf(valueStr); break; case FLOAT: Double.valueOf(valueStr); break; case DECIMAL: VoltDecimalHelper.stringToDecimal(valueStr); break; default: break; } } catch (PlanningErrorException ex) { throw ex; } catch (NumberFormatException ex) { throw new PlanningErrorException("Numeric conversion error to type " + vt.name() + " " + ex.getMessage().toLowerCase()); } catch (Exception ex) { throw new PlanningErrorException(ex.getMessage()); } } cve.setValue(valueStr); } } if (needParameter) { long id = Long.parseLong(exprNode.attributes.get("id")); ParameterValueExpression expr = m_paramsById.get(id); assert(expr != null); if (needConstant) { expr.setOriginalValue(cve); cve.setValue(m_paramValues[expr.getParameterIndex()]); } return expr; } return cve; }</code><technical_language>I this is OK I generally in favor of this kind of nested logical expressions</technical_language>

Target:
private AbstractExpression parseValueExpression(VoltXMLElement exprNode) { String isParam = exprNode.attributes.get("isparam"); String isPlannerGeneratedAttr = exprNode.attributes.get("isplannergenerated"); boolean isPlannerGenerated; if (isPlannerGeneratedAttr != null) { isPlannerGenerated = isPlannerGeneratedAttr.equalsIgnoreCase("true"); } else { isPlannerGenerated = false; } boolean needParameter = (isParam != null) && (isParam.equalsIgnoreCase("true")); ConstantValueExpression cve = null; boolean needConstant = (needParameter == false) || isPlannerGenerated; if (needConstant) { String type = exprNode.attributes.get("valuetype"); VoltType vt = VoltType.typeFromString(type); assert(vt != VoltType.VOLTTABLE); cve = new ConstantValueExpression(); cve.setValueType(vt); if ((vt != VoltType.NULL) && (vt != VoltType.NUMERIC)) { int size = vt.getMaxLengthInBytes(); cve.setValueSize(size); } if ( ! needParameter && vt != VoltType.NULL) { String valueStr = exprNode.attributes.get("value"); if (valueStr != null) { try { switch (vt) { case BIGINT: case TIMESTAMP: Long.valueOf(valueStr); break; case FLOAT: Double.valueOf(valueStr); break; case DECIMAL: VoltDecimalHelper.stringToDecimal(valueStr); break; default: break; } } catch (PlanningErrorException ex) { throw ex; } catch (NumberFormatException ex) { throw new PlanningErrorException("Numeric conversion error to type " + vt.name() + " " + ex.getMessage().toLowerCase()); } catch (Exception ex) { throw new PlanningErrorException(ex.getMessage()); } } cve.setValue(valueStr); } } if (needParameter) { long id = Long.parseLong(exprNode.attributes.get("id")); ParameterValueExpression expr = m_paramsById.get(id); assert(expr != null); if (needConstant) { expr.setOriginalValue(cve); cve.setValue(m_paramValues[expr.getParameterIndex()]); } return expr; } return cve; }