Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish Removing Nonmutating #2127

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cpp/src/Ice/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ Ice::Object::_iceCheckMode(OperationMode expected, OperationMode received)
assert(expected != OperationMode::Nonmutating); // We never expect Nonmutating
if (expected == OperationMode::Idempotent && received == OperationMode::Nonmutating)
{
//
// Fine: typically an old client still using the deprecated nonmutating keyword
//
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions cpp/src/Ice/ProxyAsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ Ice::ObjectPrx::_iceI_isA(const shared_ptr<OutgoingAsyncT<bool>>& outAsync, stri
_checkTwowayOnly(operationName);
outAsync->invoke(
operationName,
OperationMode::Nonmutating,
OperationMode::Idempotent,
FormatType::DefaultFormat,
ctx,
[&](Ice::OutputStream* os) { os->write(typeId, false); },
Expand Down Expand Up @@ -373,7 +373,7 @@ void
Ice::ObjectPrx::_iceI_ping(const shared_ptr<OutgoingAsyncT<void>>& outAsync, const Context& ctx) const
{
static constexpr string_view operationName = "ice_ping";
outAsync->invoke(operationName, OperationMode::Nonmutating, FormatType::DefaultFormat, ctx, nullptr, nullptr);
outAsync->invoke(operationName, OperationMode::Idempotent, FormatType::DefaultFormat, ctx, nullptr, nullptr);
}

vector<string>
Expand Down Expand Up @@ -411,7 +411,7 @@ Ice::ObjectPrx::_iceI_ids(const shared_ptr<OutgoingAsyncT<vector<string>>>& outA
_checkTwowayOnly(operationName);
outAsync->invoke(
operationName,
OperationMode::Nonmutating,
OperationMode::Idempotent,
FormatType::DefaultFormat,
ctx,
nullptr,
Expand Down Expand Up @@ -459,7 +459,7 @@ Ice::ObjectPrx::_iceI_id(const shared_ptr<OutgoingAsyncT<string>>& outAsync, con
_checkTwowayOnly(operationName);
outAsync->invoke(
operationName,
OperationMode::Nonmutating,
OperationMode::Idempotent,
FormatType::DefaultFormat,
ctx,
nullptr,
Expand Down
28 changes: 0 additions & 28 deletions cpp/test/Ice/operations/TestAMDI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,6 @@ using namespace std;

MyDerivedClassI::MyDerivedClassI() : _opByteSOnewayCallCount(0) {}

bool
MyDerivedClassI::ice_isA(string id, const Current& current) const
{
test(current.mode == OperationMode::Nonmutating);
return MyDerivedClass::ice_isA(std::move(id), current);
}

void
MyDerivedClassI::ice_ping(const Current& current) const
{
test(current.mode == OperationMode::Nonmutating);
MyDerivedClass::ice_ping(current);
}

std::vector<std::string>
MyDerivedClassI::ice_ids(const Current& current) const
{
test(current.mode == OperationMode::Nonmutating);
return MyDerivedClass::ice_ids(current);
}

std::string
MyDerivedClassI::ice_id(const Current& current) const
{
test(current.mode == OperationMode::Nonmutating);
return MyDerivedClass::ice_id(current);
}

void
MyDerivedClassI::shutdownAsync(function<void()> response, function<void(exception_ptr)>, const Current& current)
{
Expand Down
8 changes: 0 additions & 8 deletions cpp/test/Ice/operations/TestAMDI.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ class MyDerivedClassI final : public Test::MyDerivedClass
public:
MyDerivedClassI();

//
// Override the Object "pseudo" operations to verify the operation mode.
//
bool ice_isA(std::string, const Ice::Current&) const;
void ice_ping(const Ice::Current&) const;
std::vector<std::string> ice_ids(const Ice::Current&) const;
std::string ice_id(const Ice::Current&) const;

void shutdownAsync(std::function<void()>, std::function<void(std::exception_ptr)>, const Ice::Current&) final;

void supportsCompressAsync(std::function<void(bool)>, std::function<void(std::exception_ptr)>, const Ice::Current&)
Expand Down
28 changes: 0 additions & 28 deletions cpp/test/Ice/operations/TestI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,6 @@ using namespace std;

MyDerivedClassI::MyDerivedClassI() : _opByteSOnewayCallCount(0) {}

bool
MyDerivedClassI::ice_isA(string id, const Ice::Current& current) const
{
test(current.mode == OperationMode::Nonmutating);
return Test::MyDerivedClass::ice_isA(std::move(id), current);
}

void
MyDerivedClassI::ice_ping(const Ice::Current& current) const
{
test(current.mode == OperationMode::Nonmutating);
Test::MyDerivedClass::ice_ping(current);
}

std::vector<std::string>
MyDerivedClassI::ice_ids(const Ice::Current& current) const
{
test(current.mode == OperationMode::Nonmutating);
return Test::MyDerivedClass::ice_ids(current);
}

std::string
MyDerivedClassI::ice_id(const Ice::Current& current) const
{
test(current.mode == OperationMode::Nonmutating);
return Test::MyDerivedClass::ice_id(current);
}

void
MyDerivedClassI::shutdown(const Ice::Current& current)
{
Expand Down
8 changes: 0 additions & 8 deletions cpp/test/Ice/operations/TestI.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ class MyDerivedClassI final : public Test::MyDerivedClass
public:
MyDerivedClassI();

//
// Override the Object "pseudo" operations to verify the operation mode.
//
bool ice_isA(std::string, const Ice::Current&) const final;
void ice_ping(const Ice::Current&) const final;
std::vector<std::string> ice_ids(const Ice::Current&) const final;
std::string ice_id(const Ice::Current&) const final;

void shutdown(const Ice::Current&) final;

bool supportsCompress(const Ice::Current&) final;
Expand Down
6 changes: 2 additions & 4 deletions csharp/src/Ice/Object.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,12 @@ private static string operationModeToString(OperationMode mode)

public static void iceCheckMode(OperationMode expected, OperationMode received)
{
Debug.Assert(expected != OperationMode.Nonmutating); // We never expect Nonmutating
if (expected != received)
{
if (expected == OperationMode.Idempotent && received == OperationMode.Nonmutating)
{
//
// Fine: typically an old client still using the
// deprecated nonmutating keyword
//
// Fine: typically an old client still using the deprecated nonmutating keyword
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions csharp/src/Ice/Proxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ private void iceI_ice_isA(string id,
{
iceCheckAsyncTwowayOnly(_ice_isA_name);
getOutgoingAsync<bool>(completed).invoke(_ice_isA_name,
OperationMode.Nonmutating,
OperationMode.Idempotent,
FormatType.DefaultFormat,
context,
synchronous,
Expand Down Expand Up @@ -685,7 +685,7 @@ private void iceI_ice_ping(Dictionary<string, string> context, OutgoingAsyncComp
bool synchronous)
{
getOutgoingAsync<object>(completed).invoke(_ice_ping_name,
OperationMode.Nonmutating,
OperationMode.Idempotent,
FormatType.DefaultFormat,
context,
synchronous);
Expand Down Expand Up @@ -740,7 +740,7 @@ private void iceI_ice_ids(Dictionary<string, string> context, OutgoingAsyncCompl
{
iceCheckAsyncTwowayOnly(_ice_ids_name);
getOutgoingAsync<string[]>(completed).invoke(_ice_ids_name,
OperationMode.Nonmutating,
OperationMode.Idempotent,
FormatType.DefaultFormat,
context,
synchronous,
Expand Down Expand Up @@ -793,7 +793,7 @@ private void iceI_ice_id(Dictionary<string, string> context,
bool synchronous)
{
getOutgoingAsync<string>(completed).invoke(_ice_id_name,
OperationMode.Nonmutating,
OperationMode.Idempotent,
FormatType.DefaultFormat,
context,
synchronous,
Expand Down
27 changes: 0 additions & 27 deletions csharp/test/Ice/operations/MyDerivedClassAMDI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,6 @@ public void Join()
private Thread _thread;
}

//
// Override the Object "pseudo" operations to verify the operation mode.
//
public override bool ice_isA(String id, Ice.Current current)
{
test(current.mode == Ice.OperationMode.Nonmutating);
return base.ice_isA(id, current);
}

public override void ice_ping(Ice.Current current)
{
test(current.mode == Ice.OperationMode.Nonmutating);
base.ice_ping(current);
}

public override string[] ice_ids(Ice.Current current)
{
test(current.mode == Ice.OperationMode.Nonmutating);
return base.ice_ids(current);
}

public override string ice_id(Ice.Current current)
{
test(current.mode == Ice.OperationMode.Nonmutating);
return base.ice_id(current);
}

public override Task shutdownAsync(Ice.Current current)
{
while (_opVoidThread != null)
Expand Down
28 changes: 0 additions & 28 deletions csharp/test/Ice/operations/MyDerivedClassI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,6 @@ private static void test(bool b)
}
}

//
// Override the Object "pseudo" operations to verify the operation mode.
//

public override bool ice_isA(string id, Ice.Current current)
{
test(current.mode == Ice.OperationMode.Nonmutating);
return base.ice_isA(id, current);
}

public override void ice_ping(Ice.Current current)
{
test(current.mode == Ice.OperationMode.Nonmutating);
base.ice_ping(current);
}

public override string[] ice_ids(Ice.Current current)
{
test(current.mode == Ice.OperationMode.Nonmutating);
return base.ice_ids(current);
}

public override string ice_id(Ice.Current current)
{
test(current.mode == Ice.OperationMode.Nonmutating);
return base.ice_id(current);
}

public override void shutdown(Ice.Current current)
{
current.adapter.getCommunicator().shutdown();
Expand Down
6 changes: 2 additions & 4 deletions java/src/Ice/src/main/java/com/zeroc/Ice/Object.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,10 @@ static void _iceCheckMode(OperationMode expected, OperationMode received) {
expected = OperationMode.Normal;
}

assert expected != OperationMode.Nonmutating; // We never expect Nonmutating
if (expected != received) {
if (expected == OperationMode.Idempotent && received == OperationMode.Nonmutating) {
//
// Fine: typically an old client still using the
// deprecated nonmutating keyword
//
// Fine: typically an old client still using the deprecated nonmutating keyword
} else {
MarshalException ex = new MarshalException();
ex.reason =
Expand Down
8 changes: 4 additions & 4 deletions java/src/Ice/src/main/java/com/zeroc/Ice/_ObjectPrxI.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public CompletableFuture<Boolean> ice_isAAsync(String id, Map<String, String> co
private OutgoingAsync<Boolean> _iceI_ice_isAAsync(
String id, Map<String, String> context, boolean sync) {
OutgoingAsync<Boolean> f =
new OutgoingAsync<>(this, "ice_isA", OperationMode.Nonmutating, sync, null);
new OutgoingAsync<>(this, "ice_isA", OperationMode.Idempotent, sync, null);
f.invoke(true, context, null, ostr -> ostr.writeString(id), istr -> istr.readBool());
return f;
}
Expand All @@ -58,7 +58,7 @@ public CompletableFuture<Void> ice_pingAsync(Map<String, String> context) {

private OutgoingAsync<Void> _iceI_ice_pingAsync(Map<String, String> context, boolean sync) {
OutgoingAsync<Void> f =
new OutgoingAsync<>(this, "ice_ping", OperationMode.Nonmutating, sync, null);
new OutgoingAsync<>(this, "ice_ping", OperationMode.Idempotent, sync, null);
f.invoke(false, context, null, null, null);
return f;
}
Expand All @@ -81,7 +81,7 @@ public CompletableFuture<String[]> ice_idsAsync(Map<String, String> context) {

private OutgoingAsync<String[]> _iceI_ice_idsAsync(Map<String, String> context, boolean sync) {
OutgoingAsync<String[]> f =
new OutgoingAsync<>(this, "ice_ids", OperationMode.Nonmutating, sync, null);
new OutgoingAsync<>(this, "ice_ids", OperationMode.Idempotent, sync, null);
f.invoke(true, context, null, null, istr -> istr.readStringSeq());
return f;
}
Expand All @@ -104,7 +104,7 @@ public CompletableFuture<String> ice_idAsync(Map<String, String> context) {

private OutgoingAsync<String> _iceI_ice_idAsync(Map<String, String> context, boolean sync) {
OutgoingAsync<String> f =
new OutgoingAsync<>(this, "ice_id", OperationMode.Nonmutating, sync, null);
new OutgoingAsync<>(this, "ice_id", OperationMode.Idempotent, sync, null);
f.invoke(true, context, null, null, istr -> istr.readString());
return f;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,6 @@ public void run() {
private CompletableFuture<Void> _future;
}

//
// Override the Object "pseudo" operations to verify the operation mode.
//

@Override
public boolean ice_isA(String id, Current current) {
test(current.mode == com.zeroc.Ice.OperationMode.Nonmutating);
return MyDerivedClass.super.ice_isA(id, current);
}

@Override
public void ice_ping(Current current) {
test(current.mode == com.zeroc.Ice.OperationMode.Nonmutating);
MyDerivedClass.super.ice_ping(current);
}

@Override
public String[] ice_ids(Current current) {
test(current.mode == com.zeroc.Ice.OperationMode.Nonmutating);
return MyDerivedClass.super.ice_ids(current);
}

@Override
public String ice_id(Current current) {
test(current.mode == com.zeroc.Ice.OperationMode.Nonmutating);
return MyDerivedClass.super.ice_id(current);
}

@Override
public synchronized CompletionStage<Void> shutdownAsync(Current current) {
while (_opVoidThread != null) {
Expand Down
28 changes: 0 additions & 28 deletions java/test/src/main/java/test/Ice/operations/MyDerivedClassI.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,6 @@ private static void test(boolean b) {
}
}

//
// Override the Object "pseudo" operations to verify the operation mode.
//

@Override
public boolean ice_isA(String id, Current current) {
test(current.mode == com.zeroc.Ice.OperationMode.Nonmutating);
return MyDerivedClass.super.ice_isA(id, current);
}

@Override
public void ice_ping(Current current) {
test(current.mode == com.zeroc.Ice.OperationMode.Nonmutating);
MyDerivedClass.super.ice_ping(current);
}

@Override
public String[] ice_ids(Current current) {
test(current.mode == com.zeroc.Ice.OperationMode.Nonmutating);
return MyDerivedClass.super.ice_ids(current);
}

@Override
public String ice_id(Current current) {
test(current.mode == com.zeroc.Ice.OperationMode.Nonmutating);
return MyDerivedClass.super.ice_id(current);
}

@Override
public void shutdown(Current current) {
current.adapter.getCommunicator().shutdown();
Expand Down
Loading