From 1167ba577036f913e12e801577c1f69440865015 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 24 Feb 2012 16:33:58 -0500 Subject: [PATCH 1/1] Java IDL parser updated to use derived field array index The "array_position" IDL attribute is deprecated. Determine the index by field position within the XML. Signed-off-by: Bill Erickson Signed-off-by: Jason Stephenson --- Open-ILS/src/java/org/open_ils/idl/IDLParser.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/java/org/open_ils/idl/IDLParser.java b/Open-ILS/src/java/org/open_ils/idl/IDLParser.java index a82b25d732..4da147f521 100644 --- a/Open-ILS/src/java/org/open_ils/idl/IDLParser.java +++ b/Open-ILS/src/java/org/open_ils/idl/IDLParser.java @@ -29,6 +29,7 @@ public class IDLParser { InputStream inStream; HashMap IDLObjects; IDLObject current; + private int fieldIndex; /** If true, we retain the full set of IDL objects in memory. This is true by default. */ private boolean keepIDLObjects; @@ -39,6 +40,7 @@ public class IDLParser { IDLObjects = new HashMap(); keepIDLObjects = true; parsedObjectCount = 0; + fieldIndex = 0; } public IDLParser(String fileName) throws IOException { @@ -122,6 +124,7 @@ public class IDLParser { String localpart = reader.getLocalName(); if( "class".equals(localpart) ) { + fieldIndex = 0; current = new IDLObject(); current.setIDLClass(reader.getAttributeValue(null, "id")); current.setController(reader.getAttributeValue(null, "controller")); @@ -133,7 +136,7 @@ public class IDLParser { if( "field".equals(localpart) ) { IDLField field = new IDLField(); field.setName(reader.getAttributeValue(null, "name")); - field.setArrayPos(new Integer(reader.getAttributeValue(OILS_NS_OBJ, "array_position"))); + field.setArrayPos(fieldIndex++); field.setIsVirtual("true".equals(reader.getAttributeValue(OILS_NS_PERSIST, "virtual"))); current.addField(field); } -- 2.43.2