summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/JavaUtil.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2004-09-08 17:30:11 +0000
committerMark Spruiell <mes@zeroc.com>2004-09-08 17:30:11 +0000
commit8ed005894dab421b882221d888d5721647399f13 (patch)
tree415e10cb0df1d1ac3b846a27659659f25e12bc65 /cpp/src/Slice/JavaUtil.cpp
parentFixed a whole pile of code generation bugs: (diff)
downloadice-8ed005894dab421b882221d888d5721647399f13.tar.bz2
ice-8ed005894dab421b882221d888d5721647399f13.tar.xz
ice-8ed005894dab421b882221d888d5721647399f13.zip
bug fixes for metadata validation and ice_staticId() called on interfaces
Diffstat (limited to 'cpp/src/Slice/JavaUtil.cpp')
-rw-r--r--cpp/src/Slice/JavaUtil.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp
index 26f12c5ffa3..a4a8ce6ba92 100644
--- a/cpp/src/Slice/JavaUtil.cpp
+++ b/cpp/src/Slice/JavaUtil.cpp
@@ -1092,7 +1092,8 @@ Slice::JavaGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
{
bool isObject = false;
BuiltinPtr builtin = BuiltinPtr::dynamicCast(origContent);
- if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(origContent))
+ ClassDeclPtr cl = ClassDeclPtr::dynamicCast(origContent);
+ if((builtin && builtin->kind() == Builtin::KindObject) || cl)
{
isObject = true;
}
@@ -1107,7 +1108,16 @@ Slice::JavaGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
}
else
{
- out << nl << "final String __type" << iter << " = " << origContentS << ".ice_staticId();";
+ assert(cl);
+ if(cl->isInterface())
+ {
+ out << nl << "final String __type" << iter << " = "
+ << getAbsolute(cl, package, "_", "Disp") << ".ice_staticId();";
+ }
+ else
+ {
+ out << nl << "final String __type" << iter << " = " << origContentS << ".ice_staticId();";
+ }
}
}
out << nl << "for(int __i" << iter << " = 0; __i" << iter << " < __len" << iter << "; __i" << iter
@@ -1295,7 +1305,8 @@ Slice::JavaGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
else
{
bool isObject = false;
- if((b && b->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(origContent))
+ ClassDeclPtr cl = ClassDeclPtr::dynamicCast(origContent);
+ if((b && b->kind() == Builtin::KindObject) || cl)
{
isObject = true;
}
@@ -1309,7 +1320,16 @@ Slice::JavaGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
}
else
{
- out << nl << "final String __type" << iter << " = " << origContentS << ".ice_staticId();";
+ assert(cl);
+ if(cl->isInterface())
+ {
+ out << nl << "final String __type" << iter << " = "
+ << getAbsolute(cl, package, "_", "Disp") << ".ice_staticId();";
+ }
+ else
+ {
+ out << nl << "final String __type" << iter << " = " << origContentS << ".ice_staticId();";
+ }
}
}
out << nl << v << " = new " << origContentS << "[__len" << iter << "]";
@@ -1410,7 +1430,7 @@ bool
Slice::JavaGenerator::MetaDataVisitor::visitModuleStart(const ModulePtr& p)
{
validate(p);
- return false;
+ return true;
}
void