Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update CassandraType #113

Merged
merged 1 commit into from

2 participants

Adam Nick Berardi
Adam

Added checks for reversed types nested inside composite types. This prevents a Type not found exception being thrown.

Nick Berardi
Owner

I haven't forgot about this, I am going to merge in soon and thanks for the contributions.

Nick Berardi nberardi merged commit b5d5032 into from
Nick Berardi nberardi referenced this pull request from a commit
Nick Berardi nberardi a better implimentation of #113 c210cdd
Nick Berardi
Owner

I found the issue. The ReverseType wasn't overflowing properly when there was a complex type on the inside. So I implemented a recursive parse method to take care of this. Thanks for bringing this issue to my attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 8, 2013
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 1 deletion.
  1. +18 −1 src/Types/CassandraType.cs
19 src/Types/CassandraType.cs
View
@@ -131,7 +131,24 @@ private void ParseCompositeType(string part)
_compositeTypes = new List<CassandraType>();
foreach (var p in parts)
- _compositeTypes.Add(Parse(p));
+ {
+ int reversedStart = p.IndexOf('(');
+
+ // check for reversed type
+ if (reversedStart == -1)
+ {
+ _compositeTypes.Add(Parse(p));
+ }
+ else
+ {
+ var part1 = p.Substring(0, reversedStart);
+
+ if (Parse(part1) == typeof(ReversedType))
+ _compositeTypes.Add(new CassandraType(p));
+ else
+ throw new CassandraException("Type '" + part1 + "' not found.");
+ }
+ }
}
private void ParseDynamicCompositeType(string part)
Something went wrong with that request. Please try again.