From bc2f3a14c2478027b48a72deec90bb3b6dd1948a Mon Sep 17 00:00:00 2001 From: Luc Boudreau Date: Mon, 3 Nov 2008 20:30:17 +0000 Subject: [PATCH] Code formatting issues git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@133 c6a108a4-781c-0410-a6c6-c2d559e19af0 --- .../olap4j/driver/xmla/XmlaOlap4jUtil.java | 118 +++++++++--------- testsrc/org/olap4j/XmlaConnectionTest.java | 8 +- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/org/olap4j/driver/xmla/XmlaOlap4jUtil.java b/src/org/olap4j/driver/xmla/XmlaOlap4jUtil.java index 136c7d9..501d2d2 100644 --- a/src/org/olap4j/driver/xmla/XmlaOlap4jUtil.java +++ b/src/org/olap4j/driver/xmla/XmlaOlap4jUtil.java @@ -162,11 +162,11 @@ static String prettyPrint(Element element) { } private static void prettyPrintLoop( - NodeList nodes, + NodeList nodes, StringBuilder string, String indentation) { - for (int index = 0; index < nodes.getLength(); index++){ + for (int index = 0; index < nodes.getLength(); index++) { prettyPrintLoop(nodes.item(index), string, indentation); } } @@ -189,63 +189,63 @@ private static void prettyPrintLoop( prettyPrintLoop(node.getChildNodes(), string, indentation + "\t"); break; - case Node.ELEMENT_NODE: - string.append(indentation); - string.append("<"); - string.append(node.getNodeName()); - - int length = (node.getAttributes() != null) ? - node.getAttributes().getLength() : 0; - Attr attributes[] = new Attr[length]; - for (int loopIndex = 0; loopIndex < length; loopIndex++) { - attributes[loopIndex] = - (Attr)node.getAttributes().item(loopIndex); - } - - for (int loopIndex = 0; loopIndex < attributes.length; - loopIndex++) - { - Attr attribute = attributes[loopIndex]; - string.append(" "); - string.append(attribute.getNodeName()); - string.append("=\""); - string.append(attribute.getNodeValue()); - string.append("\""); - } - - string.append(">\n"); - - prettyPrintLoop(node.getChildNodes(), string, indentation + "\t"); - - string.append(indentation); - string.append("\n"); - - break; - - case Node.TEXT_NODE: - string.append(indentation); - string.append(node.getNodeValue().trim() + "\n"); - break; - - case Node.PROCESSING_INSTRUCTION_NODE: - string.append(indentation); - string.append(" 0) { - string.append(text); - } - string.append("?>\n"); - break; - - case Node.CDATA_SECTION_NODE: - string.append(indentation); - string.append(""); - break; + case Node.ELEMENT_NODE: + string.append(indentation); + string.append("<"); + string.append(node.getNodeName()); + + int length = (node.getAttributes() != null) ? + node.getAttributes().getLength() : 0; + Attr attributes[] = new Attr[length]; + for (int loopIndex = 0; loopIndex < length; loopIndex++) { + attributes[loopIndex] = + (Attr)node.getAttributes().item(loopIndex); + } + + for (int loopIndex = 0; loopIndex < attributes.length; + loopIndex++) + { + Attr attribute = attributes[loopIndex]; + string.append(" "); + string.append(attribute.getNodeName()); + string.append("=\""); + string.append(attribute.getNodeValue()); + string.append("\""); + } + + string.append(">\n"); + + prettyPrintLoop(node.getChildNodes(), string, indentation + "\t"); + + string.append(indentation); + string.append("\n"); + + break; + + case Node.TEXT_NODE: + string.append(indentation); + string.append(node.getNodeValue().trim() + "\n"); + break; + + case Node.PROCESSING_INSTRUCTION_NODE: + string.append(indentation); + string.append(" 0) { + string.append(text); + } + string.append("?>\n"); + break; + + case Node.CDATA_SECTION_NODE: + string.append(indentation); + string.append(""); + break; } } diff --git a/testsrc/org/olap4j/XmlaConnectionTest.java b/testsrc/org/olap4j/XmlaConnectionTest.java index cdd17b8..60c4347 100644 --- a/testsrc/org/olap4j/XmlaConnectionTest.java +++ b/testsrc/org/olap4j/XmlaConnectionTest.java @@ -38,7 +38,7 @@ public static class DoubleSubmissionTestProxy extends MondrianInprocProxy { Map requests = new HashMap(); public DoubleSubmissionTestProxy( Map catalogNameUrls, - String urlString) + String urlString) { super(catalogNameUrls,urlString); } @@ -48,7 +48,7 @@ public byte[] get(URL url, String request) throws IOException { } private void checkup(String request) { String hash = Encoder.convertToHex(request.getBytes()); - if ( request.indexOf("MDSCHEMA_CUBES") == -1 && + if (request.indexOf("MDSCHEMA_CUBES") == -1 && this.requests.containsKey(hash)) { throw new RuntimeException("DOUBLE-REQUEST"); } else { @@ -97,7 +97,7 @@ public void testNoDoubleQuerySubmission() throws Exception { String oldValue = XmlaTester.getProxyClassName(); XmlaTester.setProxyClassName( DoubleSubmissionTestProxy.class.getName()); - if ( TestContext.getTestProperties() + if (TestContext.getTestProperties() .get(TestContext.Property.HELPER_CLASS_NAME.path) .equals("org.olap4j.XmlaTester")) { @@ -124,7 +124,7 @@ public void testNoDoubleQuerySubmission() throws Exception { " Crossjoin({[Gender].[M]}, [Product].Children) ON ROWS\n" + "FROM [Sales]\n" + "WHERE [Time].[1997].[Q3]"); - } catch(RuntimeException e) { + } catch (RuntimeException e) { fail(e.getMessage()); } }