Skip to content

Commit

Permalink
Code formatting issues
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@133 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
lucboudreau committed Nov 3, 2008
1 parent 485ff4b commit bc2f3a1
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 63 deletions.
118 changes: 59 additions & 59 deletions src/org/olap4j/driver/xmla/XmlaOlap4jUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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("</");
string.append(node.getNodeName());
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("<?");
string.append(node.getNodeName());
String text = node.getNodeValue();
if (text != null && text.length() > 0) {
string.append(text);
}
string.append("?>\n");
break;

case Node.CDATA_SECTION_NODE:
string.append(indentation);
string.append("<![CDATA[");
string.append(node.getNodeValue());
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("</");
string.append(node.getNodeName());
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("<?");
string.append(node.getNodeName());
String text = node.getNodeValue();
if (text != null && text.length() > 0) {
string.append(text);
}
string.append("?>\n");
break;

case Node.CDATA_SECTION_NODE:
string.append(indentation);
string.append("<![CDATA[");
string.append(node.getNodeValue());
string.append("]]>");
break;
}
}

Expand Down
8 changes: 4 additions & 4 deletions testsrc/org/olap4j/XmlaConnectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static class DoubleSubmissionTestProxy extends MondrianInprocProxy {
Map<String,String> requests = new HashMap<String,String>();
public DoubleSubmissionTestProxy(
Map<String, String> catalogNameUrls,
String urlString)
String urlString)
{
super(catalogNameUrls,urlString);
}
Expand All @@ -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("<RequestType>MDSCHEMA_CUBES</RequestType>") == -1 &&
if (request.indexOf("<RequestType>MDSCHEMA_CUBES</RequestType>") == -1 &&
this.requests.containsKey(hash)) {
throw new RuntimeException("DOUBLE-REQUEST");
} else {
Expand Down Expand Up @@ -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"))
{
Expand All @@ -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());
}
}
Expand Down

0 comments on commit bc2f3a1

Please sign in to comment.