Archived

This forum has been archived. Please start a new discussion on GitHub.

Generated Java Helper class has errors

I downloaded Ice-2.1.0-VC71.msi yesterday.
I'm trying to compile slice2java-generated code and getting compilation errors. The ice portion with the issue looks like this:

struct FieldDescriptor
{
string fieldId;
string selfDescribingObject;
};

// Query definition
struct FromClause
{
string db;
string table;
string schema;
};

enum RelationEnum { EQ, NE, LT, GT, LE, GE };

class Filter
{
string fieldId;
RelationEnum relation;
string selfDescribingObject;
};

sequence<string> SelectClause;
sequence<Filter> WhereClause;

class QueryObj
{
SelectClause select;
FromClause from;
WhereClause where;
};

The file with the issue is WhereClauseHelper.java:
// **********************************************************************
//
// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

// Ice version 2.0.0

package BloombergLP.fasbdma;

public final class WhereClauseHelper
{
public static void
write(IceInternal.BasicStream __os, Filter[] __v)
{
if(__v == null)
{
__os.writeSize(0);
}
else
{
__os.writeSize(__v.length);
for(int __i = 0; __i < __v.length; __i++)
{
__os.writeObject(__v[__i);
}
}
}

public static Filter[]
read(IceInternal.BasicStream __is)
{
Filter[] __v;
final int __len = __is.readSize();
__is.startSeq(__len, );
final String __type = Filter.ice_staticId();
__v = new Filter[__len];
for(int __i = 0; __i < __len; __i++)
{
__is.readObject(new IceInternal.SequencePatcher(__v, Filter.class, __type);
__is.checkSeq();
__is.endElement();
}
__is.endSeq(__len);
return __v;
}
}

Three errors:
1) in write(..): __os.writeObject(__v[__i); // missing end-bracket
2) in read(..): __is.startSeq(__len, ); // missing arg
3) in read(..): __is.readObject(new IceInternal.SequencePatcher(__v, Filter.class, __type); // missing end parentheses..

Please advise.

Comments

  • mes
    mes California
    Hi,
    // Ice version 2.0.0
    It appears that you have an older version of slice2java in your PATH. I translated your Slice definitions using slice2java from Ice 2.1.0 and the generated code compiles fine.

    Take care,
    - Mark
  • d'oh!
    Thanks...