diff options
author | Michi Henning <michi@zeroc.com> | 2003-08-28 03:29:13 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2003-08-28 03:29:13 +0000 |
commit | 762af02a7e4c4fd3ade1bd50325203fefe747604 (patch) | |
tree | 4fe4d61a417d3e974ac3cc3cbc7401c2a19985f4 /cpp/src/slice2java/Gen.cpp | |
parent | Merged Ice 11 branch. (diff) | |
download | ice-762af02a7e4c4fd3ade1bd50325203fefe747604.tar.bz2 ice-762af02a7e4c4fd3ade1bd50325203fefe747604.tar.xz ice-762af02a7e4c4fd3ade1bd50325203fefe747604.zip |
Fixed incorrect code generation of Java tie classes for "amd" metadata
operations.
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index eb26d6921d2..ef0e9cf62ae 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -1067,11 +1067,25 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) string params = getParams((*r), scope); string args = getArgs(*r); + bool hasAMD = p->hasMetaData("amd") || (*r)->hasMetaData("amd"); + out << sp; - out << nl << "public " << retS << nl << opName << '(' << params; + out << nl << "public " << (hasAMD ? "void" : retS) << nl << opName; + if(hasAMD) + { + out << "_async"; + } + out << '('; + if(hasAMD) + { + ContainedPtr definingContainer = ContainedPtr::dynamicCast((*r)->container()); + out << "AMD_" << fixKwd(definingContainer->name()) << '_' << opName << " __cb, "; + } + out << params; + if(!p->isLocal()) { - if(!params.empty()) + if(!params.empty() || hasAMD) { out << ", "; } @@ -1085,11 +1099,12 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) writeThrowsClause(scope, throws); out << sb; out << nl; - if(ret) + if(ret && !hasAMD) { out << "return "; } - out << "_ice_delegate." << opName << '(' << args; + out << "_ice_delegate." << opName << (hasAMD ? "_async(__cb, " : "("); + out << args; if(!p->isLocal()) { if(!args.empty()) |