[Swift-commit] r7125 - branches/release-0.94/src/org/griphyn/vdl/engine
hategan at ci.uchicago.edu
hategan at ci.uchicago.edu
Thu Oct 3 12:35:00 CDT 2013
Author: hategan
Date: 2013-10-03 12:35:00 -0500 (Thu, 03 Oct 2013)
New Revision: 7125
Modified:
branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java
Log:
fix cast exception when array index is a string expression; this was coming from the check for array["*"] which wrongly assumed that if the index is of type string it must be a literal string
Modified: branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java 2013-10-02 22:15:32 UTC (rev 7124)
+++ branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java 2013-10-03 17:35:00 UTC (rev 7125)
@@ -1437,10 +1437,14 @@
// and really, at this point type checking should be delegated to the type system
// instead of the ad-hoc string comparisons
if (datatype(arrayST).equals("string")) {
- XmlString var = (XmlString) op.getAbstractExpressionArray(1);
- if (var.getStringValue().equals("*")) {
- return parentST;
- }
+ XmlObject var = op.getAbstractExpressionArray(1);
+ // make sure this is array["somestring"] rather than array[otherExpressionOfTypeString]
+ if (var instanceof XmlString) {
+ XmlString vars = (XmlString) var;
+ if (vars.getStringValue().equals("*")) {
+ return parentST;
+ }
+ }
}
if (!indexType.equals(declaredIndexType)
More information about the Swift-commit
mailing list