From b41879ba186b371ed4892583543b3a4c76f5540a Mon Sep 17 00:00:00 2001 From: Julian Hyde Date: Sat, 9 May 2009 00:16:54 +0000 Subject: [PATCH] Oops! git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@232 c6a108a4-781c-0410-a6c6-c2d559e19af0 --- src/org/olap4j/mdx/IdentifierNode.java | 5 ++++- testsrc/org/olap4j/test/ParserTest.java | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/org/olap4j/mdx/IdentifierNode.java b/src/org/olap4j/mdx/IdentifierNode.java index 0ba0ac1..a3d173a 100644 --- a/src/org/olap4j/mdx/IdentifierNode.java +++ b/src/org/olap4j/mdx/IdentifierNode.java @@ -99,7 +99,7 @@ public IdentifierNode(List segments) { this.segments = new UnmodifiableArrayList( segments.toArray( - new NameSegment[segments.size()])); + new Segment[segments.size()])); } public Type getType() { @@ -422,6 +422,9 @@ public NameSegment( this.region = region; this.name = name; this.quoting = quoting; + if (!(quoting == Quoting.QUOTED || quoting == Quoting.UNQUOTED)) { + throw new IllegalArgumentException(); + } } /** diff --git a/testsrc/org/olap4j/test/ParserTest.java b/testsrc/org/olap4j/test/ParserTest.java index 348e75e..f0e94e3 100644 --- a/testsrc/org/olap4j/test/ParserTest.java +++ b/testsrc/org/olap4j/test/ParserTest.java @@ -16,7 +16,6 @@ import org.olap4j.mdx.*; import org.olap4j.OlapConnection; import org.olap4j.Axis; -import org.olap4j.impl.Olap4jUtil; import java.sql.SQLException; import java.sql.Connection; @@ -747,8 +746,9 @@ public void testIdentifier() { // append does not mutate IdentifierNode id2 = id.append( - new IdentifierNode.NameSegment( - null, "bar", IdentifierNode.Quoting.KEY)); + new IdentifierNode.KeySegment( + new IdentifierNode.NameSegment( + null, "bar", IdentifierNode.Quoting.QUOTED))); assertTrue(id != id2); assertEquals("[foo]", id.toString()); assertEquals("[foo].&[bar]", id2.toString());