Source:
private void XreadWithList(WithList withList) { boolean recursive = withList.isRecursive(); for (boolean done = false; ! done; done = ! readIfThis(Tokens.COMMA)) { HsqlName queryName = readNewSchemaObjectName(SchemaObject.TABLE); queryName.setSchemaIfNull(session.getCurrentSchemaHsqlName()); List<HsqlName> columnNames = parseColumnNames(); readThis(Tokens.AS); readThis(Tokens.OPENBRACKET); QueryExpression baseQueryExpression = null; QueryExpression recursionQueryExpression = null; if (recursive) { baseQueryExpression = XreadSimpleTable(); } else { baseQueryExpression = XreadQueryExpressionBodyAndSortAndSlice(); } baseQueryExpression.resolve(session); HsqlName[] colNames = null; if (columnNames != null) { colNames = columnNames.toArray(new HsqlName[columnNames.size()]); } else { String[] queryNames = baseQueryExpression.getColumnNames(); colNames = new HsqlName[queryNames.length]; for (int idx = 0; idx < queryNames.length; idx += 1) { String queryColumnName = queryNames[idx]; colNames[idx] = database.nameManager.newHsqlName(queryColumnName, false, SchemaObject.COLUMN); } } Type[] colTypes = baseQueryExpression.getColumnTypes(); String cmp = null; if (colNames.length > colTypes.length) { cmp = "many"; } else if (colNames.length < colTypes.length) { cmp = "few"; } if (cmp != null) { throw Error.error("Too " + cmp + " many column names for schema in query " + queryName.name); } Table newTable = session.defineLocalTable(queryName, colNames, colTypes); if (recursive) { readThis(Tokens.UNION); readThis(Tokens.ALL); recursionQueryExpression = XreadQueryExpressionBody(); } readThis(Tokens.CLOSEBRACKET); WithExpression withExpression = new WithExpression(); withExpression.setQueryName(queryName); withExpression.setBaseQuery(baseQueryExpression); withExpression.setRecursiveQuery(recursionQueryExpression); withExpression.setTable(newTable); withList.add(withExpression); } }

Target:
private void XreadWithList(WithList withList) { boolean recursive = withList.isRecursive(); for (boolean done = false; ! done; done = ! readIfThis(Tokens.COMMA)) { HsqlName queryName = readNewSchemaObjectName(SchemaObject.TABLE); queryName.setSchemaIfNull(session.getCurrentSchemaHsqlName()); List<HsqlName> columnNames = parseColumnNames(); readThis(Tokens.AS); readThis(Tokens.OPENBRACKET); QueryExpression baseQueryExpression = null; QueryExpression recursionQueryExpression = null; if (recursive) { baseQueryExpression = XreadSimpleTable(); } else { baseQueryExpression = XreadQueryExpressionBodyAndSortAndSlice(); } baseQueryExpression.resolve(session); HsqlName[] colNames = null; if (columnNames != null) { colNames = columnNames.toArray(new HsqlName[columnNames.size()]); } else { String[] queryNames = baseQueryExpression.getColumnNames(); colNames = new HsqlName[queryNames.length]; for (int idx = 0; idx < queryNames.length; idx += 1) { String queryColumnName = queryNames[idx]; colNames[idx] = database.nameManager.newHsqlName(queryColumnName, false, SchemaObject.COLUMN); } } Type[] colTypes = baseQueryExpression.getColumnTypes(); String cmp = null; if (colNames.length > colTypes.length) { cmp = "many"; } else if (colNames.length < colTypes.length) { cmp = "few"; } if (cmp != null) { throw Error.error("Too " + cmp + " column names in common table expression " + queryName.name); } Table newTable = session.defineLocalTable(queryName, colNames, colTypes); if (recursive) { readThis(Tokens.UNION); readThis(Tokens.ALL); recursionQueryExpression = XreadQueryExpressionBody(); } readThis(Tokens.CLOSEBRACKET); WithExpression withExpression = new WithExpression(); withExpression.setQueryName(queryName); withExpression.setBaseQuery(baseQueryExpression); withExpression.setRecursiveQuery(recursionQueryExpression); withExpression.setTable(newTable); withList.add(withExpression); } }