Archived

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

Ice 3.6.0 slice2java Slicing Issues

The issue is in decoding class member variables. When a member variable resides in a class that inherits from another class then slice2java erroneously generates source files. This results in an issue where an Ice application is able to publish this object but the receiver cant decode it. This is explained in more details below. Also attached a sample Ice file which can be used to replicate this problem.

Slicing Test.ice will generate multiple source files. The erroneous source file is à decode_test/TestClass.java
  • An internal class named “Patcher” is used to resolve the two member variables.
  • __readImpl method uses indices 1 and 2 for reading first and second variable respectively.
  • Patcher is expecting indices 0 and 1 to resolve first and second variable respectively.
  • This will raise an error when the patcher tries to resolve the first variable.
//Test.ice

#ifndef CAP_TEST_ICE
#define CAP_TEST_ICE

module decode_test{
class MemberClassOne{
long longValueOne;
};
class MemberClassTwo{
long longValue2;
};
class MemberClassThree{
long longValue3;
};

class SuperClassOne{
MemberClassOne memberOne;

};

class TestClass extends SuperClassOne{

MemberClassTwo memberTwo;
MemberClassThree memberThree;
};

};


#endif

Comments

  • xdm
    xdm La Coruña, Spain
    Hi Tom,

    Thanks for reporting the issue, I have tested you sample and this is indeed a bug in the slice2java Slice compiler, it also affects the slice2cs compiler. I have push a fix for this issue to the 3.6 branch on ice repository.
  • Thanks! Are you updating the RPMs too?
  • xdm
    xdm La Coruña, Spain
    Hi Tom,

    The fix will be included in the next Ice release, but we don't update our RPMs until there is a new release.
  • Hi Jose
    Do you have a date set for a 3.6.2 release?
    The reason I am asking is that
    We have now updated our project to support both ice 3.5 and ice 3.6.
    We ran numerous tests on various platforms for that we built from source using your 3.6 branch.
    Before preparing our own rpms, I wanted to double-check your timeline.

    Regards
    jmarie
  • xdm
    xdm La Coruña, Spain
    Hi Jean,

    We don't have a release date for 3.6.2 at this point