summaryrefslogtreecommitdiff
path: root/cpp/src/slice2java/Gen.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2007-06-25 06:43:08 -0700
committerMark Spruiell <mes@zeroc.com>2007-06-25 06:43:08 -0700
commit58e3134e1c8958424302056c2cf3f45eaf67ad53 (patch)
tree3ed4b8c1c917d174d9cc4dad4a60759695c2a154 /cpp/src/slice2java/Gen.cpp
parentbug 2253 - Hello.ice out of sync (diff)
parenthttp://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1968 - Remove code to supp... (diff)
downloadice-58e3134e1c8958424302056c2cf3f45eaf67ad53.tar.bz2
ice-58e3134e1c8958424302056c2cf3f45eaf67ad53.tar.xz
ice-58e3134e1c8958424302056c2cf3f45eaf67ad53.zip
Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r--cpp/src/slice2java/Gen.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 6227aee3b95..1309eb43c52 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -2596,7 +2596,20 @@ Slice::Gen::TypesVisitor::visitDataMember(const DataMemberPtr& p)
out << nl << " * @deprecated " << deprecateReason;
out << nl << " **/";
}
- out << nl << "public " << s << ' ' << name << ';';
+
+ //
+ // Access visibility for class data members can be controlled by metadata.
+ // If none is specified, the default is public.
+ //
+ if(contained->containedType() == Contained::ContainedTypeClass &&
+ (p->hasMetaData("protected") || contained->hasMetaData("protected")))
+ {
+ out << nl << "protected " << s << ' ' << name << ';';
+ }
+ else
+ {
+ out << nl << "public " << s << ' ' << name << ';';
+ }
//
// Getter/Setter.
@@ -3406,7 +3419,13 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
out << sp;
out << nl << "public void" << nl << op->name() << "_async" << spar << paramsAMI << epar;
out << sb;
- out << nl << "__cb.__invoke" << spar << "this" << argsAMI << "null" << epar << ';';
+ out << nl << opName << "_async" << spar << argsAMI << "null" << "false" << epar << ';';
+ out << eb;
+
+ out << sp;
+ out << nl << "public void" << nl << op->name() << "_async" << spar << paramsAMI << contextParam << epar;
+ out << sb;
+ out << nl << opName << "_async" << spar << argsAMI << "__ctx" << "true" << epar << ';';
out << eb;
out << sp;
@@ -3421,10 +3440,10 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
{
out << nl << "@SuppressWarnings(\"unchecked\")";
}
- out << nl << "public void" << nl << op->name() << "_async" << spar << paramsAMI
- << contextParam << epar;
+ out << nl << "private void" << nl << opName << "_async" << spar << paramsAMI
+ << contextParam << explicitContextParam << epar;
out << sb;
- out << nl << "if( __ctx == null)";
+ out << nl << "if(__explicitCtx && __ctx == null)";
out << sb;
out << nl << "__ctx = _emptyContext;";
out << eb;