From 6ae3365ce751107c374d69a86c74d7e3306a1c58 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Thu, 4 Apr 2024 09:19:32 -0400 Subject: [PATCH 01/13] Connection cleanup (#2018) --- cpp/include/Ice/Connection.h | 2 +- cpp/src/Ice/ACM.cpp | 8 ++++-- cpp/src/Ice/ACM.h | 40 ++++++++++++++------------ cpp/src/Ice/Connection.cpp | 2 ++ cpp/src/Ice/ConnectionI.cpp | 6 ---- cpp/src/Ice/ConnectionI.h | 56 ++++++++++++++++++------------------ 6 files changed, 59 insertions(+), 55 deletions(-) diff --git a/cpp/include/Ice/Connection.h b/cpp/include/Ice/Connection.h index 383688134e6..8a0a9461ca4 100644 --- a/cpp/include/Ice/Connection.h +++ b/cpp/include/Ice/Connection.h @@ -227,7 +227,7 @@ namespace Ice class ICE_API Connection { public: - virtual ~Connection() = default; + virtual ~Connection() = 0; /** * Manually close the connection using the specified closure mode. diff --git a/cpp/src/Ice/ACM.cpp b/cpp/src/Ice/ACM.cpp index 27a529dc78d..1301d668ce8 100644 --- a/cpp/src/Ice/ACM.cpp +++ b/cpp/src/Ice/ACM.cpp @@ -129,9 +129,11 @@ IceInternal::FactoryACMMonitor::add(const ConnectionIPtr& connection) if (_connections.empty()) { _connections.insert(connection); + // We convert to milliseconds in case the timeout is only one or a few seconds; the division is an integral + // division. _instance->timer()->scheduleRepeated( shared_from_this(), - chrono::duration_cast(_config.timeout) / 2); + chrono::duration_cast(_config.timeout) / 2); } else { @@ -301,7 +303,9 @@ IceInternal::ConnectionACMMonitor::add(const ConnectionIPtr& connection) _connection = connection; if (_config.timeout != chrono::seconds::zero()) { - _timer->scheduleRepeated(shared_from_this(), chrono::duration_cast(_config.timeout) / 2); + // We convert to milliseconds in case the timeout is only one or a few seconds; the division is an integral + // division. + _timer->scheduleRepeated(shared_from_this(), chrono::duration_cast(_config.timeout) / 2); } } diff --git a/cpp/src/Ice/ACM.h b/cpp/src/Ice/ACM.h index b738731fa5e..edb7d6a4695 100644 --- a/cpp/src/Ice/ACM.h +++ b/cpp/src/Ice/ACM.h @@ -45,19 +45,21 @@ namespace IceInternal virtual Ice::ACM getACM() = 0; }; - class FactoryACMMonitor : public ACMMonitor, public std::enable_shared_from_this + class FactoryACMMonitor final : public ACMMonitor, public std::enable_shared_from_this { public: FactoryACMMonitor(const InstancePtr&, const ACMConfig&); - virtual ~FactoryACMMonitor(); + ~FactoryACMMonitor() final; - virtual void add(const Ice::ConnectionIPtr&); - virtual void remove(const Ice::ConnectionIPtr&); - virtual void reap(const Ice::ConnectionIPtr&); + void add(const Ice::ConnectionIPtr&) final; + void remove(const Ice::ConnectionIPtr&) final; + void reap(const Ice::ConnectionIPtr&) final; - virtual ACMMonitorPtr - acm(const std::optional&, const std::optional&, const std::optional&); - virtual Ice::ACM getACM(); + ACMMonitorPtr + acm(const std::optional&, + const std::optional&, + const std::optional&) final; + Ice::ACM getACM() final; void destroy(); void swapReapedConnections(std::vector&); @@ -67,7 +69,7 @@ namespace IceInternal void handleException(const std::exception&); void handleException(); - virtual void runTimerTask(); + void runTimerTask() final; InstancePtr _instance; const ACMConfig _config; @@ -79,22 +81,24 @@ namespace IceInternal std::condition_variable _conditionVariable; }; - class ConnectionACMMonitor : public ACMMonitor, public std::enable_shared_from_this + class ConnectionACMMonitor final : public ACMMonitor, public std::enable_shared_from_this { public: ConnectionACMMonitor(const FactoryACMMonitorPtr&, const IceUtil::TimerPtr&, const ACMConfig&); - virtual ~ConnectionACMMonitor(); + ~ConnectionACMMonitor() final; - virtual void add(const Ice::ConnectionIPtr&); - virtual void remove(const Ice::ConnectionIPtr&); - virtual void reap(const Ice::ConnectionIPtr&); + void add(const Ice::ConnectionIPtr&) final; + void remove(const Ice::ConnectionIPtr&) final; + void reap(const Ice::ConnectionIPtr&) final; - virtual ACMMonitorPtr - acm(const std::optional&, const std::optional&, const std::optional&); - virtual Ice::ACM getACM(); + ACMMonitorPtr + acm(const std::optional&, + const std::optional&, + const std::optional&) final; + Ice::ACM getACM() final; private: - virtual void runTimerTask(); + void runTimerTask() final; const FactoryACMMonitorPtr _parent; const IceUtil::TimerPtr _timer; diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp index 3150ca1d7b2..7f951ad16ea 100644 --- a/cpp/src/Ice/Connection.cpp +++ b/cpp/src/Ice/Connection.cpp @@ -7,6 +7,8 @@ using namespace Ice; using namespace std; +Ice::Connection::~Connection() {} + void Ice::Connection::flushBatchRequests(CompressBatch compress) { diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index f3d078f6a1f..580aeabb992 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -865,12 +865,6 @@ namespace }; } -void -Ice::ConnectionI::heartbeat() -{ - Connection::heartbeatAsync().get(); -} - std::function Ice::ConnectionI::heartbeatAsync(::std::function ex, ::std::function sent) { diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h index deda321373a..e5cb30cd8e6 100644 --- a/cpp/src/Ice/ConnectionI.h +++ b/cpp/src/Ice/ConnectionI.h @@ -48,7 +48,9 @@ namespace Ice class ObjectAdapterI; using ObjectAdapterIPtr = std::shared_ptr; - class ConnectionI : public Connection, public IceInternal::EventHandler, public IceInternal::CancellationHandler + class ConnectionI final : public Connection, + public IceInternal::EventHandler, + public IceInternal::CancellationHandler { class Observer : public IceInternal::ObserverHelperT { @@ -133,12 +135,12 @@ namespace Ice void activate(); void hold(); void destroy(DestructionReason); - virtual void close(ConnectionClose) noexcept; // From Connection. + void close(ConnectionClose) noexcept final; // From Connection. bool isActiveOrHolding() const; bool isFinished() const; - virtual void throwException() const; // From Connection. Throws the connection exception if destroyed. + void throwException() const final; // From Connection. Throws the connection exception if destroyed. void waitUntilHolding() const; void waitUntilFinished(); // Not const, as this might close the connection upon timeout. @@ -151,32 +153,30 @@ namespace Ice const IceInternal::BatchRequestQueuePtr& getBatchRequestQueue() const; - virtual std::function flushBatchRequestsAsync( + std::function flushBatchRequestsAsync( CompressBatch, std::function, - std::function = nullptr); + std::function = nullptr) final; - virtual void setCloseCallback(CloseCallback); - virtual void setHeartbeatCallback(HeartbeatCallback); + void setCloseCallback(CloseCallback) final; + void setHeartbeatCallback(HeartbeatCallback) final; - virtual void heartbeat(); + std::function + heartbeatAsync(std::function, std::function = nullptr) final; - virtual std::function - heartbeatAsync(std::function, std::function = nullptr); + void + setACM(const std::optional&, const std::optional&, const std::optional&) final; + ACM getACM() noexcept final; - virtual void - setACM(const std::optional&, const std::optional&, const std::optional&); - virtual ACM getACM() noexcept; - - virtual void asyncRequestCanceled(const IceInternal::OutgoingAsyncBasePtr&, std::exception_ptr); + void asyncRequestCanceled(const IceInternal::OutgoingAsyncBasePtr&, std::exception_ptr) final; IceInternal::EndpointIPtr endpoint() const; IceInternal::ConnectorPtr connector() const; - virtual void setAdapter(const ObjectAdapterPtr&); // From Connection. - virtual ObjectAdapterPtr getAdapter() const noexcept; // From Connection. - virtual EndpointPtr getEndpoint() const noexcept; // From Connection. - virtual ObjectPrx createProxy(const Identity& ident) const; // From Connection. + void setAdapter(const ObjectAdapterPtr&) final; // From Connection. + ObjectAdapterPtr getAdapter() const noexcept final; // From Connection. + EndpointPtr getEndpoint() const noexcept final; // From Connection. + ObjectPrx createProxy(const Identity& ident) const final; // From Connection. void setAdapterFromAdapter(const ObjectAdapterIPtr&); // From ObjectAdapterI. @@ -188,18 +188,18 @@ namespace Ice bool finishAsync(IceInternal::SocketOperation); #endif - virtual void message(IceInternal::ThreadPoolCurrent&); - virtual void finished(IceInternal::ThreadPoolCurrent&, bool); - virtual std::string toString() const noexcept; // From Connection and EvantHandler. - virtual IceInternal::NativeInfoPtr getNativeInfo(); + void message(IceInternal::ThreadPoolCurrent&) final; + void finished(IceInternal::ThreadPoolCurrent&, bool) final; + std::string toString() const noexcept final; // From Connection and EventHandler. + IceInternal::NativeInfoPtr getNativeInfo() final; void timedOut(); - virtual std::string type() const noexcept; // From Connection. - virtual std::int32_t timeout() const noexcept; // From Connection. - virtual ConnectionInfoPtr getInfo() const; // From Connection + std::string type() const noexcept final; // From Connection. + std::int32_t timeout() const noexcept final; // From Connection. + ConnectionInfoPtr getInfo() const final; // From Connection - virtual void setBufferSize(std::int32_t rcvSize, std::int32_t sndSize); // From Connection + void setBufferSize(std::int32_t rcvSize, std::int32_t sndSize) final; // From Connection void exception(std::exception_ptr); @@ -217,7 +217,7 @@ namespace Ice void closeCallback(const CloseCallback&); - virtual ~ConnectionI(); + ~ConnectionI() final; private: ConnectionI( From 869b39af155f64969b9c1c2ae72bf77ba12fcc64 Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 4 Apr 2024 16:11:12 +0200 Subject: [PATCH 02/13] Enable C# analyzers, and fix warnings (#2024) --- csharp/msbuild/CodeAnalysis.Base.globalconfig | 349 ++++++++++++++++++ csharp/msbuild/CodeAnalysis.Src.globalconfig | 7 + .../msbuild/CodeAnalysis.Tests.globalconfig | 34 ++ csharp/msbuild/StyleCop.json | 15 + csharp/msbuild/ice.common.props | 20 +- csharp/src/Directory.Build.props | 14 + csharp/src/Glacier2/AssemblyInfo.cs | 5 +- csharp/src/Glacier2/SessionCallback.cs | 6 +- csharp/src/Glacier2/SessionFactoryHelper.cs | 14 +- csharp/src/Glacier2/SessionHelper.cs | 13 +- csharp/src/Ice/ACM.cs | 9 +- csharp/src/Ice/Acceptor.cs | 4 +- csharp/src/Ice/Arrays.cs | 5 +- csharp/src/Ice/AssemblyInfo.cs | 5 +- csharp/src/Ice/AssemblyUtil.cs | 12 +- csharp/src/Ice/AsyncIOThread.cs | 10 +- csharp/src/Ice/BZip2.cs | 9 +- csharp/src/Ice/BatchRequestInterceptor.cs | 4 +- csharp/src/Ice/BatchRequestQueue.cs | 13 +- csharp/src/Ice/Buffer.cs | 10 +- csharp/src/Ice/ByteBuffer.cs | 59 ++- csharp/src/Ice/Collections.cs | 5 +- csharp/src/Ice/CollocatedRequestHandler.cs | 8 +- csharp/src/Ice/Communicator.cs | 15 +- csharp/src/Ice/CommunicatorI.cs | 8 +- csharp/src/Ice/Compare.cs | 4 +- csharp/src/Ice/ConnectRequestHandler.cs | 8 +- csharp/src/Ice/Connection.cs | 4 +- csharp/src/Ice/ConnectionFactory.cs | 35 +- csharp/src/Ice/ConnectionI.cs | 56 ++- csharp/src/Ice/ConnectionRequestHandler.cs | 4 +- csharp/src/Ice/Connector.cs | 4 +- csharp/src/Ice/Current.cs | 10 +- csharp/src/Ice/DefaultsAndOverrides.cs | 5 +- csharp/src/Ice/DispatchInterceptor.cs | 4 +- csharp/src/Ice/Endpoint.cs | 4 +- csharp/src/Ice/EndpointFactory.cs | 4 +- csharp/src/Ice/EndpointFactoryManager.cs | 8 +- csharp/src/Ice/EndpointHostResolver.cs | 9 +- csharp/src/Ice/EndpointI.cs | 9 +- csharp/src/Ice/EndpointSelectionType.cs | 4 +- csharp/src/Ice/EventHandler.cs | 16 +- csharp/src/Ice/Exception.cs | 5 +- csharp/src/Ice/FormatType.cs | 4 +- csharp/src/Ice/HttpParser.cs | 11 +- csharp/src/Ice/IPEndpointI.cs | 14 +- csharp/src/Ice/IceSSL/AcceptorI.cs | 8 +- csharp/src/Ice/IceSSL/ConnectionInfo.cs | 4 +- csharp/src/Ice/IceSSL/ConnectorI.cs | 4 +- csharp/src/Ice/IceSSL/EndpointI.cs | 9 +- csharp/src/Ice/IceSSL/EndpointInfo.cs | 4 +- csharp/src/Ice/IceSSL/Instance.cs | 8 +- csharp/src/Ice/IceSSL/RFC2253.cs | 35 +- csharp/src/Ice/IceSSL/SSLEngine.cs | 14 +- csharp/src/Ice/IceSSL/TransceiverI.cs | 13 +- csharp/src/Ice/IceSSL/TrustManager.cs | 11 +- csharp/src/Ice/ImplicitContext.cs | 8 +- csharp/src/Ice/ImplicitContextI.cs | 11 +- csharp/src/Ice/Incoming.cs | 16 +- csharp/src/Ice/InputStream.cs | 10 +- csharp/src/Ice/Instance.cs | 27 +- csharp/src/Ice/Instrumentation.cs | 4 +- csharp/src/Ice/InstrumentationI.cs | 14 +- csharp/src/Ice/LocalException.cs | 4 +- csharp/src/Ice/LocatorInfo.cs | 15 +- csharp/src/Ice/Logger.cs | 4 +- csharp/src/Ice/LoggerAdminI.cs | 26 +- csharp/src/Ice/LoggerAdminLoggerI.cs | 11 +- csharp/src/Ice/LoggerI.cs | 13 +- csharp/src/Ice/LoggerPlugin.cs | 4 +- csharp/src/Ice/MetricsAdminI.cs | 18 +- csharp/src/Ice/MetricsObserverI.cs | 14 +- csharp/src/Ice/Network.cs | 15 +- csharp/src/Ice/NetworkProxy.cs | 10 +- csharp/src/Ice/Object.cs | 6 +- csharp/src/Ice/ObjectAdapter.cs | 4 +- csharp/src/Ice/ObjectAdapterFactory.cs | 8 +- csharp/src/Ice/ObjectAdapterI.cs | 24 +- csharp/src/Ice/ObserverHelper.cs | 9 +- csharp/src/Ice/OpaqueEndpointI.cs | 9 +- csharp/src/Ice/Optional.cs | 7 +- csharp/src/Ice/Options.cs | 21 +- csharp/src/Ice/OutgoingAsync.cs | 13 +- csharp/src/Ice/OutputBase.cs | 10 +- csharp/src/Ice/OutputStream.cs | 9 +- csharp/src/Ice/Patcher.cs | 6 +- csharp/src/Ice/Plugin.cs | 4 +- csharp/src/Ice/PluginManagerI.cs | 16 +- csharp/src/Ice/ProcessI.cs | 8 +- csharp/src/Ice/Properties.cs | 4 +- csharp/src/Ice/PropertiesAdminI.cs | 27 +- csharp/src/Ice/PropertiesI.cs | 24 +- csharp/src/Ice/Property.cs | 4 +- csharp/src/Ice/Protocol.cs | 4 +- csharp/src/Ice/ProtocolInstance.cs | 4 +- csharp/src/Ice/ProtocolPluginFacade.cs | 4 +- csharp/src/Ice/Proxy.cs | 10 +- csharp/src/Ice/ProxyFactory.cs | 7 +- csharp/src/Ice/ProxyIdentityKey.cs | 14 +- csharp/src/Ice/Reference.cs | 14 +- csharp/src/Ice/ReferenceFactory.cs | 8 +- csharp/src/Ice/ReplyStatus.cs | 4 +- csharp/src/Ice/RequestHandler.cs | 4 +- csharp/src/Ice/RequestHandlerFactory.cs | 6 +- csharp/src/Ice/ResponseHandler.cs | 4 +- csharp/src/Ice/RetryQueue.cs | 9 +- csharp/src/Ice/RouterInfo.cs | 15 +- csharp/src/Ice/ServantLocator.cs | 4 +- csharp/src/Ice/ServantManager.cs | 20 +- csharp/src/Ice/SlicedData.cs | 4 +- csharp/src/Ice/SocketOperation.cs | 4 +- csharp/src/Ice/StreamSocket.cs | 9 +- csharp/src/Ice/StreamWrapper.cs | 17 +- csharp/src/Ice/StringUtil.cs | 22 +- csharp/src/Ice/TcpAcceptor.cs | 10 +- csharp/src/Ice/TcpConnector.cs | 8 +- csharp/src/Ice/TcpEndpointI.cs | 9 +- csharp/src/Ice/TcpTransceiver.cs | 8 +- csharp/src/Ice/ThreadHookPlugin.cs | 8 +- csharp/src/Ice/ThreadPool.cs | 18 +- csharp/src/Ice/TieBase.cs | 34 +- csharp/src/Ice/Time.cs | 31 +- csharp/src/Ice/Timer.cs | 8 +- csharp/src/Ice/TraceLevels.cs | 4 +- csharp/src/Ice/TraceUtil.cs | 28 +- csharp/src/Ice/Transceiver.cs | 8 +- csharp/src/Ice/UdpConnector.cs | 8 +- csharp/src/Ice/UdpEndpointI.cs | 12 +- csharp/src/Ice/UdpTransceiver.cs | 20 +- csharp/src/Ice/UnknownSlicedValue.cs | 4 +- csharp/src/Ice/Util.cs | 16 +- csharp/src/Ice/Value.cs | 5 +- csharp/src/Ice/ValueFactory.cs | 4 +- csharp/src/Ice/ValueFactoryManager.cs | 8 +- csharp/src/Ice/ValueWriter.cs | 4 +- csharp/src/Ice/WSAcceptor.cs | 4 +- csharp/src/Ice/WSConnector.cs | 4 +- csharp/src/Ice/WSEndpoint.cs | 12 +- csharp/src/Ice/WSTransceiver.cs | 41 +- csharp/src/IceBox/AssemblyInfo.cs | 5 +- csharp/src/IceBox/Service.cs | 119 +++--- csharp/src/IceBoxNet/AssemblyInfo.cs | 5 +- csharp/src/IceBoxNet/Server.cs | 7 +- csharp/src/IceBoxNet/ServiceManagerI.cs | 33 +- csharp/src/IceDiscovery/AssemblyInfo.cs | 5 +- csharp/src/IceDiscovery/LocatorI.cs | 7 +- csharp/src/IceDiscovery/LookupI.cs | 12 +- csharp/src/IceDiscovery/PluginI.cs | 11 +- csharp/src/IceGrid/AssemblyInfo.cs | 5 +- .../src/IceLocatorDiscovery/AssemblyInfo.cs | 5 +- csharp/src/IceLocatorDiscovery/PluginI.cs | 15 +- csharp/src/IceStorm/AssemblyInfo.cs | 5 +- csharp/test/Glacier2/router/CallbackI.cs | 4 +- csharp/test/Glacier2/router/Client.cs | 7 +- csharp/test/Glacier2/router/Server.cs | 6 +- .../test/Glacier2/sessionHelper/CallbackI.cs | 4 +- csharp/test/Glacier2/sessionHelper/Client.cs | 7 +- csharp/test/Glacier2/sessionHelper/Server.cs | 6 +- csharp/test/Ice/acm/AllTests.cs | 9 +- csharp/test/Ice/acm/Client.cs | 5 +- csharp/test/Ice/acm/Server.cs | 5 +- csharp/test/Ice/acm/TestI.cs | 4 +- .../test/Ice/adapterDeactivation/AllTests.cs | 7 +- csharp/test/Ice/adapterDeactivation/Client.cs | 5 +- .../Ice/adapterDeactivation/Collocated.cs | 5 +- csharp/test/Ice/adapterDeactivation/Cookie.cs | 4 +- .../adapterDeactivation/ServantLocatorI.cs | 4 +- csharp/test/Ice/adapterDeactivation/Server.cs | 5 +- csharp/test/Ice/adapterDeactivation/TestI.cs | 4 +- csharp/test/Ice/admin/AllTests.cs | 8 +- csharp/test/Ice/admin/Client.cs | 5 +- csharp/test/Ice/admin/Server.cs | 5 +- csharp/test/Ice/admin/TestI.cs | 5 +- csharp/test/Ice/ami/AllTests.cs | 8 +- csharp/test/Ice/ami/Client.cs | 5 +- csharp/test/Ice/ami/Collocated.cs | 5 +- csharp/test/Ice/ami/Server.cs | 5 +- csharp/test/Ice/ami/TestI.cs | 6 +- csharp/test/Ice/assemblies/Client.cs | 8 +- csharp/test/Ice/background/Acceptor.cs | 4 +- csharp/test/Ice/background/AllTests.cs | 10 +- .../Ice/background/BackgroundControllerI.cs | 5 +- csharp/test/Ice/background/BackgroundI.cs | 4 +- csharp/test/Ice/background/Client.cs | 6 +- csharp/test/Ice/background/Configuration.cs | 4 +- csharp/test/Ice/background/Connector.cs | 4 +- csharp/test/Ice/background/EndpointFactory.cs | 5 +- csharp/test/Ice/background/EndpointI.cs | 5 +- csharp/test/Ice/background/PluginI.cs | 4 +- csharp/test/Ice/background/Server.cs | 6 +- csharp/test/Ice/background/Transceiver.cs | 4 +- csharp/test/Ice/binding/AllTests.cs | 7 +- csharp/test/Ice/binding/Client.cs | 5 +- .../test/Ice/binding/RemoteCommunicatorI.cs | 4 +- .../test/Ice/binding/RemoteObjectAdapterI.cs | 4 +- csharp/test/Ice/binding/Server.cs | 5 +- csharp/test/Ice/binding/TestI.cs | 4 +- csharp/test/Ice/defaultServant/AllTests.cs | 4 +- csharp/test/Ice/defaultServant/Client.cs | 5 +- csharp/test/Ice/defaultServant/MyObjectI.cs | 4 +- csharp/test/Ice/defaultValue/AllTests.cs | 4 +- csharp/test/Ice/defaultValue/Client.cs | 5 +- csharp/test/Ice/dictMapping/AllTests.cs | 6 +- csharp/test/Ice/dictMapping/Client.cs | 5 +- csharp/test/Ice/dictMapping/Collocated.cs | 5 +- csharp/test/Ice/dictMapping/MyClassAMDI.cs | 7 +- csharp/test/Ice/dictMapping/MyClassI.cs | 6 +- csharp/test/Ice/dictMapping/Server.cs | 5 +- csharp/test/Ice/dictMapping/ServerAMD.cs | 5 +- csharp/test/Ice/dictMapping/Twoways.cs | 6 +- csharp/test/Ice/dictMapping/TwowaysAMI.cs | 7 +- csharp/test/Ice/dispatcher/AllTests.cs | 6 +- csharp/test/Ice/dispatcher/Client.cs | 6 +- csharp/test/Ice/dispatcher/Collocated.cs | 6 +- csharp/test/Ice/dispatcher/Dispatcher.cs | 6 +- csharp/test/Ice/dispatcher/Server.cs | 6 +- csharp/test/Ice/dispatcher/TestI.cs | 5 +- csharp/test/Ice/echo/BlobjectI.cs | 5 +- csharp/test/Ice/echo/Server.cs | 6 +- csharp/test/Ice/enums/AllTests.cs | 4 +- csharp/test/Ice/enums/Client.cs | 5 +- csharp/test/Ice/enums/Server.cs | 5 +- csharp/test/Ice/enums/TestI.cs | 4 +- csharp/test/Ice/exceptions/AllTests.cs | 7 +- csharp/test/Ice/exceptions/Client.cs | 5 +- csharp/test/Ice/exceptions/Collocated.cs | 5 +- csharp/test/Ice/exceptions/EmptyAMDI.cs | 4 +- csharp/test/Ice/exceptions/EmptyI.cs | 4 +- csharp/test/Ice/exceptions/ServantLocatorI.cs | 4 +- csharp/test/Ice/exceptions/Server.cs | 5 +- csharp/test/Ice/exceptions/ServerAMD.cs | 5 +- csharp/test/Ice/exceptions/ThrowerAMDI.cs | 5 +- csharp/test/Ice/exceptions/ThrowerI.cs | 4 +- csharp/test/Ice/facets/AI.cs | 4 +- csharp/test/Ice/facets/AllTests.cs | 7 +- csharp/test/Ice/facets/BI.cs | 4 +- csharp/test/Ice/facets/CI.cs | 4 +- csharp/test/Ice/facets/Client.cs | 5 +- csharp/test/Ice/facets/Collocated.cs | 5 +- csharp/test/Ice/facets/DI.cs | 4 +- csharp/test/Ice/facets/EI.cs | 4 +- csharp/test/Ice/facets/EmptyI.cs | 4 +- csharp/test/Ice/facets/FI.cs | 4 +- csharp/test/Ice/facets/GI.cs | 4 +- csharp/test/Ice/facets/HI.cs | 4 +- csharp/test/Ice/facets/Server.cs | 5 +- csharp/test/Ice/faultTolerance/AllTests.cs | 8 +- csharp/test/Ice/faultTolerance/Client.cs | 8 +- csharp/test/Ice/faultTolerance/Server.cs | 6 +- csharp/test/Ice/faultTolerance/TestI.cs | 5 +- csharp/test/Ice/hash/Client.cs | 7 +- csharp/test/Ice/hold/AllTests.cs | 7 +- csharp/test/Ice/hold/Client.cs | 5 +- csharp/test/Ice/hold/HoldI.cs | 4 +- csharp/test/Ice/hold/Server.cs | 5 +- csharp/test/Ice/hold/Timer.cs | 7 +- csharp/test/Ice/info/AllTests.cs | 6 +- csharp/test/Ice/info/Client.cs | 5 +- csharp/test/Ice/info/Server.cs | 5 +- csharp/test/Ice/info/TestI.cs | 6 +- csharp/test/Ice/inheritance/AllTests.cs | 4 +- csharp/test/Ice/inheritance/Client.cs | 5 +- csharp/test/Ice/inheritance/Collocated.cs | 5 +- csharp/test/Ice/inheritance/IAI.cs | 4 +- csharp/test/Ice/inheritance/IB1I.cs | 4 +- csharp/test/Ice/inheritance/IB2I.cs | 4 +- csharp/test/Ice/inheritance/ICI.cs | 4 +- csharp/test/Ice/inheritance/InitialI.cs | 4 +- csharp/test/Ice/inheritance/Server.cs | 5 +- csharp/test/Ice/interceptor/Client.cs | 7 +- csharp/test/Ice/interceptor/InterceptorI.cs | 7 +- csharp/test/Ice/interceptor/MyObjectI.cs | 6 +- csharp/test/Ice/invoke/AllTests.cs | 6 +- csharp/test/Ice/invoke/BlobjectI.cs | 6 +- csharp/test/Ice/invoke/Client.cs | 5 +- csharp/test/Ice/invoke/Server.cs | 6 +- csharp/test/Ice/location/AllTests.cs | 8 +- csharp/test/Ice/location/Client.cs | 5 +- csharp/test/Ice/location/HelloI.cs | 4 +- csharp/test/Ice/location/Server.cs | 5 +- csharp/test/Ice/location/ServerLocator.cs | 5 +- .../Ice/location/ServerLocatorRegistry.cs | 5 +- csharp/test/Ice/location/ServerManagerI.cs | 4 +- csharp/test/Ice/location/TestI.cs | 4 +- csharp/test/Ice/logger/Client.cs | 7 +- csharp/test/Ice/metrics/AllTests.cs | 8 +- csharp/test/Ice/metrics/Client.cs | 6 +- csharp/test/Ice/metrics/Collocated.cs | 6 +- csharp/test/Ice/metrics/InstrumentationI.cs | 6 +- csharp/test/Ice/metrics/MetricsAMDI.cs | 6 +- csharp/test/Ice/metrics/MetricsI.cs | 5 +- csharp/test/Ice/metrics/Server.cs | 7 +- csharp/test/Ice/namespacemd/AllTests.cs | 4 +- csharp/test/Ice/namespacemd/Client.cs | 5 +- csharp/test/Ice/namespacemd/InitialI.cs | 4 +- csharp/test/Ice/namespacemd/Server.cs | 5 +- csharp/test/Ice/networkProxy/AllTests.cs | 4 +- csharp/test/Ice/networkProxy/Client.cs | 6 +- csharp/test/Ice/networkProxy/Server.cs | 6 +- csharp/test/Ice/objects/AllTests.cs | 6 +- csharp/test/Ice/objects/BI.cs | 4 +- csharp/test/Ice/objects/CI.cs | 4 +- csharp/test/Ice/objects/Client.cs | 5 +- csharp/test/Ice/objects/Collocated.cs | 5 +- csharp/test/Ice/objects/DI.cs | 4 +- csharp/test/Ice/objects/EI.cs | 4 +- csharp/test/Ice/objects/F2I.cs | 4 +- csharp/test/Ice/objects/FI.cs | 4 +- csharp/test/Ice/objects/II.cs | 4 +- csharp/test/Ice/objects/InitialI.cs | 7 +- csharp/test/Ice/objects/JI.cs | 4 +- csharp/test/Ice/objects/Server.cs | 5 +- .../objects/UnexpectedObjectExceptionTestI.cs | 4 +- csharp/test/Ice/operations/AllTests.cs | 6 +- csharp/test/Ice/operations/BatchOneways.cs | 4 +- csharp/test/Ice/operations/BatchOnewaysAMI.cs | 5 +- csharp/test/Ice/operations/Client.cs | 6 +- csharp/test/Ice/operations/Collocated.cs | 5 +- .../test/Ice/operations/MyDerivedClassAMDI.cs | 9 +- .../Ice/operations/MyDerivedClassAMDTieI.cs | 9 +- csharp/test/Ice/operations/MyDerivedClassI.cs | 7 +- .../test/Ice/operations/MyDerivedClassTieI.cs | 7 +- csharp/test/Ice/operations/Oneways.cs | 4 +- csharp/test/Ice/operations/OnewaysAMI.cs | 6 +- csharp/test/Ice/operations/Server.cs | 5 +- csharp/test/Ice/operations/ServerAMD.cs | 5 +- csharp/test/Ice/operations/ServerAMDTie.cs | 5 +- csharp/test/Ice/operations/ServerTie.cs | 5 +- csharp/test/Ice/operations/Twoways.cs | 8 +- csharp/test/Ice/operations/TwowaysAMI.cs | 8 +- csharp/test/Ice/optional/AllTests.cs | 8 +- csharp/test/Ice/optional/Client.cs | 5 +- csharp/test/Ice/optional/Server.cs | 5 +- csharp/test/Ice/optional/ServerAMD.cs | 5 +- csharp/test/Ice/optional/TestAMDI.cs | 7 +- csharp/test/Ice/optional/TestI.cs | 7 +- csharp/test/Ice/plugin/BasePlugin.cs | 4 +- csharp/test/Ice/plugin/BasePluginFail.cs | 4 +- csharp/test/Ice/plugin/Client.cs | 6 +- csharp/test/Ice/plugin/PluginFactory.cs | 6 +- .../plugin/PluginInitializeFailException.cs | 4 +- .../Ice/plugin/PluginInitializeFailFactory.cs | 4 +- csharp/test/Ice/plugin/PluginOneFactory.cs | 4 +- .../test/Ice/plugin/PluginOneFailFactory.cs | 6 +- csharp/test/Ice/plugin/PluginThreeFactory.cs | 4 +- .../test/Ice/plugin/PluginThreeFailFactory.cs | 6 +- csharp/test/Ice/plugin/PluginTwoFactory.cs | 4 +- .../test/Ice/plugin/PluginTwoFailFactory.cs | 6 +- csharp/test/Ice/properties/Client.cs | 6 +- csharp/test/Ice/proxy/AllTests.cs | 8 +- csharp/test/Ice/proxy/Client.cs | 5 +- csharp/test/Ice/proxy/Collocated.cs | 6 +- csharp/test/Ice/proxy/MyDerivedClassAMDI.cs | 7 +- csharp/test/Ice/proxy/MyDerivedClassI.cs | 6 +- csharp/test/Ice/proxy/Server.cs | 5 +- csharp/test/Ice/proxy/ServerAMD.cs | 6 +- csharp/test/Ice/retry/AllTests.cs | 6 +- csharp/test/Ice/retry/Client.cs | 5 +- csharp/test/Ice/retry/Collocated.cs | 5 +- csharp/test/Ice/retry/Instrumentation.cs | 6 +- csharp/test/Ice/retry/RetryI.cs | 4 +- csharp/test/Ice/retry/Server.cs | 5 +- csharp/test/Ice/retry/SystemFailure.cs | 4 +- csharp/test/Ice/scope/AllTests.cs | 7 +- csharp/test/Ice/scope/Client.cs | 5 +- csharp/test/Ice/scope/Server.cs | 7 +- csharp/test/Ice/seqMapping/AllTests.cs | 6 +- csharp/test/Ice/seqMapping/Client.cs | 6 +- csharp/test/Ice/seqMapping/Collocated.cs | 5 +- csharp/test/Ice/seqMapping/Custom.cs | 6 +- csharp/test/Ice/seqMapping/MyClassAMDI.cs | 7 +- csharp/test/Ice/seqMapping/MyClassI.cs | 6 +- csharp/test/Ice/seqMapping/Server.cs | 5 +- csharp/test/Ice/seqMapping/ServerAMD.cs | 5 +- csharp/test/Ice/seqMapping/Twoways.cs | 6 +- csharp/test/Ice/seqMapping/TwowaysAMI.cs | 7 +- csharp/test/Ice/servantLocator/AllTests.cs | 6 +- csharp/test/Ice/servantLocator/Client.cs | 5 +- csharp/test/Ice/servantLocator/Collocated.cs | 5 +- csharp/test/Ice/servantLocator/Cookie.cs | 4 +- .../Ice/servantLocator/ServantLocatorAMDI.cs | 6 +- .../Ice/servantLocator/ServantLocatorI.cs | 8 +- csharp/test/Ice/servantLocator/Server.cs | 5 +- csharp/test/Ice/servantLocator/ServerAMD.cs | 5 +- csharp/test/Ice/servantLocator/TestAMDI.cs | 6 +- .../Ice/servantLocator/TestActivationAMDI.cs | 4 +- .../Ice/servantLocator/TestActivationI.cs | 4 +- csharp/test/Ice/servantLocator/TestI.cs | 4 +- .../test/Ice/slicing/exceptions/AllTests.cs | 7 +- csharp/test/Ice/slicing/exceptions/Client.cs | 5 +- csharp/test/Ice/slicing/exceptions/Server.cs | 6 +- .../test/Ice/slicing/exceptions/ServerAMD.cs | 6 +- .../test/Ice/slicing/exceptions/TestAMDI.cs | 5 +- csharp/test/Ice/slicing/exceptions/TestI.cs | 4 +- csharp/test/Ice/slicing/objects/AllTests.cs | 6 +- csharp/test/Ice/slicing/objects/Client.cs | 5 +- csharp/test/Ice/slicing/objects/Server.cs | 6 +- csharp/test/Ice/slicing/objects/ServerAMD.cs | 6 +- csharp/test/Ice/slicing/objects/TestAMDI.cs | 7 +- csharp/test/Ice/slicing/objects/TestI.cs | 7 +- csharp/test/Ice/stream/AllTests.cs | 5 +- csharp/test/Ice/stream/Client.cs | 6 +- csharp/test/Ice/threadPoolPriority/Client.cs | 6 +- .../test/Ice/threadPoolPriority/PriorityI.cs | 6 +- csharp/test/Ice/threadPoolPriority/Server.cs | 6 +- csharp/test/Ice/timeout/AllTests.cs | 6 +- csharp/test/Ice/timeout/Client.cs | 6 +- csharp/test/Ice/timeout/Server.cs | 6 +- csharp/test/Ice/timeout/TestI.cs | 6 +- csharp/test/Ice/udp/AllTests.cs | 5 +- csharp/test/Ice/udp/Client.cs | 7 +- csharp/test/Ice/udp/Server.cs | 6 +- csharp/test/Ice/udp/TestIntfI.cs | 4 +- csharp/test/IceBox/admin/AllTests.cs | 7 +- csharp/test/IceBox/admin/Client.cs | 6 +- csharp/test/IceBox/admin/TestI.cs | 6 +- csharp/test/IceBox/admin/TestServiceI.cs | 4 +- csharp/test/IceBox/configuration/AllTests.cs | 5 +- csharp/test/IceBox/configuration/Client.cs | 6 +- csharp/test/IceBox/configuration/TestI.cs | 4 +- .../test/IceBox/configuration/TestServiceI.cs | 4 +- csharp/test/IceDiscovery/simple/AllTests.cs | 6 +- csharp/test/IceDiscovery/simple/Client.cs | 6 +- csharp/test/IceDiscovery/simple/Server.cs | 6 +- csharp/test/IceDiscovery/simple/TestI.cs | 5 +- csharp/test/IceGrid/simple/AllTests.cs | 5 +- csharp/test/IceGrid/simple/Client.cs | 7 +- csharp/test/IceGrid/simple/Server.cs | 6 +- csharp/test/IceGrid/simple/TestI.cs | 4 +- csharp/test/IceSSL/configuration/AllTests.cs | 9 +- csharp/test/IceSSL/configuration/Client.cs | 6 +- csharp/test/IceSSL/configuration/Server.cs | 6 +- csharp/test/IceSSL/configuration/TestI.cs | 6 +- csharp/test/IceUtil/inputUtil/Client.cs | 7 +- csharp/test/Slice/escape/Client.cs | 8 +- csharp/test/Slice/macros/Client.cs | 6 +- csharp/test/Slice/structure/Client.cs | 7 +- csharp/test/TestCommon/TestHelper.cs | 7 +- 438 files changed, 1330 insertions(+), 2386 deletions(-) create mode 100644 csharp/msbuild/CodeAnalysis.Base.globalconfig create mode 100644 csharp/msbuild/CodeAnalysis.Src.globalconfig create mode 100644 csharp/msbuild/CodeAnalysis.Tests.globalconfig create mode 100644 csharp/msbuild/StyleCop.json create mode 100644 csharp/src/Directory.Build.props diff --git a/csharp/msbuild/CodeAnalysis.Base.globalconfig b/csharp/msbuild/CodeAnalysis.Base.globalconfig new file mode 100644 index 00000000000..34d24ff5d38 --- /dev/null +++ b/csharp/msbuild/CodeAnalysis.Base.globalconfig @@ -0,0 +1,349 @@ +is_global = true + +# CA1001: Types that own disposable fields should be disposable +dotnet_diagnostic.CA1001.severity = warning + +# CA1002: Do not expose generic lists +dotnet_diagnostic.CA1002.severity = none + +# CA1008: Enums should have zero value +dotnet_diagnostic.CA1008.severity = none + +# CA1014: Mark assemblies with CLSCompliant +dotnet_diagnostic.CA1014.severity = none + +# CA1028: Enum Storage should be Int32 +dotnet_diagnostic.CA1028.severity = none + +# CA1031: Do not catch general exception types +dotnet_diagnostic.CA1031.severity = none + +# CA1043: Use Integral Or String Argument For Indexers +dotnet_diagnostic.CA1043.severity = none + +# CA1032: Implement standard exception constructors +dotnet_diagnostic.CA1032.severity = none + +# CA1033: Interface methods should be callable by child types +dotnet_diagnostic.CA1033.severity = none + +# CA1034: Nested types should not be visible +dotnet_diagnostic.CA1034.severity = none + +# CA1051: Do not declare visible instance fields +dotnet_diagnostic.CA1051.severity = none + +# CA1062: Validate arguments of public methods +dotnet_diagnostic.CA1062.severity = none + +# CA1303: Do not pass literals as localized parameters +dotnet_diagnostic.CA1303.severity = none + +# CA1308: Normalize strings to uppercase +dotnet_diagnostic.CA1308.severity = none + +# CA1508: Avoid dead conditional code, getting too many false positives +dotnet_diagnostic.CA1508.severity = none + +# CA1707: Identifiers should not contain underscores +dotnet_diagnostic.CA1707.severity = none + +# CA1711: Identifiers should not have incorrect suffix +dotnet_diagnostic.CA1711.severity = none + +# CA1712: Do not prefix enum values with type name +dotnet_diagnostic.CA1712.severity = none + +# CA1715: Identifiers should have correct prefix +dotnet_diagnostic.CA1715.severity = none + +# CA1716: Identifiers should not match keywords +dotnet_diagnostic.CA1716.severity = none + +# CA1717: Only FlagsAttribute enums should have plural names +dotnet_diagnostic.CA1717.severity = warning + +# CA1720: Identifier contains type name +dotnet_diagnostic.CA1720.severity = none + +# CA1724: Type names should not match namespaces +dotnet_diagnostic.CA1724.severity = none + +# CA1812: Avoid uninstantiated internal classes +dotnet_diagnostic.CA1812.severity = none + +# CA1819: Properties should not return arrays +dotnet_diagnostic.CA1819.severity = none + +# CA1847: Use char literal for a single character lookup +dotnet_diagnostic.CA1847.severity = warning + +# CA1850: Prefer static HashData method over ComputeHash +dotnet_diagnostic.CA1850.severity = none + +# CA1851: Possible multiple enumerations of 'IEnumerable' collection +dotnet_diagnostic.CA1851.severity = none + +# CA1852: Seal internal types +dotnet_diagnostic.CA1852.severity = none + +# CA2000: Dispose objects before losing scope +dotnet_diagnostic.CA2000.severity = warning + +# CA2008: Do not create tasks without passing a TaskScheduler +dotnet_diagnostic.CA2008.severity = warning + +# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value +dotnet_diagnostic.CA2009.severity = warning + +# CA2011: Avoid infinite recursion +dotnet_diagnostic.CA2011.severity = warning + +# CA2012: Use ValueTasks correctly +dotnet_diagnostic.CA2012.severity = warning + +# CA2013: Do not use ReferenceEquals with value types +dotnet_diagnostic.CA2013.severity = warning + +# CA2014: Do not use stackalloc in loops +dotnet_diagnostic.CA2014.severity = warning + +# CA2015: Do not define finalizers for types derived from MemoryManager +dotnet_diagnostic.CA2015.severity = warning + +# CA2016: Forward the 'CancellationToken' parameter to methods +dotnet_diagnostic.CA2016.severity = warning + +# CA2200: Rethrow to preserve stack details +dotnet_diagnostic.CA2200.severity = warning + +# CA2201: Do not raise reserved exception types +dotnet_diagnostic.CA2201.severity = none + +# CA2208: Instantiate argument exceptions correctly +dotnet_diagnostic.CA2208.severity = warning +dotnet_code_quality.CA2208.api_surface = public + +# CA2211: Non-constant fields should not be visible +dotnet_diagnostic.CA2211.severity = none + +# CA2227: Collection properties should be read only +dotnet_diagnostic.CA2227.severity = none + +# CA2231: Overload operator equals on overriding ValueType.Equals +dotnet_diagnostic.CA2231.severity = none + +# CA2241: Provide correct arguments to formatting methods +dotnet_diagnostic.CA2241.severity = warning + +# CA2242: Test for NaN correctly +dotnet_diagnostic.CA2242.severity = warning + +# CA2243: Attribute string literals should parse correctly +dotnet_diagnostic.CA2243.severity = warning + +# CA2244: Do not duplicate indexed element initializations +dotnet_diagnostic.CA2244.severity = warning + +# CA2245: Do not assign a property to itself +dotnet_diagnostic.CA2245.severity = warning + +# CA2246: Assigning symbol and its member in the same statement +dotnet_diagnostic.CA2246.severity = warning + +# CA2247: Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum +dotnet_diagnostic.CA2247.severity = warning + +# CA2248: Provide correct 'enum' argument to 'Enum.HasFlag' +dotnet_diagnostic.CA2248.severity = warning + +# CA2249: Consider using 'string.Contains' instead of 'string.IndexOf' +dotnet_diagnostic.CA2249.severity = warning + +# CA2250: Use 'ThrowIfCancellationRequested' +dotnet_diagnostic.CA2250.severity = warning + +# CA2251: Use 'string.Equals' +dotnet_diagnostic.CA2251.severity = warning + +# CA5350: Do Not Use Weak Cryptographic Algorithms +dotnet_diagnostic.CA5350.severity = warning + +# CA5351: Do Not Use Broken Cryptographic Algorithms +dotnet_diagnostic.CA5351.severity = warning + +# SA1000: Spacing around keywords +dotnet_diagnostic.SA1000.severity = warning + +# SA1001: Commas should not be preceded by whitespace +dotnet_diagnostic.SA1001.severity = warning + +# SA1010: Opening square brackets should be spaced correctly +dotnet_diagnostic.SA1010.severity = none + +# SA1013: Closing brace should not be preceded by a space +dotnet_diagnostic.SA1013.severity = warning + +# SA1014: Opening generic brackets should not be preceded by a space +dotnet_diagnostic.SA1014.severity = warning + +# SA1101: Prefix local calls with this +dotnet_diagnostic.SA1101.severity = none + +# SA1118: The parameter spans multiple lines +dotnet_diagnostic.SA1118.severity = none + +# SA1122: Use string.Empty for empty strings +dotnet_diagnostic.SA1122.severity = none + +# SA1127: Generic type constraints should be on their own line +dotnet_diagnostic.SA1127.severity = none + +# SA1129: Do not use default value type constructor +dotnet_diagnostic.SA1129.severity = none + +# SA1200: A C# using directive is placed outside of a namespace element +dotnet_diagnostic.SA1200.severity = none + +# SA1201: A field should not follow a property +dotnet_diagnostic.SA1201.severity = none + +# SA1208: Using directives for System should appear before other using directives +dotnet_diagnostic.SA1208.severity = none + +# SA1214: Readonly fields should appear before non-readonly fields +dotnet_diagnostic.SA1214.severity = none + +# SA1309: Field should not begin with an underscore +dotnet_diagnostic.SA1309.severity = none + +# SA1312: Variable should begin with lower-case letter +dotnet_diagnostic.SA1312.severity = none + +# SA1401: Field should be private +dotnet_diagnostic.SA1401.severity = none + +# SA1402: File may only contain a single type +dotnet_diagnostic.SA1402.severity = none + +# SA1405: Debug.Assert should provide message text +dotnet_diagnostic.SA1405.severity = none + +# SA1413: Use trailing comma in multi-line initializers +dotnet_diagnostic.SA1413.severity = none + +# SA1414: Tuple types in signatures should have element names +dotnet_diagnostic.SA1414.severity = none + +# SA1512: Single-line comments should not be followed by blank line +dotnet_diagnostic.SA1512.severity = none + +# SA1513: Closing brace should be followed by blank line +dotnet_diagnostic.SA1513.severity = none + +# SA1515: Single-line comment should be preceded by blank line +dotnet_diagnostic.SA1515.severity = none + +# SA1625: Element documentation should not be copied and pasted +dotnet_diagnostic.SA1625.severity = none + +# SA1642: Element should be documented +dotnet_diagnostic.SA1642.severity = none + +# SA1649: File name should match first type name +dotnet_diagnostic.SA1649.severity = none + +# VSSpell001: VSSpell analyzer produces many false positives +dotnet_diagnostic.VSSpell001.severity = none + +# Use primary constructor +dotnet_diagnostic.IDE0290.severity = none + +# CA1859: use concrete types when possible for improved performance +dotnet_diagnostic.CA1859.severity = none + +# TODO review rules below + +# CA1001: Types that own disposable fields should be disposable +dotnet_diagnostic.CA1001.severity = none + +# CA1012: Abstract types should not have public constructors +dotnet_diagnostic.CA1012.severity = none + +# CA1024: Use properties where appropriate +dotnet_diagnostic.CA1024.severity = none + +# CA1027: Mark enums with FlagsAttribute +dotnet_diagnostic.CA1027.severity = none + +# CA1036: Override methods on comparable types +dotnet_diagnostic.CA1036.severity = none + +# CA1052: Static holder types should be Static or NotInheritable +dotnet_diagnostic.CA1052.severity = none + +# CA1064: Exceptions should be public +dotnet_diagnostic.CA1064.severity = none + +# CA1066: Implement IEquatable when overriding Equals +dotnet_diagnostic.CA1066.severity = none + +# CA1068: CancellationToken parameters must come last +dotnet_diagnostic.CA1068.severity = none + +# CA1304: Specify CultureInfo +dotnet_diagnostic.CA1304.severity = none + +# CA1305: Specify IFormatProvider +dotnet_diagnostic.CA1305.severity = none + +# CA1307: Specify StringComparison for clarity +dotnet_diagnostic.CA1307.severity = none + +# CA1309: Use ordinal StringComparison +dotnet_diagnostic.CA1309.severity = none + +# CA1310: Specify StringComparison for correctness +dotnet_diagnostic.CA1310.severity = none + +# CA1311: Specify a culture or use an invariant version +dotnet_diagnostic.CA1311.severity = none + +# CA1710: Identifiers should have correct suffix +dotnet_diagnostic.CA1710.severity = none + +# CA1725: Parameter names should match base declaration +dotnet_diagnostic.CA1725.severity = none + +# CA1810: Initialize reference type static fields inline +dotnet_diagnostic.CA1810.severity = none + +# CA1815: Override equals and operator equals on value types +dotnet_diagnostic.CA1815.severity = none + +# CA1822: Mark members as static +dotnet_diagnostic.CA1822.severity = none + +# CA2000: Dispose objects before losing scope +dotnet_diagnostic.CA2000.severity = none + +# CA2002: Do not lock on objects with weak identity +dotnet_diagnostic.CA2002.severity = none + +# CA2008: Do not create tasks without passing a TaskScheduler +dotnet_diagnostic.CA2008.severity = none + +# CA2225: Operator overloads have named alternates +dotnet_diagnostic.CA2225.severity = none + +# CA5350: Do Not Use Weak Cryptographic Algorithms +dotnet_diagnostic.CA5350.severity = none + +# CA5392: Use DefaultDllImportSearchPaths attribute for P/Invokes +dotnet_diagnostic.CA5392.severity = none + +# CA5394: Do not use insecure randomness +dotnet_diagnostic.CA5394.severity = none + +# CA5397: Do not use deprecated SslProtocols values +dotnet_diagnostic.CA5397.severity = none diff --git a/csharp/msbuild/CodeAnalysis.Src.globalconfig b/csharp/msbuild/CodeAnalysis.Src.globalconfig new file mode 100644 index 00000000000..8753f0a7085 --- /dev/null +++ b/csharp/msbuild/CodeAnalysis.Src.globalconfig @@ -0,0 +1,7 @@ +is_global = true + +# CA1849: Call async methods when in an async method +dotnet_diagnostic.CA1849.severity = none + +# CA2007: Consider calling ConfigureAwait on the awaited task +dotnet_diagnostic.CA2007.severity = warning diff --git a/csharp/msbuild/CodeAnalysis.Tests.globalconfig b/csharp/msbuild/CodeAnalysis.Tests.globalconfig new file mode 100644 index 00000000000..39038349068 --- /dev/null +++ b/csharp/msbuild/CodeAnalysis.Tests.globalconfig @@ -0,0 +1,34 @@ +is_global = true + +# CA1707: Identifiers should not contain underscores +dotnet_diagnostic.CA1707.severity = none + +# CA1849: Call async methods when in an async method +dotnet_diagnostic.CA1849.severity = none + +# CA2007: Consider calling ConfigureAwait on the awaited task +dotnet_diagnostic.CA2007.severity = none + +# CA5394: Do not use insecure randomness +dotnet_diagnostic.CA5394.severity = none + +# IDE0008: Use explicit type instead of 'var' +dotnet_diagnostic.IDE0008.severity = none + +# SA0001: XML comment analysis is disabled due to project configuration +dotnet_diagnostic.SA0001.severity = none + +# NUnit2005: Consider using Assert.That(actual, Is.EqualTo(expected)) +dotnet_diagnostic.NUnit2005.severity = none + +# NUnit2006: Consider using Assert.That(actual, Is.Not.EqualTo(expected)) +dotnet_diagnostic.NUnit2006.severity = none + +# NUnit2031: Consider using Assert.That(actual, Is.Not.SameAs(expected)) +dotnet_diagnostic.NUnit2031.severity = none + +# NUnit2045: Use Assert.Multiple +dotnet_diagnostic.NUnit2045.severity = none + +# CA1861: Prefer 'static readonly' fields over constant array arguments +dotnet_diagnostic.CA1861.severity = none diff --git a/csharp/msbuild/StyleCop.json b/csharp/msbuild/StyleCop.json new file mode 100644 index 00000000000..8d4868c1108 --- /dev/null +++ b/csharp/msbuild/StyleCop.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + "settings": { + "documentationRules": { + "companyName": "ZeroC", + "copyrightText": "Copyright (c) ZeroC, Inc.", + "xmlHeader": false, + "documentInterfaces": false, + "documentExposedElements": true, + "documentInternalElements": false, + "documentPrivateElements": false, + "documentPrivateFields": false + } + } +} diff --git a/csharp/msbuild/ice.common.props b/csharp/msbuild/ice.common.props index c35da1cf4c3..b6fed74c78b 100644 --- a/csharp/msbuild/ice.common.props +++ b/csharp/msbuild/ice.common.props @@ -10,20 +10,22 @@ Release AnyCPU - false - false - 512 - prompt - 4 - true + true + portable TRACE - true - true + false + true + 12.0 true https://github.com/zeroc-ice/ice - false Major + true + true + 4 + + 1.2.0-beta.556 diff --git a/csharp/src/Directory.Build.props b/csharp/src/Directory.Build.props new file mode 100644 index 00000000000..869434cfaed --- /dev/null +++ b/csharp/src/Directory.Build.props @@ -0,0 +1,14 @@ + + + + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + + All + + + + + + + diff --git a/csharp/src/Glacier2/AssemblyInfo.cs b/csharp/src/Glacier2/AssemblyInfo.cs index a6b37dc097b..19ee6c6d049 100644 --- a/csharp/src/Glacier2/AssemblyInfo.cs +++ b/csharp/src/Glacier2/AssemblyInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; using System.Runtime.InteropServices; diff --git a/csharp/src/Glacier2/SessionCallback.cs b/csharp/src/Glacier2/SessionCallback.cs index 257949d800a..b817237428b 100644 --- a/csharp/src/Glacier2/SessionCallback.cs +++ b/csharp/src/Glacier2/SessionCallback.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; +// Copyright (c) ZeroC, Inc. namespace Glacier2; diff --git a/csharp/src/Glacier2/SessionFactoryHelper.cs b/csharp/src/Glacier2/SessionFactoryHelper.cs index ccf0e96e5ba..85828ad6612 100644 --- a/csharp/src/Glacier2/SessionFactoryHelper.cs +++ b/csharp/src/Glacier2/SessionFactoryHelper.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Text; namespace Glacier2; @@ -365,14 +361,14 @@ private string createProxyStr(Ice.Identity ident) { StringBuilder sb = new StringBuilder(); - sb.Append("\""); + sb.Append('"'); sb.Append(Ice.Util.identityToString(ident, Ice.ToStringMode.Unicode)); sb.Append("\":"); sb.Append(_protocol + " -p "); sb.Append(getPortInternal()); sb.Append(" -h \""); sb.Append(_routerHost); - sb.Append("\""); + sb.Append('"'); if (_timeout > 0) { sb.Append(" -t "); @@ -390,9 +386,9 @@ private void private SessionCallback _callback; private string _routerHost = "localhost"; private Ice.InitializationData _initData; - private Ice.Identity _identity = null; + private Ice.Identity _identity; private string _protocol = "ssl"; - private int _port = 0; + private int _port; private int _timeout = 10000; private Dictionary _context; private bool _useCallbacks = true; diff --git a/csharp/src/Glacier2/SessionHelper.cs b/csharp/src/Glacier2/SessionHelper.cs index b11df844a07..bf7740881cb 100644 --- a/csharp/src/Glacier2/SessionHelper.cs +++ b/csharp/src/Glacier2/SessionHelper.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; namespace Glacier2; @@ -462,12 +457,12 @@ private void private Ice.ObjectAdapter _adapter; private RouterPrx _router; private SessionPrx _session; - private bool _connected = false; + private bool _connected; private string _category; private string _finderStr; private bool _useCallbacks; private readonly SessionCallback _callback; - private bool _destroy = false; - private object _mutex = new object(); + private bool _destroy; + private readonly object _mutex = new object(); } diff --git a/csharp/src/Ice/ACM.cs b/csharp/src/Ice/ACM.cs index 22c75480017..f36f2d194ad 100644 --- a/csharp/src/Ice/ACM.cs +++ b/csharp/src/Ice/ACM.cs @@ -1,12 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; +namespace IceInternal; + public sealed class ACMConfig : System.ICloneable { internal ACMConfig(bool server) diff --git a/csharp/src/Ice/Acceptor.cs b/csharp/src/Ice/Acceptor.cs index 28dcf197d99..d81feac95d8 100644 --- a/csharp/src/Ice/Acceptor.cs +++ b/csharp/src/Ice/Acceptor.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; public interface Acceptor diff --git a/csharp/src/Ice/Arrays.cs b/csharp/src/Ice/Arrays.cs index c22714f50ee..5579e4f908d 100644 --- a/csharp/src/Ice/Arrays.cs +++ b/csharp/src/Ice/Arrays.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Collections; namespace IceUtilInternal diff --git a/csharp/src/Ice/AssemblyInfo.cs b/csharp/src/Ice/AssemblyInfo.cs index e3f2df6a122..76a874d5f55 100644 --- a/csharp/src/Ice/AssemblyInfo.cs +++ b/csharp/src/Ice/AssemblyInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; using System.Runtime.InteropServices; diff --git a/csharp/src/Ice/AssemblyUtil.cs b/csharp/src/Ice/AssemblyUtil.cs index 8d188bfd8e5..806b90863ca 100644 --- a/csharp/src/Ice/AssemblyUtil.cs +++ b/csharp/src/Ice/AssemblyUtil.cs @@ -1,15 +1,11 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; using System.Collections; -using System.Collections.Generic; using System.Reflection; using System.Runtime.InteropServices; +namespace IceInternal; + public sealed class AssemblyUtil { public static readonly bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); @@ -53,7 +49,7 @@ public static Type[] findTypesWithPrefix(string prefix) Type[] types = a.GetTypes(); foreach (Type t in types) { - if (t.AssemblyQualifiedName.IndexOf(prefix, StringComparison.Ordinal) == 0) + if (t.AssemblyQualifiedName.StartsWith(prefix, StringComparison.Ordinal)) { l.AddLast(t); } diff --git a/csharp/src/Ice/AsyncIOThread.cs b/csharp/src/Ice/AsyncIOThread.cs index 19a9c923791..88c4c466af4 100644 --- a/csharp/src/Ice/AsyncIOThread.cs +++ b/csharp/src/Ice/AsyncIOThread.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; + +namespace IceInternal; public class AsyncIOThread { diff --git a/csharp/src/Ice/BZip2.cs b/csharp/src/Ice/BZip2.cs index d9d5f1b7e66..3ed1380f0d9 100644 --- a/csharp/src/Ice/BZip2.cs +++ b/csharp/src/Ice/BZip2.cs @@ -1,13 +1,10 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; using System.Diagnostics; using System.Runtime.InteropServices; +namespace IceInternal; + internal static class SafeNativeMethods { [DllImport("bzip2.dll", EntryPoint = "BZ2_bzlibVersion", ExactSpelling = true)] diff --git a/csharp/src/Ice/BatchRequestInterceptor.cs b/csharp/src/Ice/BatchRequestInterceptor.cs index 193fa0a7297..715119eed4b 100644 --- a/csharp/src/Ice/BatchRequestInterceptor.cs +++ b/csharp/src/Ice/BatchRequestInterceptor.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/BatchRequestQueue.cs b/csharp/src/Ice/BatchRequestQueue.cs index 751095d6e99..667f784e861 100644 --- a/csharp/src/Ice/BatchRequestQueue.cs +++ b/csharp/src/Ice/BatchRequestQueue.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; @@ -129,7 +127,7 @@ public void _batchStream.resize(_batchMarker); _batchStreamInUse = false; _batchStreamCanFlush = false; - System.Threading.Monitor.PulseAll(this); + Monitor.PulseAll(this); } } } @@ -144,7 +142,7 @@ public void _batchStream.swap(os); _batchStream.resize(_batchMarker); _batchStreamInUse = false; - System.Threading.Monitor.PulseAll(this); + Monitor.PulseAll(this); } } } @@ -220,7 +218,7 @@ private void // while (_batchStreamInUse && !(flush && _batchStreamCanFlush)) { - System.Threading.Monitor.Wait(this); + Monitor.Wait(this); } } @@ -246,6 +244,5 @@ internal void enqueueBatchRequest(Ice.ObjectPrx proxy) private BatchRequestI _request; private Ice.LocalException _exception; private readonly int _maxSize; - - private static readonly int _udpOverhead = 20 + 8; + private const int _udpOverhead = 20 + 8; } diff --git a/csharp/src/Ice/Buffer.cs b/csharp/src/Ice/Buffer.cs index b46a7f53a39..d49bfc4942c 100644 --- a/csharp/src/Ice/Buffer.cs +++ b/csharp/src/Ice/Buffer.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; @@ -10,7 +8,7 @@ namespace IceInternal; // This class wraps a ByteBuffer and supports reallocation. public class Buffer { - public Buffer() : this(ByteBuffer.ByteOrder.LITTLE_ENDIAN) + public Buffer() : this(ByteBuffer.ByteOrder.LittleEndian) { } @@ -22,7 +20,7 @@ public Buffer(ByteBuffer.ByteOrder order) _order = order; } - public Buffer(byte[] data) : this(data, ByteBuffer.ByteOrder.LITTLE_ENDIAN) + public Buffer(byte[] data) : this(data, ByteBuffer.ByteOrder.LittleEndian) { } @@ -35,7 +33,7 @@ public Buffer(byte[] data, ByteBuffer.ByteOrder order) _order = order; } - public Buffer(ByteBuffer data) : this(data, ByteBuffer.ByteOrder.LITTLE_ENDIAN) + public Buffer(ByteBuffer data) : this(data, ByteBuffer.ByteOrder.LittleEndian) { } diff --git a/csharp/src/Ice/ByteBuffer.cs b/csharp/src/Ice/ByteBuffer.cs index 25f28febcaa..e9a89d483cf 100644 --- a/csharp/src/Ice/ByteBuffer.cs +++ b/csharp/src/Ice/ByteBuffer.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Runtime.InteropServices; namespace IceInternal; @@ -12,14 +9,14 @@ public class ByteBuffer public ByteBuffer() { - _order = ByteOrder.BIG_ENDIAN; + _order = ByteOrder.BigEndian; } - public enum ByteOrder { BIG_ENDIAN, LITTLE_ENDIAN }; + public enum ByteOrder { BigEndian, LittleEndian }; public static ByteOrder nativeOrder() { - return NO._o; + return NativeOrder._o; } public ByteOrder order() @@ -321,7 +318,7 @@ public short getShort() public short getShort(int pos) { checkUnderflow(pos, 2); - if (NO._o == _order) + if (NativeOrder._o == _order) { _valBytes.b0 = _bytes[pos]; _valBytes.b1 = _bytes[pos + 1]; @@ -338,7 +335,7 @@ public void getShortSeq(short[] seq) { int len = System.Buffer.ByteLength(seq); checkUnderflow(len); - if (NO._o == _order) + if (NativeOrder._o == _order) { System.Buffer.BlockCopy(_bytes, _position, seq, 0, len); } @@ -359,7 +356,7 @@ public ByteBuffer putShort(short val) { checkOverflow(2); _valBytes.shortVal = val; - if (NO._o == _order) + if (NativeOrder._o == _order) { _bytes[_position] = _valBytes.b0; _bytes[_position + 1] = _valBytes.b1; @@ -377,7 +374,7 @@ public ByteBuffer putShortSeq(short[] seq) { int len = System.Buffer.ByteLength(seq); checkOverflow(len); - if (NO._o == _order) + if (NativeOrder._o == _order) { System.Buffer.BlockCopy(seq, 0, _bytes, _position, len); } @@ -398,7 +395,7 @@ public ByteBuffer putShortSeq(short[] seq) public int getInt() { checkUnderflow(4); - if (NO._o == _order) + if (NativeOrder._o == _order) { _valBytes.b0 = _bytes[_position]; _valBytes.b1 = _bytes[_position + 1]; @@ -420,7 +417,7 @@ public void getIntSeq(int[] seq) { int len = System.Buffer.ByteLength(seq); checkUnderflow(len); - if (NO._o == _order) + if (NativeOrder._o == _order) { System.Buffer.BlockCopy(_bytes, _position, seq, 0, len); } @@ -457,7 +454,7 @@ public ByteBuffer putInt(int pos, int val) throwOutOfRange("pos", pos, "position must be less than limit - 4"); } _valBytes.intVal = val; - if (NO._o == _order) + if (NativeOrder._o == _order) { _bytes[pos] = _valBytes.b0; _bytes[pos + 1] = _valBytes.b1; @@ -478,7 +475,7 @@ public ByteBuffer putIntSeq(int[] seq) { int len = System.Buffer.ByteLength(seq); checkOverflow(len); - if (NO._o == _order) + if (NativeOrder._o == _order) { System.Buffer.BlockCopy(seq, 0, _bytes, _position, len); } @@ -508,7 +505,7 @@ public long getLong() public long getLong(int pos) { checkUnderflow(pos, 8); - if (NO._o == _order) + if (NativeOrder._o == _order) { _valBytes.b0 = _bytes[pos]; _valBytes.b1 = _bytes[pos + 1]; @@ -537,7 +534,7 @@ public void getLongSeq(long[] seq) { int len = System.Buffer.ByteLength(seq); checkUnderflow(len); - if (NO._o == _order) + if (NativeOrder._o == _order) { System.Buffer.BlockCopy(_bytes, _position, seq, 0, len); } @@ -564,7 +561,7 @@ public ByteBuffer putLong(long val) { checkOverflow(8); _valBytes.longVal = val; - if (NO._o == _order) + if (NativeOrder._o == _order) { _bytes[_position] = _valBytes.b0; _bytes[_position + 1] = _valBytes.b1; @@ -594,7 +591,7 @@ public ByteBuffer putLongSeq(long[] seq) { int len = System.Buffer.ByteLength(seq); checkOverflow(len); - if (NO._o == _order) + if (NativeOrder._o == _order) { System.Buffer.BlockCopy(seq, 0, _bytes, _position, len); } @@ -621,7 +618,7 @@ public ByteBuffer putLongSeq(long[] seq) public float getFloat() { checkUnderflow(4); - if (NO._o == _order) + if (NativeOrder._o == _order) { _valBytes.b0 = _bytes[_position]; _valBytes.b1 = _bytes[_position + 1]; @@ -643,7 +640,7 @@ public void getFloatSeq(float[] seq) { int len = System.Buffer.ByteLength(seq); checkUnderflow(len); - if (NO._o == _order) + if (NativeOrder._o == _order) { System.Buffer.BlockCopy(_bytes, _position, seq, 0, len); } @@ -666,7 +663,7 @@ public ByteBuffer putFloat(float val) { checkOverflow(4); _valBytes.floatVal = val; - if (NO._o == _order) + if (NativeOrder._o == _order) { _bytes[_position] = _valBytes.b0; _bytes[_position + 1] = _valBytes.b1; @@ -688,7 +685,7 @@ public ByteBuffer putFloatSeq(float[] seq) { int len = System.Buffer.ByteLength(seq); checkOverflow(len); - if (NO._o == _order) + if (NativeOrder._o == _order) { System.Buffer.BlockCopy(seq, 0, _bytes, _position, len); } @@ -711,7 +708,7 @@ public ByteBuffer putFloatSeq(float[] seq) public double getDouble() { checkUnderflow(8); - if (NO._o == _order) + if (NativeOrder._o == _order) { _valBytes.b0 = _bytes[_position]; _valBytes.b1 = _bytes[_position + 1]; @@ -741,7 +738,7 @@ public void getDoubleSeq(double[] seq) { int len = System.Buffer.ByteLength(seq); checkUnderflow(len); - if (NO._o == _order) + if (NativeOrder._o == _order) { System.Buffer.BlockCopy(_bytes, _position, seq, 0, len); } @@ -768,7 +765,7 @@ public ByteBuffer putDouble(double val) { checkOverflow(8); _valBytes.doubleVal = val; - if (NO._o == _order) + if (NativeOrder._o == _order) { _bytes[_position] = _valBytes.b0; _bytes[_position + 1] = _valBytes.b1; @@ -798,7 +795,7 @@ public ByteBuffer putDoubleSeq(double[] seq) { int len = System.Buffer.ByteLength(seq); checkOverflow(len); - if (NO._o == _order) + if (NativeOrder._o == _order) { System.Buffer.BlockCopy(seq, 0, _bytes, _position, len); } @@ -869,15 +866,15 @@ private void checkOverflow(int size) private ValBytes _valBytes; private ByteOrder _order; - private class NO // Native Order + private class NativeOrder // Native Order { - static NO() + static NativeOrder() { - _o = BitConverter.IsLittleEndian ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN; + _o = BitConverter.IsLittleEndian ? ByteOrder.LittleEndian : ByteOrder.BigEndian; } internal static readonly ByteOrder _o; - private NO() + private NativeOrder() { } } diff --git a/csharp/src/Ice/Collections.cs b/csharp/src/Ice/Collections.cs index 392e7d05188..3131b373b9e 100644 --- a/csharp/src/Ice/Collections.cs +++ b/csharp/src/Ice/Collections.cs @@ -1,9 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Collections; -using System.Collections.Generic; using System.Diagnostics; namespace IceUtilInternal; diff --git a/csharp/src/Ice/CollocatedRequestHandler.cs b/csharp/src/Ice/CollocatedRequestHandler.cs index eb0e5f473f5..548aee3355d 100644 --- a/csharp/src/Ice/CollocatedRequestHandler.cs +++ b/csharp/src/Ice/CollocatedRequestHandler.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; namespace IceInternal; public class CollocatedRequestHandler : RequestHandler, ResponseHandler { - private void + private static void fillInValue(Ice.OutputStream os, int pos, int value) { os.rewriteInt(value, pos); diff --git a/csharp/src/Ice/Communicator.cs b/csharp/src/Ice/Communicator.cs index c1f800a32ee..b47b00f9e75 100644 --- a/csharp/src/Ice/Communicator.cs +++ b/csharp/src/Ice/Communicator.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Net.Security; namespace Ice; -public interface Communicator : System.IDisposable +public interface Communicator : IDisposable { /// /// Destroy the communicator. @@ -88,7 +86,7 @@ public interface Communicator : System.IDisposable /// The base property name. /// /// The property set. - System.Collections.Generic.Dictionary proxyToProperty(ObjectPrx proxy, string property); + Dictionary proxyToProperty(ObjectPrx proxy, string property); /// /// Convert an identity into a string. @@ -164,7 +162,7 @@ public interface Communicator : System.IDisposable /// Get the observer resolver object for this communicator. /// /// This communicator's observer resolver object. - Ice.Instrumentation.CommunicatorObserver getObserver(); + Instrumentation.CommunicatorObserver getObserver(); /// /// Get the default router for this communicator. @@ -227,7 +225,10 @@ public interface Communicator : System.IDisposable /// the wire. void flushBatchRequests(CompressBatch compress); - System.Threading.Tasks.Task flushBatchRequestsAsync(CompressBatch compress, System.IProgress progress = null, System.Threading.CancellationToken cancel = new System.Threading.CancellationToken()); + Task flushBatchRequestsAsync( + CompressBatch compress, + IProgress progress = null, + CancellationToken cancel = default); /// /// Add the Admin object with all its facets to the provided object adapter. diff --git a/csharp/src/Ice/CommunicatorI.cs b/csharp/src/Ice/CommunicatorI.cs index 46fab6b39a1..a49071d7f43 100644 --- a/csharp/src/Ice/CommunicatorI.cs +++ b/csharp/src/Ice/CommunicatorI.cs @@ -1,13 +1,7 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using IceInternal; -using System; -using System.Collections.Generic; using System.Net.Security; -using System.Threading; -using System.Threading.Tasks; namespace Ice; diff --git a/csharp/src/Ice/Compare.cs b/csharp/src/Ice/Compare.cs index a0f916e1786..155afcf6018 100644 --- a/csharp/src/Ice/Compare.cs +++ b/csharp/src/Ice/Compare.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/ConnectRequestHandler.cs b/csharp/src/Ice/ConnectRequestHandler.cs index 9ed5a23756a..198b5a4bb15 100644 --- a/csharp/src/Ice/ConnectRequestHandler.cs +++ b/csharp/src/Ice/ConnectRequestHandler.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; namespace IceInternal; @@ -311,7 +307,7 @@ private void flushRequests() private bool _response; private Ice.ObjectPrxHelperBase _proxy; - private HashSet _proxies = new HashSet(); + private HashSet _proxies = new(); private Ice.ConnectionI _connection; private bool _compress; diff --git a/csharp/src/Ice/Connection.cs b/csharp/src/Ice/Connection.cs index a7f105ea6cb..f6f38522174 100644 --- a/csharp/src/Ice/Connection.cs +++ b/csharp/src/Ice/Connection.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/src/Ice/ConnectionFactory.cs b/csharp/src/Ice/ConnectionFactory.cs index ff5c5c397eb..cb758c0701c 100644 --- a/csharp/src/Ice/ConnectionFactory.cs +++ b/csharp/src/Ice/ConnectionFactory.cs @@ -1,14 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Text; +namespace IceInternal; public class MultiDictionary : Dictionary> { public void @@ -545,7 +540,7 @@ private Ice.ConnectionI createConnection(Transceiver transceiver, ConnectorInfo throw new Ice.CommunicatorDestroyedException(); } - connection = new Ice.ConnectionI(_communicator, _instance, _monitor, transceiver, ci.connector, + connection = new Ice.ConnectionI(_instance, _monitor, transceiver, ci.connector, ci.endpoint.compress(false), null); } catch (Ice.LocalException) @@ -693,7 +688,7 @@ private void handleConnectionException(Ice.LocalException ex, bool hasMore) s.Append("connection to endpoint failed"); if (ex is Ice.CommunicatorDestroyedException) { - s.Append("\n"); + s.Append('\n'); } else { @@ -720,8 +715,7 @@ private bool bool found = false; foreach (ConnectorInfo ci in connectors) { - HashSet cbs = null; - if (_pending.TryGetValue(ci.connector, out cbs)) + if (_pending.TryGetValue(ci.connector, out HashSet cbs)) { found = true; if (cb != null) @@ -773,7 +767,7 @@ internal void handleException(Ice.LocalException ex, bool hasMore) s.Append("couldn't resolve endpoint host"); if (ex is Ice.CommunicatorDestroyedException) { - s.Append("\n"); + s.Append('\n'); } else { @@ -1042,7 +1036,7 @@ internal void nextConnector() s.Append(_current.endpoint.protocol()); s.Append(" connection to "); s.Append(_current.connector.ToString()); - s.Append("\n"); + s.Append('\n'); s.Append(ex); _factory._instance.initializationData().logger.trace( _factory._instance.traceLevels().networkCat, s.ToString()); @@ -1098,12 +1092,9 @@ private bool connectionStartFailedImpl(Ice.LocalException ex) private FactoryACMMonitor _monitor; private bool _destroyed; - private MultiDictionary _connections = - new MultiDictionary(); - private MultiDictionary _connectionsByEndpoint = - new MultiDictionary(); - private Dictionary> _pending = - new Dictionary>(); + private MultiDictionary _connections = new(); + private MultiDictionary _connectionsByEndpoint = new(); + private Dictionary> _pending = new(); private int _pendingConnectCount; } @@ -1469,8 +1460,7 @@ public override void message(ref ThreadPoolCurrent current) try { - connection = new Ice.ConnectionI(_adapter.getCommunicator(), _instance, _monitor, transceiver, - null, _endpoint, _adapter); + connection = new Ice.ConnectionI(_instance, _monitor, transceiver, null, _endpoint, _adapter); } catch (Ice.LocalException ex) { @@ -1602,8 +1592,7 @@ public IncomingConnectionFactory(Instance instance, EndpointI endpoint, Endpoint } _endpoint = _transceiver.bind(); - Ice.ConnectionI connection = new Ice.ConnectionI(_adapter.getCommunicator(), _instance, null, - _transceiver, null, _endpoint, _adapter); + Ice.ConnectionI connection = new Ice.ConnectionI(_instance, null, _transceiver, null, _endpoint, _adapter); connection.startAndWait(); _connections.Add(connection); } diff --git a/csharp/src/Ice/ConnectionI.cs b/csharp/src/Ice/ConnectionI.cs index e3f9d167413..841dc7ea1ac 100644 --- a/csharp/src/Ice/ConnectionI.cs +++ b/csharp/src/Ice/ConnectionI.cs @@ -1,18 +1,11 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace Ice; +// Copyright (c) ZeroC, Inc. +using Ice.Instrumentation; using IceInternal; -using Instrumentation; -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Text; -using System.Threading; -using System.Threading.Tasks; + +namespace Ice; public sealed class ConnectionI : IceInternal.EventHandler, ResponseHandler, CancellationHandler, Connection { @@ -977,7 +970,7 @@ public override bool finishAsync(int operation) } s.Append(" bytes via "); s.Append(_endpoint.protocol()); - s.Append("\n"); + s.Append('\n'); s.Append(ToString()); _instance.initializationData().logger.trace(_instance.traceLevels().networkCat, s.ToString()); } @@ -1007,7 +1000,7 @@ public override bool finishAsync(int operation) } s.Append(" bytes via "); s.Append(_endpoint.protocol()); - s.Append("\n"); + s.Append('\n'); s.Append(ToString()); _instance.initializationData().logger.trace(_instance.traceLevels().networkCat, s.ToString()); } @@ -1452,11 +1445,11 @@ private void finish() { StringBuilder s = new StringBuilder("failed to "); s.Append(_connector != null ? "establish" : "accept"); - s.Append(" "); + s.Append(' '); s.Append(_endpoint.protocol()); s.Append(" connection\n"); s.Append(ToString()); - s.Append("\n"); + s.Append('\n'); s.Append(_exception); _instance.initializationData().logger.trace(_instance.traceLevels().networkCat, s.ToString()); } @@ -1479,7 +1472,7 @@ _exception is ConnectionTimeoutException || _exception is CommunicatorDestroyedException || _exception is ObjectAdapterDeactivatedException)) { - s.Append("\n"); + s.Append('\n'); s.Append(_exception); } @@ -1665,13 +1658,12 @@ public IceInternal.ThreadPool getThreadPool() static ConnectionI() { - _compressionSupported = IceInternal.BZip2.supported(); + _compressionSupported = BZip2.supported(); } - internal ConnectionI(Communicator communicator, Instance instance, ACMMonitor monitor, Transceiver transceiver, + internal ConnectionI(Instance instance, ACMMonitor monitor, Transceiver transceiver, Connector connector, EndpointI endpoint, ObjectAdapterI adapter) { - _communicator = communicator; _instance = instance; _monitor = monitor; _transceiver = transceiver; @@ -1911,7 +1903,6 @@ private void setState(int state) { Debug.Assert(_state == StateClosed); _transceiver.destroy(); - _communicator = null; break; } } @@ -2196,7 +2187,7 @@ private bool validate(int operation) { s.Append("starting to "); s.Append(_connector != null ? "send" : "receive"); - s.Append(" "); + s.Append(' '); s.Append(_endpoint.protocol()); s.Append(" messages\n"); s.Append(_transceiver.toDetailedString()); @@ -2204,7 +2195,7 @@ private bool validate(int operation) else { s.Append(_connector != null ? "established" : "accepted"); - s.Append(" "); + s.Append(' '); s.Append(_endpoint.protocol()); s.Append(" connection\n"); s.Append(ToString()); @@ -2797,7 +2788,7 @@ private void reap() } } - private ConnectionState toConnectionState(int state) + private static ConnectionState toConnectionState(int state) { return connectionStateMap[state]; } @@ -2911,7 +2902,7 @@ private int read(IceInternal.Buffer buf) } s.Append(" bytes via "); s.Append(_endpoint.protocol()); - s.Append("\n"); + s.Append('\n'); s.Append(ToString()); _instance.initializationData().logger.trace(_instance.traceLevels().networkCat, s.ToString()); } @@ -2933,7 +2924,7 @@ private int write(IceInternal.Buffer buf) } s.Append(" bytes via "); s.Append(_endpoint.protocol()); - s.Append("\n"); + s.Append('\n'); s.Append(ToString()); _instance.initializationData().logger.trace(_instance.traceLevels().networkCat, s.ToString()); } @@ -3008,7 +2999,6 @@ internal void completed(LocalException ex) internal bool receivedReply; } - private Communicator _communicator; private Instance _instance; private ACMMonitor _monitor; private Transceiver _transceiver; @@ -3030,7 +3020,7 @@ internal void completed(LocalException ex) private TimerTask _readTimeout; private bool _readTimeoutScheduled; - private StartCallback _startCallback = null; + private StartCallback _startCallback; private bool _warn; private bool _warnUdp; @@ -3061,12 +3051,12 @@ internal void completed(LocalException ex) private int _dispatchCount; private int _state; // The current state. - private bool _shutdownInitiated = false; - private bool _initialized = false; - private bool _validated = false; + private bool _shutdownInitiated; + private bool _initialized; + private bool _validated; private Incoming _incomingCache; - private object _incomingCacheMutex = new object(); + private readonly object _incomingCacheMutex = new object(); private static bool _compressionSupported; @@ -3077,7 +3067,7 @@ internal void completed(LocalException ex) private CloseCallback _closeCallback; private HeartbeatCallback _heartbeatCallback; - private static ConnectionState[] connectionStateMap = new ConnectionState[] { + private static ConnectionState[] connectionStateMap = [ ConnectionState.ConnectionStateValidating, // StateNotInitialized ConnectionState.ConnectionStateValidating, // StateNotValidated ConnectionState.ConnectionStateActive, // StateActive @@ -3086,5 +3076,5 @@ internal void completed(LocalException ex) ConnectionState.ConnectionStateClosing, // StateClosingPending ConnectionState.ConnectionStateClosed, // StateClosed ConnectionState.ConnectionStateClosed, // StateFinished - }; + ]; } diff --git a/csharp/src/Ice/ConnectionRequestHandler.cs b/csharp/src/Ice/ConnectionRequestHandler.cs index da034aa826d..0c0dc724f9a 100644 --- a/csharp/src/Ice/ConnectionRequestHandler.cs +++ b/csharp/src/Ice/ConnectionRequestHandler.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/Connector.cs b/csharp/src/Ice/Connector.cs index 6e25634a620..3483166f37d 100644 --- a/csharp/src/Ice/Connector.cs +++ b/csharp/src/Ice/Connector.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/Current.cs b/csharp/src/Ice/Current.cs index 3656ef00daa..6028ade6811 100644 --- a/csharp/src/Ice/Current.cs +++ b/csharp/src/Ice/Current.cs @@ -1,10 +1,8 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; -public class Current : System.ICloneable +public class Current : ICloneable { public ObjectAdapter adapter; public Connection con; @@ -12,7 +10,7 @@ public class Current : System.ICloneable public string facet; public string operation; public OperationMode mode; - public System.Collections.Generic.Dictionary ctx; + public Dictionary ctx; public int requestId; public EncodingVersion encoding; @@ -31,7 +29,7 @@ public Current( string facet, string operation, OperationMode mode, - System.Collections.Generic.Dictionary ctx, + Dictionary ctx, int requestId, EncodingVersion encoding) { diff --git a/csharp/src/Ice/DefaultsAndOverrides.cs b/csharp/src/Ice/DefaultsAndOverrides.cs index 4c888616d25..5d4bc758595 100644 --- a/csharp/src/Ice/DefaultsAndOverrides.cs +++ b/csharp/src/Ice/DefaultsAndOverrides.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Net; using System.Text; diff --git a/csharp/src/Ice/DispatchInterceptor.cs b/csharp/src/Ice/DispatchInterceptor.cs index e7cc73756ab..473f2a1b516 100644 --- a/csharp/src/Ice/DispatchInterceptor.cs +++ b/csharp/src/Ice/DispatchInterceptor.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/Endpoint.cs b/csharp/src/Ice/Endpoint.cs index 01acee7a9cf..038848dffd8 100644 --- a/csharp/src/Ice/Endpoint.cs +++ b/csharp/src/Ice/Endpoint.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/EndpointFactory.cs b/csharp/src/Ice/EndpointFactory.cs index 28e211a442b..99aee39ea04 100644 --- a/csharp/src/Ice/EndpointFactory.cs +++ b/csharp/src/Ice/EndpointFactory.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/EndpointFactoryManager.cs b/csharp/src/Ice/EndpointFactoryManager.cs index d9c2da82216..26649a38d0c 100644 --- a/csharp/src/Ice/EndpointFactoryManager.cs +++ b/csharp/src/Ice/EndpointFactoryManager.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; +namespace IceInternal; public sealed class EndpointFactoryManager { internal EndpointFactoryManager(Instance instance) diff --git a/csharp/src/Ice/EndpointHostResolver.cs b/csharp/src/Ice/EndpointHostResolver.cs index f2cdefbfabf..a1531245e24 100644 --- a/csharp/src/Ice/EndpointHostResolver.cs +++ b/csharp/src/Ice/EndpointHostResolver.cs @@ -1,14 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; using System.Net; -using System.Threading; +namespace IceInternal; public class EndpointHostResolver { internal EndpointHostResolver(Instance instance) diff --git a/csharp/src/Ice/EndpointI.cs b/csharp/src/Ice/EndpointI.cs index 5f8a4846fcd..11d043bddd7 100644 --- a/csharp/src/Ice/EndpointI.cs +++ b/csharp/src/Ice/EndpointI.cs @@ -1,14 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Net.Security; +namespace IceInternal; public interface EndpointI_connectors { void connectors(List connectors); diff --git a/csharp/src/Ice/EndpointSelectionType.cs b/csharp/src/Ice/EndpointSelectionType.cs index 595df046b7b..5a093fb7d47 100644 --- a/csharp/src/Ice/EndpointSelectionType.cs +++ b/csharp/src/Ice/EndpointSelectionType.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/EventHandler.cs b/csharp/src/Ice/EventHandler.cs index 8e1a99cc0c9..40c0823f872 100644 --- a/csharp/src/Ice/EventHandler.cs +++ b/csharp/src/Ice/EventHandler.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; @@ -23,11 +21,11 @@ public abstract class EventHandler // abstract public void finished(ref ThreadPoolCurrent op); - internal int _ready = 0; - internal int _pending = 0; - internal int _started = 0; - internal bool _finish = false; + internal int _ready; + internal int _pending; + internal int _started; + internal bool _finish; - internal bool _hasMoreData = false; - internal int _registered = 0; + internal bool _hasMoreData; + internal int _registered; } diff --git a/csharp/src/Ice/Exception.cs b/csharp/src/Ice/Exception.cs index 890ebe90f9c..51299b94a30 100644 --- a/csharp/src/Ice/Exception.cs +++ b/csharp/src/Ice/Exception.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Diagnostics; using System.Globalization; diff --git a/csharp/src/Ice/FormatType.cs b/csharp/src/Ice/FormatType.cs index 4896bb156a8..6712c7e6d4d 100644 --- a/csharp/src/Ice/FormatType.cs +++ b/csharp/src/Ice/FormatType.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/src/Ice/HttpParser.cs b/csharp/src/Ice/HttpParser.cs index 3d48d4304f5..ea9ba11ec8f 100644 --- a/csharp/src/Ice/HttpParser.cs +++ b/csharp/src/Ice/HttpParser.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; using System.Text; -internal sealed class WebSocketException : System.Exception +namespace IceInternal; + +internal sealed class WebSocketException : Exception { internal WebSocketException() : base("", null) diff --git a/csharp/src/Ice/IPEndpointI.cs b/csharp/src/Ice/IPEndpointI.cs index 0f1398ed05f..6ce8336048b 100644 --- a/csharp/src/Ice/IPEndpointI.cs +++ b/csharp/src/Ice/IPEndpointI.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; -using System.Collections.Generic; using System.Globalization; using System.Net; +namespace IceInternal; + public abstract class IPEndpointI : EndpointI { public IPEndpointI(ProtocolInstance instance, string host, int port, EndPoint sourceAddr, string connectionId) @@ -207,7 +203,7 @@ public override string options() if (host_ != null && host_.Length > 0) { s += " -h "; - bool addQuote = host_.IndexOf(':') != -1; + bool addQuote = host_.Contains(':'); if (addQuote) { s += "\""; @@ -224,7 +220,7 @@ public override string options() if (sourceAddr_ != null) { string sourceAddr = Network.endpointAddressToString(sourceAddr_); - bool addQuote = sourceAddr.IndexOf(':') != -1; + bool addQuote = sourceAddr.Contains(':'); s += " --sourceAddress "; if (addQuote) { diff --git a/csharp/src/Ice/IceSSL/AcceptorI.cs b/csharp/src/Ice/IceSSL/AcceptorI.cs index 4feb10f47d2..603eddf58da 100644 --- a/csharp/src/Ice/IceSSL/AcceptorI.cs +++ b/csharp/src/Ice/IceSSL/AcceptorI.cs @@ -1,11 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceSSL; +// Copyright (c) ZeroC, Inc. using System.Net.Security; +namespace IceSSL; + internal class AcceptorI : IceInternal.Acceptor { public void close() diff --git a/csharp/src/Ice/IceSSL/ConnectionInfo.cs b/csharp/src/Ice/IceSSL/ConnectionInfo.cs index 92c1ce99e80..5aec70b3f8f 100644 --- a/csharp/src/Ice/IceSSL/ConnectionInfo.cs +++ b/csharp/src/Ice/IceSSL/ConnectionInfo.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Security.Cryptography.X509Certificates; diff --git a/csharp/src/Ice/IceSSL/ConnectorI.cs b/csharp/src/Ice/IceSSL/ConnectorI.cs index 0161f4714f2..21753c6ba80 100644 --- a/csharp/src/Ice/IceSSL/ConnectorI.cs +++ b/csharp/src/Ice/IceSSL/ConnectorI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceSSL; diff --git a/csharp/src/Ice/IceSSL/EndpointI.cs b/csharp/src/Ice/IceSSL/EndpointI.cs index 07d0925a25d..c445dc7579d 100644 --- a/csharp/src/Ice/IceSSL/EndpointI.cs +++ b/csharp/src/Ice/IceSSL/EndpointI.cs @@ -1,12 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceSSL; - -using System.Collections.Generic; using System.Net.Security; +namespace IceSSL; + internal sealed class EndpointI : IceInternal.EndpointI { internal EndpointI(Instance instance, IceInternal.EndpointI del) diff --git a/csharp/src/Ice/IceSSL/EndpointInfo.cs b/csharp/src/Ice/IceSSL/EndpointInfo.cs index e7beddcf39e..b798bdd4c18 100644 --- a/csharp/src/Ice/IceSSL/EndpointInfo.cs +++ b/csharp/src/Ice/IceSSL/EndpointInfo.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceSSL; diff --git a/csharp/src/Ice/IceSSL/Instance.cs b/csharp/src/Ice/IceSSL/Instance.cs index 47ca03e9565..d1db7570974 100644 --- a/csharp/src/Ice/IceSSL/Instance.cs +++ b/csharp/src/Ice/IceSSL/Instance.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceSSL; +// Copyright (c) ZeroC, Inc. using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; +namespace IceSSL; + internal class Instance : IceInternal.ProtocolInstance { internal Instance(SSLEngine engine, short type, string protocol) : diff --git a/csharp/src/Ice/IceSSL/RFC2253.cs b/csharp/src/Ice/IceSSL/RFC2253.cs index 1ad1a79e64a..e4a445a0e75 100644 --- a/csharp/src/Ice/IceSSL/RFC2253.cs +++ b/csharp/src/Ice/IceSSL/RFC2253.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. + +using System.Diagnostics; +using System.Text; // // See RFC 2253 and RFC 1779. // namespace IceSSL; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; - internal class RFC2253 { internal class ParseException : Exception @@ -42,13 +38,13 @@ internal struct RDNPair internal class RDNEntry { - internal List rdn = new List(); - internal bool negate = false; + internal List rdn = new(); + internal bool negate; } internal static List parse(string data) { - List results = new List(); + List results = new(); RDNEntry current = new RDNEntry(); int pos = 0; while (pos < data.Length) @@ -77,7 +73,7 @@ internal static List parse(string data) } else if (pos < data.Length) { - throw new ParseException("expected ',' or ';' at `" + data.Substring(pos) + "'"); + throw new ParseException($"expected ',' or ';' at `{data[pos..]}'"); } } if (current.rdn.Count > 0) @@ -102,7 +98,7 @@ internal static List parseStrict(string data) } else if (pos < data.Length) { - throw new ParseException("expected ',' or ';' at `" + data.Substring(pos) + "'"); + throw new ParseException($"expected ',' or ';' at `{data[pos..]}'"); } } return results; @@ -157,7 +153,7 @@ public static string unescape(string data) { throw new ParseException("unescape: invalid escape sequence"); } - if (special.IndexOf(data[pos]) != -1 || data[pos] != '\\' || data[pos] != '"') + if (special.Contains(data[pos]) || data[pos] != '\\' || data[pos] != '"') { result.Append(data[pos]); ++pos; @@ -234,8 +230,7 @@ private static RDNPair parseAttributeTypeAndValue(string data, ref int pos) } if (data[pos] != '=') { - throw new ParseException("invalid attribute type/value pair (missing =). remainder: " + - data.Substring(pos)); + throw new ParseException($"invalid attribute type/value pair (missing =). remainder: {data[pos..]}"); } ++pos; p.value = parseAttributeValue(data, ref pos); @@ -407,7 +402,7 @@ private static string parseAttributeValue(string data, ref int pos) { result.Append(parsePair(data, ref pos)); } - else if (special.IndexOf(data[pos]) == -1 && data[pos] != '"') + else if (!special.Contains(data[pos]) && data[pos] != '"') { result.Append(data[pos]); ++pos; @@ -438,7 +433,7 @@ private static string parsePair(string data, ref int pos) throw new ParseException("invalid escape format (unexpected end of data)"); } - if (special.IndexOf(data[pos]) != -1 || data[pos] != '\\' || + if (special.Contains(data[pos]) || data[pos] != '\\' || data[pos] != '"') { result += data[pos]; @@ -455,12 +450,12 @@ private static string parsePair(string data, ref int pos) private static string parseHexPair(string data, ref int pos, bool allowEmpty) { string result = ""; - if (pos < data.Length && hexvalid.IndexOf(data[pos]) != -1) + if (pos < data.Length && hexvalid.Contains(data[pos])) { result += data[pos]; ++pos; } - if (pos < data.Length && hexvalid.IndexOf(data[pos]) != -1) + if (pos < data.Length && hexvalid.Contains(data[pos])) { result += data[pos]; ++pos; diff --git a/csharp/src/Ice/IceSSL/SSLEngine.cs b/csharp/src/Ice/IceSSL/SSLEngine.cs index f0769b85704..6ee4cbc1513 100644 --- a/csharp/src/Ice/IceSSL/SSLEngine.cs +++ b/csharp/src/Ice/IceSSL/SSLEngine.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceSSL; - -using System; using System.Diagnostics; -using System.IO; using System.Security; using System.Security.Authentication; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; +namespace IceSSL; + internal class SSLEngine { internal SSLEngine(Ice.Communicator communicator) @@ -289,7 +285,7 @@ internal void traceStream(System.Net.Security.SslStream stream, string connInfo) s.Append("SSL connection summary"); if (connInfo.Length > 0) { - s.Append("\n"); + s.Append('\n'); s.Append(connInfo); } s.Append("\nauthenticated = " + (stream.IsAuthenticated ? "yes" : "no")); @@ -382,7 +378,7 @@ private bool checkPath(ref string path) return false; } - private SslProtocols parseProtocols(string[] arr) + private static SslProtocols parseProtocols(string[] arr) { #pragma warning disable CS0618 // Type or member is obsolete SslProtocols result = SslProtocols.Default; diff --git a/csharp/src/Ice/IceSSL/TransceiverI.cs b/csharp/src/Ice/IceSSL/TransceiverI.cs index b7b28a5987f..fced07aec18 100644 --- a/csharp/src/Ice/IceSSL/TransceiverI.cs +++ b/csharp/src/Ice/IceSSL/TransceiverI.cs @@ -1,17 +1,12 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceSSL; - -using System; using System.Diagnostics; -using System.IO; using System.Net.Security; using System.Net.Sockets; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; -using System.Threading.Tasks; + +namespace IceSSL; internal sealed class TransceiverI : IceInternal.Transceiver { @@ -592,7 +587,7 @@ private X509Certificate selectCertificate(object sender, string targetHost, X509 private bool validationCallback(object sender, X509Certificate certificate, X509Chain chainEngine, SslPolicyErrors policyErrors) { - X509Chain chain = new X509Chain(_instance.engine().useMachineContext()); + using X509Chain chain = new X509Chain(_instance.engine().useMachineContext()); try { if (_instance.checkCRL() == 0) diff --git a/csharp/src/Ice/IceSSL/TrustManager.cs b/csharp/src/Ice/IceSSL/TrustManager.cs index 0355c7a7c19..5531908878e 100644 --- a/csharp/src/Ice/IceSSL/TrustManager.cs +++ b/csharp/src/Ice/IceSSL/TrustManager.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceSSL; - -using System.Collections.Generic; using System.Diagnostics; using System.Security.Cryptography.X509Certificates; using System.Text; +namespace IceSSL; + internal sealed class TrustManager { internal TrustManager(Ice.Communicator communicator) @@ -244,7 +241,7 @@ private bool matchRDNs(List match, List subjec } // Note that unlike the C++ & Java implementation this returns unescaped data. - private void parse(string value, List> reject, List> accept) + private static void parse(string value, List> reject, List> accept) { // // As with the Java implementation, the DN that comes from diff --git a/csharp/src/Ice/ImplicitContext.cs b/csharp/src/Ice/ImplicitContext.cs index ec3d5c0a189..8228dd75e85 100644 --- a/csharp/src/Ice/ImplicitContext.cs +++ b/csharp/src/Ice/ImplicitContext.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; @@ -10,13 +8,13 @@ public interface ImplicitContext /// Get a copy of the underlying context. /// /// A copy of the underlying context. - System.Collections.Generic.Dictionary getContext(); + Dictionary getContext(); /// /// Set the underlying context. /// /// The new context. - void setContext(System.Collections.Generic.Dictionary newContext); + void setContext(Dictionary newContext); /// /// Check if this key has an associated value in the underlying context. diff --git a/csharp/src/Ice/ImplicitContextI.cs b/csharp/src/Ice/ImplicitContextI.cs index 79df7796f30..50284aab861 100644 --- a/csharp/src/Ice/ImplicitContextI.cs +++ b/csharp/src/Ice/ImplicitContextI.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; -using System.Collections.Generic; -using System.Threading; - // The base class for all ImplicitContext implementations public abstract class ImplicitContextI : ImplicitContext { @@ -197,9 +192,9 @@ public override Dictionary getContext() Thread currentThread = Thread.CurrentThread; lock (this) { - if (_map.ContainsKey(currentThread)) + if (_map.TryGetValue(currentThread, out Dictionary value)) { - threadContext = _map[currentThread]; + threadContext = value; } } diff --git a/csharp/src/Ice/Incoming.cs b/csharp/src/Ice/Incoming.cs index 9bb489c72b1..83d968514e1 100644 --- a/csharp/src/Ice/Incoming.cs +++ b/csharp/src/Ice/Incoming.cs @@ -1,6 +1,8 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. + +using System.Diagnostics; +using System.Globalization; +using System.Runtime.ExceptionServices; namespace Ice { @@ -13,14 +15,6 @@ public interface MarshaledResult namespace IceInternal { - using System; - using System.Collections.Generic; - using System.Diagnostics; - using System.Globalization; - using System.IO; - using System.Runtime.ExceptionServices; - using System.Threading.Tasks; - public class Incoming : Ice.Request { public Incoming(Instance instance, ResponseHandler handler, Ice.ConnectionI connection, diff --git a/csharp/src/Ice/InputStream.cs b/csharp/src/Ice/InputStream.cs index 67a1a81efd8..e4a37f7bc8d 100644 --- a/csharp/src/Ice/InputStream.cs +++ b/csharp/src/Ice/InputStream.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace Ice; - -using System; -using System.Collections.Generic; using System.Diagnostics; using Protocol = IceInternal.Protocol; +namespace Ice; + /// /// Throws a UserException corresponding to the given Slice type Id, such as "::Module::MyException". /// If the implementation does not throw an exception, the Ice run time will fall back diff --git a/csharp/src/Ice/Instance.cs b/csharp/src/Ice/Instance.cs index e7e32f9ffea..5659d92d135 100644 --- a/csharp/src/Ice/Instance.cs +++ b/csharp/src/Ice/Instance.cs @@ -1,14 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Text; -using System.Threading; + +namespace IceInternal; public sealed class BufSizeWarnInfo { @@ -1409,7 +1404,7 @@ public BufSizeWarnInfo getBufSizeWarn(short type) lock (_setBufSizeWarn) { BufSizeWarnInfo info; - if (!_setBufSizeWarn.ContainsKey(type)) + if (!_setBufSizeWarn.TryGetValue(type, out BufSizeWarnInfo value)) { info = new BufSizeWarnInfo(); info.sndWarn = false; @@ -1621,14 +1616,14 @@ private NetworkProxy createNetworkProxy(Ice.Properties props, int protocolSuppor private RetryQueue _retryQueue; private EndpointFactoryManager _endpointFactoryManager; private Ice.PluginManager _pluginManager; - private bool _adminEnabled = false; + private bool _adminEnabled; private Ice.ObjectAdapter _adminAdapter; - private Dictionary _adminFacets = new Dictionary(); - private HashSet _adminFacetFilter = new HashSet(); + private Dictionary _adminFacets = new(); + private HashSet _adminFacetFilter = new(); private Ice.Identity _adminIdentity; - private Dictionary _setBufSizeWarn = new Dictionary(); + private Dictionary _setBufSizeWarn = new(); private IceSSL.SSLEngine _sslEngine; - private static bool _printProcessIdDone = false; - private static bool _oneOffDone = false; - private static object _staticLock = new object(); + private static bool _printProcessIdDone; + private static bool _oneOffDone; + private static readonly object _staticLock = new object(); } diff --git a/csharp/src/Ice/Instrumentation.cs b/csharp/src/Ice/Instrumentation.cs index cfe9b24a5bb..bf53ee0a776 100644 --- a/csharp/src/Ice/Instrumentation.cs +++ b/csharp/src/Ice/Instrumentation.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice.Instrumentation; diff --git a/csharp/src/Ice/InstrumentationI.cs b/csharp/src/Ice/InstrumentationI.cs index d586756124a..707b9d02e0e 100644 --- a/csharp/src/Ice/InstrumentationI.cs +++ b/csharp/src/Ice/InstrumentationI.cs @@ -1,15 +1,11 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceInternal; +// Copyright (c) ZeroC, Inc. using IceMX; -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Text; +namespace IceInternal; + public class ObserverWithDelegate : Observer where T : Metrics, new() where O : Ice.Instrumentation.Observer @@ -195,7 +191,7 @@ public string getId() } if (_connectionInfo.connectionId.Length > 0) { - os.Append(" [").Append(_connectionInfo.connectionId).Append("]"); + os.Append(" [").Append(_connectionInfo.connectionId).Append(']'); } _id = os.ToString(); } @@ -547,7 +543,7 @@ public string getOperation() readonly private Dictionary _context; private string _id; - readonly static private Ice.Endpoint[] emptyEndpoints = new Ice.Endpoint[0]; + readonly static private Ice.Endpoint[] emptyEndpoints = []; } internal class ThreadHelper : MetricsHelper diff --git a/csharp/src/Ice/LocalException.cs b/csharp/src/Ice/LocalException.cs index 761be280330..db84f33727f 100644 --- a/csharp/src/Ice/LocalException.cs +++ b/csharp/src/Ice/LocalException.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/LocatorInfo.cs b/csharp/src/Ice/LocatorInfo.cs index dc586914a71..c70fc88fae9 100644 --- a/csharp/src/Ice/LocatorInfo.cs +++ b/csharp/src/Ice/LocatorInfo.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; namespace IceInternal; @@ -61,7 +56,7 @@ public void } if (_callback != null) { - _callback.setEndpoints(endpoints == null ? new EndpointI[0] : endpoints, false); + _callback.setEndpoints(endpoints == null ? [] : endpoints, false); } } @@ -431,7 +426,7 @@ private void trace(string msg, Reference r, EndpointI[] endpoints) s.Append(endpoints[i].ToString()); if (i + 1 < sz) { - s.Append(":"); + s.Append(':'); } } @@ -444,10 +439,10 @@ private void trace(string msg, Reference r, Reference resolved) System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append(msg); - s.Append("\n"); + s.Append('\n'); s.Append("well-known proxy = "); s.Append(r.ToString()); - s.Append("\n"); + s.Append('\n'); s.Append("adapter = "); s.Append(resolved.getAdapterId()); diff --git a/csharp/src/Ice/Logger.cs b/csharp/src/Ice/Logger.cs index 7ea2803a197..f2995087857 100644 --- a/csharp/src/Ice/Logger.cs +++ b/csharp/src/Ice/Logger.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/LoggerAdminI.cs b/csharp/src/Ice/LoggerAdminI.cs index 1d4ce4d5c61..95861f05b50 100644 --- a/csharp/src/Ice/LoggerAdminI.cs +++ b/csharp/src/Ice/LoggerAdminI.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; namespace IceInternal; @@ -87,7 +83,7 @@ public override void + "' completed successfully"); } } - catch (System.AggregateException ae) + catch (AggregateException ae) { Debug.Assert(ae.InnerException is Ice.LocalException); deadRemoteLogger(remoteLogger, _logger, (Ice.LocalException)ae.InnerException, "init"); @@ -426,14 +422,14 @@ private static Ice.Communicator createSendLogCommunicator(Ice.Communicator commu } private readonly LinkedList _queue = new LinkedList(); - private int _logCount = 0; // non-trace messages + private int _logCount; // non-trace messages private readonly int _maxLogCount; - private int _traceCount = 0; + private int _traceCount; private readonly int _maxTraceCount; private readonly int _traceLevel; - private LinkedListNode _oldestTrace = null; - private LinkedListNode _oldestLog = null; + private LinkedListNode _oldestTrace; + private LinkedListNode _oldestLog; private class Filters { @@ -459,12 +455,10 @@ internal RemoteLoggerData(Ice.RemoteLoggerPrx prx, Filters f) internal readonly Filters filters; } - private readonly Dictionary _remoteLoggerMap - = new Dictionary(); - + private readonly Dictionary _remoteLoggerMap = new(); private readonly LoggerAdminLoggerI _logger; - private Ice.Communicator _sendLogCommunicator = null; - private bool _destroyed = false; - static private readonly string _traceCategory = "Admin.Logger"; + private Ice.Communicator _sendLogCommunicator; + private bool _destroyed; + private const string _traceCategory = "Admin.Logger"; } diff --git a/csharp/src/Ice/LoggerAdminLoggerI.cs b/csharp/src/Ice/LoggerAdminLoggerI.cs index 45a3d685ed7..2d412a639cf 100644 --- a/csharp/src/Ice/LoggerAdminLoggerI.cs +++ b/csharp/src/Ice/LoggerAdminLoggerI.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; namespace IceInternal; @@ -230,10 +225,10 @@ internal Job(List r, Ice.LogMessage l) private readonly Ice.Logger _localLogger; private readonly LoggerAdminI _loggerAdmin; - private bool _destroyed = false; + private bool _destroyed; private Thread _sendLogThread; private readonly Queue _jobQueue = new Queue(); static private readonly DateTime _unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - static private readonly string _traceCategory = "Admin.Logger"; + private const string _traceCategory = "Admin.Logger"; } diff --git a/csharp/src/Ice/LoggerI.cs b/csharp/src/Ice/LoggerI.cs index aa0f3b9173f..f78390dd359 100644 --- a/csharp/src/Ice/LoggerI.cs +++ b/csharp/src/Ice/LoggerI.cs @@ -1,12 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace Ice; +// Copyright (c) ZeroC, Inc. using System.Diagnostics; using System.Globalization; -using System.IO; + +namespace Ice; public abstract class LoggerI : Logger { @@ -85,8 +82,8 @@ private string format(string prefix, string category, string message) internal readonly string _prefix; internal readonly string _formattedPrefix; - internal string _date = null; - internal string _time = null; + internal string _date; + internal string _time; internal static object _globalMutex = new object(); } diff --git a/csharp/src/Ice/LoggerPlugin.cs b/csharp/src/Ice/LoggerPlugin.cs index df9dfa6e180..02981fdc2ef 100644 --- a/csharp/src/Ice/LoggerPlugin.cs +++ b/csharp/src/Ice/LoggerPlugin.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/MetricsAdminI.cs b/csharp/src/Ice/MetricsAdminI.cs index 3a06e1cc7f2..1ad000fabbc 100644 --- a/csharp/src/Ice/MetricsAdminI.cs +++ b/csharp/src/Ice/MetricsAdminI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; @@ -503,7 +501,7 @@ private void detached(Entry entry) _detachedQueue.AddLast(entry); } - private Dictionary parseRule(Ice.Properties properties, string name) + private static Dictionary parseRule(Ice.Properties properties, string name) { Dictionary pats = new Dictionary(); Dictionary rules = properties.getPropertiesForPrefix(name + '.'); @@ -514,7 +512,7 @@ private Dictionary parseRule(Ice.Properties properties, string na return pats; } - private bool match(string attribute, Regex regex, IceMX.MetricsHelper helper, bool reject) + private static bool match(string attribute, Regex regex, IceMX.MetricsHelper helper, bool reject) { string value; try @@ -535,7 +533,7 @@ private bool match(string attribute, Regex regex, IceMX.MetricsHelper helper, readonly private Dictionary _accept; readonly private Dictionary _reject; - readonly private Dictionary _objects = new Dictionary(); + readonly private Dictionary _objects = new(); readonly private Dictionary _subMaps; private LinkedList _detachedQueue; } @@ -695,7 +693,7 @@ public static void validateProperties(string prefix, Ice.Properties properties) if (unknownProps.Count != 0 && properties.getPropertyAsIntWithDefault("Ice.Warn.UnknownProperties", 1) > 0) { StringBuilder message = new StringBuilder("found unknown IceMX properties for `"); - message.Append(prefix.Substring(0, prefix.Length - 1)); + message.Append(prefix.AsSpan(0, prefix.Length - 1)); message.Append("':"); foreach (string p in unknownProps) { @@ -824,7 +822,7 @@ override public string[] getMetricsViewNames(out string[] disabledViews, Ice.Cur lock (this) { disabledViews = _disabledViews.ToArray(); - return new List(_views.Keys).ToArray(); + return new List(_views.Keys).ToArray(); } } @@ -872,7 +870,7 @@ override public IceMX.MetricsFailures[] getMapMetricsFailures(string viewName, s { return view.getFailures(mapName); } - return new IceMX.MetricsFailures[0]; + return []; } } @@ -970,7 +968,7 @@ public void updated(Dictionary props) { foreach (KeyValuePair e in props) { - if (e.Key.IndexOf("IceMX.") == 0) + if (e.Key.StartsWith("IceMX.")) { // Update the metrics views using the new configuration. try diff --git a/csharp/src/Ice/MetricsObserverI.cs b/csharp/src/Ice/MetricsObserverI.cs index 45935829721..17ae2d6c33e 100644 --- a/csharp/src/Ice/MetricsObserverI.cs +++ b/csharp/src/Ice/MetricsObserverI.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceMX; +// Copyright (c) ZeroC, Inc. using IceInternal; -using System; -using System.Collections.Generic; using System.Diagnostics; +namespace IceMX; + public class MetricsHelper where T : Metrics { public class AttributeResolver @@ -331,7 +327,7 @@ public MetricsMap.Entry getEntry(MetricsMap map) } private List.Entry> _objects; - private long _previousDelay = 0; + private long _previousDelay; } public class ObserverFactory where T : Metrics, new() where O : Observer, new() @@ -453,7 +449,7 @@ public void setUpdater(Action updater) private readonly MetricsAdminI _metrics; private readonly string _name; - private List> _maps = new List>(); + private List> _maps = new(); private volatile bool _enabled; private Action _updater; } diff --git a/csharp/src/Ice/Network.cs b/csharp/src/Ice/Network.cs index 6f1c1a95f3a..47b1df2b5a8 100644 --- a/csharp/src/Ice/Network.cs +++ b/csharp/src/Ice/Network.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; -using System.Collections.Generic; using System.Globalization; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; +namespace IceInternal; + public sealed class Network { // ProtocolSupport @@ -147,7 +143,7 @@ public static bool timeout(System.IO.IOException ex) // TODO: Instead of testing for an English substring, we need to examine the inner // exception (if there is one). // - return ex.Message.IndexOf("period of time", StringComparison.Ordinal) >= 0; + return ex.Message.Contains("period of time"); } public static bool noMoreFds(Exception ex) @@ -452,9 +448,8 @@ public static void setMcastGroup(Socket s, IPAddress group, string iface) else { int index = getInterfaceIndex(intf, group.AddressFamily); - if (!indexes.Contains(index)) + if (indexes.Add(index)) { - indexes.Add(index); IPv6MulticastOption option; if (index == -1) { diff --git a/csharp/src/Ice/NetworkProxy.cs b/csharp/src/Ice/NetworkProxy.cs index c9216725d13..e44eae941cc 100644 --- a/csharp/src/Ice/NetworkProxy.cs +++ b/csharp/src/Ice/NetworkProxy.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceInternal; +// Copyright (c) ZeroC, Inc. using System.Diagnostics; using System.Net; using System.Net.Sockets; using System.Text; +namespace IceInternal; + public interface NetworkProxy { // @@ -89,7 +87,7 @@ public void beginWrite(EndPoint endpoint, Buffer buf) IPEndPoint addr = (IPEndPoint)endpoint; buf.resize(9, false); ByteBuffer.ByteOrder order = buf.b.order(); - buf.b.order(ByteBuffer.ByteOrder.BIG_ENDIAN); // Network byte order. + buf.b.order(ByteBuffer.ByteOrder.BigEndian); // Network byte order. buf.b.position(0); buf.b.put(0x04); // SOCKS version 4. buf.b.put(0x01); // Command, establish a TCP/IP stream connection diff --git a/csharp/src/Ice/Object.cs b/csharp/src/Ice/Object.cs index 4aa7d817619..e7e8175e145 100644 --- a/csharp/src/Ice/Object.cs +++ b/csharp/src/Ice/Object.cs @@ -1,11 +1,7 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.ComponentModel; using System.Diagnostics; -using System.Threading.Tasks; namespace Ice; diff --git a/csharp/src/Ice/ObjectAdapter.cs b/csharp/src/Ice/ObjectAdapter.cs index 6e438a90306..4db0f57572e 100644 --- a/csharp/src/Ice/ObjectAdapter.cs +++ b/csharp/src/Ice/ObjectAdapter.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/ObjectAdapterFactory.cs b/csharp/src/Ice/ObjectAdapterFactory.cs index 5b663dcbf7a..321fb5de122 100644 --- a/csharp/src/Ice/ObjectAdapterFactory.cs +++ b/csharp/src/Ice/ObjectAdapterFactory.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Net.Security; +namespace IceInternal; public sealed class ObjectAdapterFactory { public void shutdown() diff --git a/csharp/src/Ice/ObjectAdapterI.cs b/csharp/src/Ice/ObjectAdapterI.cs index 4d2e9b9cde6..9ba8e2b3a3b 100644 --- a/csharp/src/Ice/ObjectAdapterI.cs +++ b/csharp/src/Ice/ObjectAdapterI.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace Ice; +// Copyright (c) ZeroC, Inc. using IceInternal; -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Net.Security; using System.Text; +namespace Ice; + public sealed class ObjectAdapterI : ObjectAdapter { public string getName() @@ -300,7 +296,7 @@ public void destroy() _instance = null; _threadPool = null; _routerInfo = null; - _publishedEndpoints = new EndpointI[0]; + _publishedEndpoints = []; _locatorInfo = null; _reference = null; _objectAdapterFactory = null; @@ -720,7 +716,7 @@ public void updateConnectionObservers() public void updateThreadObservers() { - ThreadPool threadPool = null; + IceInternal.ThreadPool threadPool = null; lock (this) { threadPool = _threadPool; @@ -759,7 +755,7 @@ public void decDirectCount() } } - public ThreadPool getThreadPool() + public IceInternal.ThreadPool getThreadPool() { // No mutex lock necessary, _threadPool and _instance are // immutable after creation until they are removed in @@ -921,7 +917,7 @@ public ObjectAdapterI( int threadPoolSizeMax = properties.getPropertyAsInt(_name + ".ThreadPool.SizeMax"); if (threadPoolSize > 0 || threadPoolSizeMax > 0) { - _threadPool = new ThreadPool(_instance, _name + ".ThreadPool", 0); + _threadPool = new IceInternal.ThreadPool(_instance, _name + ".ThreadPool", 0); } if (router == null) @@ -1222,7 +1218,7 @@ private EndpointI[] computePublishedEndpoints() { if (!first) { - s.Append(":"); + s.Append(':'); } s.Append(endpoint.ToString()); first = false; @@ -1338,7 +1334,7 @@ private void updateLocatorRegistry(LocatorInfo locatorInfo, ObjectPrx proxy) s.Append(endpoints[i].ToString()); if (i + 1 < endpoints.Length) { - s.Append(":"); + s.Append(':'); } } } @@ -1441,7 +1437,7 @@ private bool filterProperties(List unknownProps) private Instance _instance; private Communicator _communicator; private ObjectAdapterFactory _objectAdapterFactory; - private ThreadPool _threadPool; + private IceInternal.ThreadPool _threadPool; private ACMConfig _acm; private ServantManager _servantManager; private readonly string _name; diff --git a/csharp/src/Ice/ObserverHelper.cs b/csharp/src/Ice/ObserverHelper.cs index 26bc4454ae9..b76d1d025a0 100644 --- a/csharp/src/Ice/ObserverHelper.cs +++ b/csharp/src/Ice/ObserverHelper.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceInternal; +// Copyright (c) ZeroC, Inc. using Ice.Instrumentation; -using System.Collections.Generic; + +namespace IceInternal; public sealed class ObserverHelper { diff --git a/csharp/src/Ice/OpaqueEndpointI.cs b/csharp/src/Ice/OpaqueEndpointI.cs index 49e29a3b144..0bf084179bb 100644 --- a/csharp/src/Ice/OpaqueEndpointI.cs +++ b/csharp/src/Ice/OpaqueEndpointI.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Net.Security; +namespace IceInternal; + internal sealed class OpaqueEndpointI : EndpointI { public OpaqueEndpointI(List args) diff --git a/csharp/src/Ice/Optional.cs b/csharp/src/Ice/Optional.cs index 71dc080fae1..267368ee077 100644 --- a/csharp/src/Ice/Optional.cs +++ b/csharp/src/Ice/Optional.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; -using System; -using System.Collections.Generic; - public struct NoneType { } diff --git a/csharp/src/Ice/Options.cs b/csharp/src/Ice/Options.cs index bfa63b4eb44..c1c0c6b8bb3 100644 --- a/csharp/src/Ice/Options.cs +++ b/csharp/src/Ice/Options.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -28,14 +24,13 @@ static public string[] string l = line.Trim(); if (l.Length == 0) { - return new string[0]; + return []; } State state = State.Normal; string arg = ""; - List vec = new List(); - + var vec = new List(); for (int i = 0; i < l.Length; ++i) { char c = l[i]; @@ -107,7 +102,7 @@ static public string[] } default: { - if (IFS.IndexOf(l[i]) != -1) + if (IFS.Contains(l[i])) { vec.Add(arg); arg = ""; @@ -115,7 +110,7 @@ static public string[] // // Move to start of next argument. // - while (++i < l.Length && IFS.IndexOf(l[i]) != -1) + while (++i < l.Length && IFS.Contains(l[i])) { ; } @@ -260,7 +255,7 @@ static public string[] const string octalDigits = "01234567"; short s = 0; int j; - for (j = i; j < i + 3 && j < l.Length && octalDigits.IndexOf(c = l[j]) != -1; ++j) + for (j = i; j < i + 3 && j < l.Length && octalDigits.Contains(c = l[j]); ++j) { s = (short)(s * 8 + c - '0'); } @@ -275,7 +270,7 @@ static public string[] case 'x': { const string hexDigits = "0123456789abcdefABCDEF"; - if (i < l.Length - 1 && hexDigits.IndexOf(l[i + 1]) == -1) + if (i < l.Length - 1 && !hexDigits.Contains(l[i + 1])) { arg += '\\'; arg += 'x'; @@ -285,7 +280,7 @@ static public string[] short s = 0; int j; for (j = i + 1; - j < i + 3 && j < l.Length && hexDigits.IndexOf(c = l[j]) != -1; + j < i + 3 && j < l.Length && hexDigits.Contains(c = l[j]); ++j) { s *= 16; diff --git a/csharp/src/Ice/OutgoingAsync.cs b/csharp/src/Ice/OutgoingAsync.cs index 46c748430c7..86f65646b55 100644 --- a/csharp/src/Ice/OutgoingAsync.cs +++ b/csharp/src/Ice/OutgoingAsync.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; namespace IceInternal; @@ -788,7 +783,7 @@ public override bool response() case ReplyStatus.replyFacetNotExist: case ReplyStatus.replyOperationNotExist: { - Ice.Identity ident = new Ice.Identity(); + var ident = new Ice.Identity(); ident.ice_readMembers(is_); // @@ -1144,8 +1139,8 @@ public void invoke(string operation, bool synchronous) Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(proxy_.iceReference().getProtocol())); synchronous_ = synchronous; observer_ = ObserverHelper.get(proxy_, operation, null); - bool compress; // Not used for proxy flush batch requests. - _batchRequestNum = proxy_.iceGetBatchRequestQueue().swap(os_, out compress); + // Not used for proxy flush batch requests. + _batchRequestNum = proxy_.iceGetBatchRequestQueue().swap(os_, out _); invokeImpl(true); // userThread = true } diff --git a/csharp/src/Ice/OutputBase.cs b/csharp/src/Ice/OutputBase.cs index 44b0a56c506..3c3a36fe7a6 100644 --- a/csharp/src/Ice/OutputBase.cs +++ b/csharp/src/Ice/OutputBase.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceUtilInternal; - -using System.Collections.Generic; using System.Diagnostics; -using System.IO; + +namespace IceUtilInternal; public class OutputBase { diff --git a/csharp/src/Ice/OutputStream.cs b/csharp/src/Ice/OutputStream.cs index 4926bceda0e..be38c5bb79b 100644 --- a/csharp/src/Ice/OutputStream.cs +++ b/csharp/src/Ice/OutputStream.cs @@ -1,13 +1,10 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace Ice; - -using System.Collections.Generic; using System.Diagnostics; using Protocol = IceInternal.Protocol; +namespace Ice; + /// /// Interface for output streams used to write Slice types to a sequence /// of bytes. diff --git a/csharp/src/Ice/Patcher.cs b/csharp/src/Ice/Patcher.cs index 1ff0d8154aa..bcf7b39f729 100644 --- a/csharp/src/Ice/Patcher.cs +++ b/csharp/src/Ice/Patcher.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Reflection; namespace IceInternal; diff --git a/csharp/src/Ice/Plugin.cs b/csharp/src/Ice/Plugin.cs index 106314c96fa..ef1d5d246e0 100644 --- a/csharp/src/Ice/Plugin.cs +++ b/csharp/src/Ice/Plugin.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/PluginManagerI.cs b/csharp/src/Ice/PluginManagerI.cs index 8094ca7d8d8..77c731a0bc7 100644 --- a/csharp/src/Ice/PluginManagerI.cs +++ b/csharp/src/Ice/PluginManagerI.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace Ice; - -using System; using System.Collections; -using System.Collections.Generic; using System.Diagnostics; +namespace Ice; + /// /// Applications implement this interface to provide a plug-in factory /// to the Ice run time. @@ -338,9 +334,9 @@ public void loadPlugins(ref string[] cmdArgs) // Is there a .clr entry? // string clrKey = "Ice.Plugin." + name + ".clr"; - if (plugins.ContainsKey(clrKey)) + if (plugins.TryGetValue(clrKey, out string value)) { - val = plugins[clrKey]; + val = value; plugins.Remove(clrKey); } loadPlugin(name, val, ref cmdArgs); @@ -411,7 +407,7 @@ private void loadPlugin(string name, string pluginSpec, ref string[] cmdArgs) const string driveLetters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; if (entryPoint.Length > 3 && sepPos == 1 && - driveLetters.IndexOf(entryPoint[0]) != -1 && + driveLetters.Contains(entryPoint[0]) && (entryPoint[2] == '\\' || entryPoint[2] == '/')) { sepPos = entryPoint.IndexOf(':', 3); diff --git a/csharp/src/Ice/ProcessI.cs b/csharp/src/Ice/ProcessI.cs index 2a0cc157bbd..d53d2602404 100644 --- a/csharp/src/Ice/ProcessI.cs +++ b/csharp/src/Ice/ProcessI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; @@ -22,12 +20,12 @@ public override void writeMessage(string message, int fd, Ice.Current current) { case 1: { - System.Console.Out.WriteLine(message); + Console.Out.WriteLine(message); break; } case 2: { - System.Console.Error.WriteLine(message); + Console.Error.WriteLine(message); break; } } diff --git a/csharp/src/Ice/Properties.cs b/csharp/src/Ice/Properties.cs index 262d8c04361..7289621c3dd 100644 --- a/csharp/src/Ice/Properties.cs +++ b/csharp/src/Ice/Properties.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/PropertiesAdminI.cs b/csharp/src/Ice/PropertiesAdminI.cs index 6b1951128c1..44d34177e35 100644 --- a/csharp/src/Ice/PropertiesAdminI.cs +++ b/csharp/src/Ice/PropertiesAdminI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { @@ -55,7 +50,7 @@ public override void { lock (this) { - Dictionary old = _properties.getPropertiesForPrefix(""); + var old = _properties.getPropertiesForPrefix(""); int traceLevel = _properties.getPropertyAsInt("Ice.Trace.Admin.Properties"); // @@ -68,9 +63,9 @@ public override void // 3) Any properties not present in the new set but present in the existing set. // In other words, the property has been removed. // - Dictionary added = new Dictionary(); - Dictionary changed = new Dictionary(); - Dictionary removed = new Dictionary(); + var added = new Dictionary(); + var changed = new Dictionary(); + var removed = new Dictionary(); foreach (KeyValuePair e in props) { string key = e.Key; @@ -142,7 +137,7 @@ public override void message.Append(e.Value); message.Append(" (old value = "); message.Append(_properties.getProperty(e.Key)); - message.Append(")"); + message.Append(')'); } } } @@ -249,7 +244,7 @@ public void addUpdateCallback(System.Action> cb) } } - public void removeUpdateCallback(System.Action> cb) + public void removeUpdateCallback(Action> cb) { lock (this) { @@ -259,11 +254,9 @@ public void removeUpdateCallback(System.Action> cb) private readonly Ice.Properties _properties; private readonly Ice.Logger _logger; - private List _deprecatedUpdateCallbacks = - new List(); - private List>> _updateCallbacks = - new List>>(); + private readonly List _deprecatedUpdateCallbacks = new(); + private readonly List>> _updateCallbacks = new(); - private static readonly string _traceCategory = "Admin.Properties"; + private const string _traceCategory = "Admin.Properties"; } } diff --git a/csharp/src/Ice/PropertiesI.cs b/csharp/src/Ice/PropertiesI.cs index d83ef6c6cad..ffc650dae2e 100644 --- a/csharp/src/Ice/PropertiesI.cs +++ b/csharp/src/Ice/PropertiesI.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Text.RegularExpressions; @@ -97,7 +93,7 @@ public string[] getPropertyAsListWithDefault(string key, string[] val) { if (val == null) { - val = new string[0]; + val = []; } lock (this) @@ -275,7 +271,7 @@ public string[] parseCommandLineOptions(string pfx, string[] options) string opt = options[i]; if (opt.StartsWith(pfx, StringComparison.Ordinal)) { - if (opt.IndexOf('=') == -1) + if (!opt.Contains('=')) { opt += "=1"; } @@ -309,14 +305,12 @@ public void load(string file) { try { - using (System.IO.StreamReader sr = new System.IO.StreamReader(file)) - { - parse(sr); - } + using StreamReader sr = new StreamReader(file); + parse(sr); } - catch (System.IO.IOException ex) + catch (IOException ex) { - FileException fe = new FileException(ex); + var fe = new FileException(ex); fe.path = file; throw fe; } @@ -334,7 +328,7 @@ public List getUnusedProperties() { lock (this) { - List unused = new List(); + var unused = new List(); foreach (KeyValuePair entry in _properties) { if (!entry.Value.used) @@ -386,7 +380,7 @@ internal PropertiesI(ref string[] args, Properties defaults) : this() if (args[i].StartsWith("--Ice.Config", StringComparison.Ordinal)) { string line = args[i]; - if (line.IndexOf('=') == -1) + if (!line.Contains('=')) { line += "=1"; } diff --git a/csharp/src/Ice/Property.cs b/csharp/src/Ice/Property.cs index 9c468356a00..e2be6b4c2a3 100644 --- a/csharp/src/Ice/Property.cs +++ b/csharp/src/Ice/Property.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/Protocol.cs b/csharp/src/Ice/Protocol.cs index 35e68f22708..ec0b2b54a64 100644 --- a/csharp/src/Ice/Protocol.cs +++ b/csharp/src/Ice/Protocol.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/ProtocolInstance.cs b/csharp/src/Ice/ProtocolInstance.cs index f9c80d327b7..069c6ffe3b3 100644 --- a/csharp/src/Ice/ProtocolInstance.cs +++ b/csharp/src/Ice/ProtocolInstance.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Net; diff --git a/csharp/src/Ice/ProtocolPluginFacade.cs b/csharp/src/Ice/ProtocolPluginFacade.cs index 378a2dd9516..bd0feb53665 100644 --- a/csharp/src/Ice/ProtocolPluginFacade.cs +++ b/csharp/src/Ice/ProtocolPluginFacade.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/Proxy.cs b/csharp/src/Ice/Proxy.cs index 23078043c3d..e265ca5eeaf 100644 --- a/csharp/src/Ice/Proxy.cs +++ b/csharp/src/Ice/Proxy.cs @@ -1,15 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using IceInternal; using IceUtilInternal; -using System; -using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; namespace Ice; @@ -931,8 +925,6 @@ private Task return completed.Task; } - private const string _ice_invoke_name = "ice_invoke"; - private void iceI_ice_invoke(string operation, OperationMode mode, byte[] inEncaps, diff --git a/csharp/src/Ice/ProxyFactory.cs b/csharp/src/Ice/ProxyFactory.cs index 83418bf9546..b0020ee82af 100644 --- a/csharp/src/Ice/ProxyFactory.cs +++ b/csharp/src/Ice/ProxyFactory.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -264,7 +261,7 @@ internal ProxyFactory(Instance instance) // if (i == 0 && v == -1) { - _retryIntervals = new int[0]; + _retryIntervals = []; break; } diff --git a/csharp/src/Ice/ProxyIdentityKey.cs b/csharp/src/Ice/ProxyIdentityKey.cs index cecab1bd286..fa70494b511 100644 --- a/csharp/src/Ice/ProxyIdentityKey.cs +++ b/csharp/src/Ice/ProxyIdentityKey.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; +// Copyright (c) ZeroC, Inc. namespace Ice; @@ -52,13 +48,13 @@ public int Compare(object obj1, object obj2) ObjectPrx proxy1 = obj1 as ObjectPrx; if (obj1 != null && proxy1 == null) { - throw new ArgumentException("Argument must be derived from Ice.ObjectPrx", "obj1"); + throw new ArgumentException("Argument must be derived from Ice.ObjectPrx", nameof(obj1)); } ObjectPrx proxy2 = obj2 as ObjectPrx; if (obj2 != null && proxy2 == null) { - throw new ArgumentException("Argument must be derived from Ice.ObjectPrx", "obj2"); + throw new ArgumentException("Argument must be derived from Ice.ObjectPrx", nameof(obj2)); } return Util.proxyIdentityCompare(proxy1, proxy2); } @@ -114,13 +110,13 @@ public int Compare(object obj1, object obj2) ObjectPrx proxy1 = obj1 as ObjectPrx; if (obj1 != null && proxy1 == null) { - throw new ArgumentException("Argument must be derived from Ice.ObjectPrx", "obj1"); + throw new ArgumentException("Argument must be derived from Ice.ObjectPrx", nameof(obj1)); } ObjectPrx proxy2 = obj2 as ObjectPrx; if (obj2 != null && proxy2 == null) { - throw new ArgumentException("Argument must be derived from Ice.ObjectPrx", "obj2"); + throw new ArgumentException("Argument must be derived from Ice.ObjectPrx", nameof(obj2)); } return Util.proxyIdentityAndFacetCompare(proxy1, proxy2); } diff --git a/csharp/src/Ice/Reference.cs b/csharp/src/Ice/Reference.cs index 87090119a9f..d50c2649e83 100644 --- a/csharp/src/Ice/Reference.cs +++ b/csharp/src/Ice/Reference.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Text; @@ -809,7 +805,7 @@ public override int GetHashCode() } private Ice.ConnectionI _fixedConnection; - private static EndpointI[] _emptyEndpoints = new EndpointI[0]; + private static EndpointI[] _emptyEndpoints = []; } public class RoutableReference : Reference @@ -1651,8 +1647,8 @@ public void setException(Ice.LocalException ex) private RoutableReference _rr; private EndpointI[] _endpoints; private GetConnectionCallback _callback; - private int _i = 0; - private Ice.LocalException _exception = null; + private int _i; + private Ice.LocalException _exception; } protected void createConnection(EndpointI[] allEndpoints, GetConnectionCallback callback) @@ -1736,7 +1732,7 @@ public int Compare(EndpointI le, EndpointI re) private static EndpointComparator _preferNonSecureEndpointComparator = new EndpointComparator(false); private static EndpointComparator _preferSecureEndpointComparator = new EndpointComparator(true); - private static EndpointI[] _emptyEndpoints = new EndpointI[0]; + private static EndpointI[] _emptyEndpoints = []; private EndpointI[] _endpoints; private string _adapterId; diff --git a/csharp/src/Ice/ReferenceFactory.cs b/csharp/src/Ice/ReferenceFactory.cs index 386e588cbc9..81adb016bb0 100644 --- a/csharp/src/Ice/ReferenceFactory.cs +++ b/csharp/src/Ice/ReferenceFactory.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Text; using System.Text.RegularExpressions; @@ -475,7 +471,7 @@ public Reference create(string s, string propertyPrefix) { msg.Append(" `"); msg.Append(unknownEndpoints[idx]); - msg.Append("'"); + msg.Append('\''); } _instance.initializationData().logger.warning(msg.ToString()); } diff --git a/csharp/src/Ice/ReplyStatus.cs b/csharp/src/Ice/ReplyStatus.cs index 083ac199ebe..1eb89511f15 100644 --- a/csharp/src/Ice/ReplyStatus.cs +++ b/csharp/src/Ice/ReplyStatus.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/RequestHandler.cs b/csharp/src/Ice/RequestHandler.cs index bd2a9af40f2..010928a83b0 100644 --- a/csharp/src/Ice/RequestHandler.cs +++ b/csharp/src/Ice/RequestHandler.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/RequestHandlerFactory.cs b/csharp/src/Ice/RequestHandlerFactory.cs index 9094afff992..a03688a8506 100644 --- a/csharp/src/Ice/RequestHandlerFactory.cs +++ b/csharp/src/Ice/RequestHandlerFactory.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/ResponseHandler.cs b/csharp/src/Ice/ResponseHandler.cs index 3f2ea0253e6..fa77a0a3902 100644 --- a/csharp/src/Ice/ResponseHandler.cs +++ b/csharp/src/Ice/ResponseHandler.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/RetryQueue.cs b/csharp/src/Ice/RetryQueue.cs index 7dba0b401c2..dd87da16440 100644 --- a/csharp/src/Ice/RetryQueue.cs +++ b/csharp/src/Ice/RetryQueue.cs @@ -1,12 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; +namespace IceInternal; + public class RetryTask : TimerTask, CancellationHandler { public RetryTask(Instance instance, RetryQueue retryQueue, ProxyOutgoingAsyncBase outAsync) diff --git a/csharp/src/Ice/RouterInfo.cs b/csharp/src/Ice/RouterInfo.cs index 750b992a041..fcf6ee3558f 100644 --- a/csharp/src/Ice/RouterInfo.cs +++ b/csharp/src/Ice/RouterInfo.cs @@ -1,12 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; +namespace IceInternal; + public sealed class RouterInfo { public interface GetClientEndpointsCallback @@ -32,7 +29,7 @@ public void destroy() { lock (this) { - _clientEndpoints = new EndpointI[0]; + _clientEndpoints = []; _adapter = null; _identities.Clear(); } @@ -155,7 +152,7 @@ public bool addProxy(Ice.ObjectPrx proxy, AddProxyCallback callback) } } - _router.addProxiesAsync(new Ice.ObjectPrx[] { proxy }).ContinueWith( + _router.addProxiesAsync([proxy]).ContinueWith( (t) => { try @@ -163,7 +160,7 @@ public bool addProxy(Ice.ObjectPrx proxy, AddProxyCallback callback) addAndEvictProxies(proxy, t.Result); callback.addedProxy(); } - catch (System.AggregateException ae) + catch (AggregateException ae) { Debug.Assert(ae.InnerException is Ice.LocalException); callback.setException((Ice.LocalException)ae.InnerException); diff --git a/csharp/src/Ice/ServantLocator.cs b/csharp/src/Ice/ServantLocator.cs index d4b1c89ad14..1f21372c2d5 100644 --- a/csharp/src/Ice/ServantLocator.cs +++ b/csharp/src/Ice/ServantLocator.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/ServantManager.cs b/csharp/src/Ice/ServantManager.cs index 9ed5718aae2..c592324e22a 100644 --- a/csharp/src/Ice/ServantManager.cs +++ b/csharp/src/Ice/ServantManager.cs @@ -1,12 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; +namespace IceInternal; + public sealed class ServantManager { public void addServant(Ice.Object servant, Ice.Identity ident, string facet) @@ -78,7 +75,7 @@ public Ice.Object removeServant(Ice.Identity ident, string facet) Dictionary m; _servantMapMap.TryGetValue(ident, out m); Ice.Object obj = null; - if (m == null || !m.ContainsKey(facet)) + if (m == null || !m.TryGetValue(facet, out Ice.Object value)) { Ice.NotRegisteredException ex = new Ice.NotRegisteredException(); ex.id = Ice.Util.identityToString(ident, _instance.toStringMode()); @@ -89,7 +86,7 @@ public Ice.Object removeServant(Ice.Identity ident, string facet) } throw ex; } - obj = m[facet]; + obj = value; m.Remove(facet); if (m.Count == 0) @@ -364,8 +361,7 @@ public void destroy() private Instance _instance; private readonly string _adapterName; - private Dictionary> _servantMapMap - = new Dictionary>(); - private Dictionary _defaultServantMap = new Dictionary(); - private Dictionary _locatorMap = new Dictionary(); + private Dictionary> _servantMapMap = new(); + private Dictionary _defaultServantMap = new(); + private Dictionary _locatorMap = new(); } diff --git a/csharp/src/Ice/SlicedData.cs b/csharp/src/Ice/SlicedData.cs index 98529b7aee0..076041c5ebc 100644 --- a/csharp/src/Ice/SlicedData.cs +++ b/csharp/src/Ice/SlicedData.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/SocketOperation.cs b/csharp/src/Ice/SocketOperation.cs index cbca3d3082e..134d17bf1d7 100644 --- a/csharp/src/Ice/SocketOperation.cs +++ b/csharp/src/Ice/SocketOperation.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/StreamSocket.cs b/csharp/src/Ice/StreamSocket.cs index 8584e15a0c9..add3a6755b1 100644 --- a/csharp/src/Ice/StreamSocket.cs +++ b/csharp/src/Ice/StreamSocket.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; using System.Diagnostics; using System.Net; using System.Net.Sockets; +namespace IceInternal; + public sealed class StreamSocket { public StreamSocket(ProtocolInstance instance, NetworkProxy proxy, EndPoint addr, EndPoint sourceAddr) diff --git a/csharp/src/Ice/StreamWrapper.cs b/csharp/src/Ice/StreamWrapper.cs index 12b647759f1..66f3c01f4f9 100644 --- a/csharp/src/Ice/StreamWrapper.cs +++ b/csharp/src/Ice/StreamWrapper.cs @@ -1,13 +1,9 @@ +// Copyright (c) ZeroC, Inc. -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +using System.Diagnostics; namespace IceInternal; -using System.Diagnostics; -using System.IO; - // // Classes to provide a System.IO.Stream interface on top of an Ice stream. // We use this to serialize arbitrary .NET serializable classes into @@ -29,7 +25,7 @@ namespace IceInternal; // as a single byte, followed by the contents of the _bytes buffer. // -public class OutputStreamWrapper : Stream, System.IDisposable +public class OutputStreamWrapper : Stream { public OutputStreamWrapper(Ice.OutputStream s) { @@ -228,7 +224,7 @@ public override void SetLength(long value) private long _length; } -public class InputStreamWrapper : Stream, System.IDisposable +public class InputStreamWrapper : Stream { public InputStreamWrapper(int size, Ice.InputStream s) { @@ -352,10 +348,7 @@ public override long Seek(long offset, SeekOrigin origin) return _pos; } - public override void SetLength(long value) - { - Debug.Assert(false); - } + public override void SetLength(long value) => Debug.Assert(false); private Ice.InputStream _s; private int _pos; diff --git a/csharp/src/Ice/StringUtil.cs b/csharp/src/Ice/StringUtil.cs index 996ee0e38d3..e79aba914a7 100644 --- a/csharp/src/Ice/StringUtil.cs +++ b/csharp/src/Ice/StringUtil.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; using System.Text; @@ -31,7 +28,7 @@ public static int findFirstOf(string str, string match, int start) for (int i = start; i < len; i++) { char ch = str[i]; - if (match.IndexOf((char)ch) != -1) + if (match.Contains(ch)) { return i; } @@ -61,7 +58,7 @@ public static int findFirstNotOf(string str, string match, int start) for (int i = start; i < len; i++) { char ch = str[i]; - if (match.IndexOf(ch) == -1) + if (!match.Contains(ch)) { return i; } @@ -143,7 +140,7 @@ private static void } default: { - if (special != null && special.IndexOf(c) != -1) + if (special != null && special.Contains(c)) { sb.Append('\\'); sb.Append(c); @@ -215,8 +212,7 @@ public static string escapeString(string s, string special, Ice.ToStringMode toS { if (special[i] < 32 || special[i] > 126) { - throw new System.ArgumentException("special characters must be in ASCII range 32-126", - "special"); + throw new ArgumentException("special characters must be in ASCII range 32-126", nameof(special)); } } } @@ -283,7 +279,7 @@ private static char string msg; if (pos > 0) { - msg = "character after `" + s.Substring(0, pos) + "'"; + msg = $"character after `{s[..pos]}'"; } else { @@ -513,7 +509,7 @@ private static int } default: { - if (string.IsNullOrEmpty(special) || special.IndexOf(c) == -1) + if (string.IsNullOrEmpty(special) || !special.Contains(c)) { result.Append('\\'); // not in special, so we keep the backslash } @@ -540,7 +536,7 @@ public static string unescapeString(string s, int start, int end, string special if (special[i] < 32 || special[i] > 126) { throw new System.ArgumentException("special characters must be in ASCII range 32-126", - "special"); + nameof(special)); } } } @@ -600,7 +596,7 @@ static public string[] splitString(string str, string delim) quoteChar = '\0'; continue; // Skip the quote. } - else if (delim.IndexOf(str[pos]) != -1) + else if (delim.Contains(str[pos])) { if (quoteChar == '\0') { diff --git a/csharp/src/Ice/TcpAcceptor.cs b/csharp/src/Ice/TcpAcceptor.cs index 551dc8ad5b9..253eaa150c1 100644 --- a/csharp/src/Ice/TcpAcceptor.cs +++ b/csharp/src/Ice/TcpAcceptor.cs @@ -1,15 +1,11 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; -using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Text; +namespace IceInternal; + internal class TcpAcceptor : Acceptor { public virtual void close() diff --git a/csharp/src/Ice/TcpConnector.cs b/csharp/src/Ice/TcpConnector.cs index 13220f691b4..29ca74b4e73 100644 --- a/csharp/src/Ice/TcpConnector.cs +++ b/csharp/src/Ice/TcpConnector.cs @@ -1,11 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceInternal; +// Copyright (c) ZeroC, Inc. using System.Net; +namespace IceInternal; + internal sealed class TcpConnector : Connector { public Transceiver connect() diff --git a/csharp/src/Ice/TcpEndpointI.cs b/csharp/src/Ice/TcpEndpointI.cs index bd9c9e610fd..7dd3ff1889e 100644 --- a/csharp/src/Ice/TcpEndpointI.cs +++ b/csharp/src/Ice/TcpEndpointI.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Net; using System.Net.Security; +namespace IceInternal; + internal sealed class TcpEndpointI : IPEndpointI { public TcpEndpointI(ProtocolInstance instance, string ho, int po, EndPoint sourceAddr, int ti, string conId, diff --git a/csharp/src/Ice/TcpTransceiver.cs b/csharp/src/Ice/TcpTransceiver.cs index a2e6f4d569b..d3cca077831 100644 --- a/csharp/src/Ice/TcpTransceiver.cs +++ b/csharp/src/Ice/TcpTransceiver.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceInternal; +// Copyright (c) ZeroC, Inc. using System.Diagnostics; using System.Net; using System.Net.Sockets; +namespace IceInternal; + internal sealed class TcpTransceiver : Transceiver { public Socket fd() diff --git a/csharp/src/Ice/ThreadHookPlugin.cs b/csharp/src/Ice/ThreadHookPlugin.cs index 57d53910ad1..d21289afa2c 100644 --- a/csharp/src/Ice/ThreadHookPlugin.cs +++ b/csharp/src/Ice/ThreadHookPlugin.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; +// Copyright (c) ZeroC, Inc. namespace Ice; @@ -19,7 +15,7 @@ public class ThreadHookPlugin : Plugin /// /// The communicator using the thread notification hook. /// The thread notification hook for the communicator. - [Obsolete("This constructor is deprecated. Use the constructur with threadStart and threadStop parameters instead.")] + [Obsolete("This constructor is deprecated. Use the constructor with threadStart and threadStop parameters instead.")] public ThreadHookPlugin(Communicator communicator, ThreadNotification threadHook) : this(communicator, threadHook.start, threadHook.stop) diff --git a/csharp/src/Ice/ThreadPool.cs b/csharp/src/Ice/ThreadPool.cs index af32567aef6..a15521c3db0 100644 --- a/csharp/src/Ice/ThreadPool.cs +++ b/csharp/src/Ice/ThreadPool.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceInternal; +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; + +namespace IceInternal; public delegate void ThreadPoolWorkItem(); public delegate void AsyncCallback(object state); @@ -496,14 +492,14 @@ protected sealed override bool TryExecuteTaskInline(System.Threading.Tasks.Task return false; } - protected sealed override bool TryDequeue(System.Threading.Tasks.Task task) + protected sealed override bool TryDequeue(Task task) { return false; } - protected sealed override IEnumerable GetScheduledTasks() + protected sealed override IEnumerable GetScheduledTasks() { - return new System.Threading.Tasks.Task[0]; + return []; } private void run(WorkerThread thread) @@ -761,7 +757,7 @@ private AsyncCallback getCallback(int operation) } private Instance _instance; - private System.Action _dispatcher; + private Action _dispatcher; private bool _destroyed; private readonly string _prefix; private readonly string _threadPrefix; diff --git a/csharp/src/Ice/TieBase.cs b/csharp/src/Ice/TieBase.cs index b142e3c827e..748e590cc23 100644 --- a/csharp/src/Ice/TieBase.cs +++ b/csharp/src/Ice/TieBase.cs @@ -1,25 +1,21 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace Ice +namespace Ice; + +/// +/// Interface for servants using the tie mapping. +/// +public interface TieBase { /// - /// Interface for servants using the tie mapping. + /// Returns the delegate for this tie. /// - public interface TieBase - { - /// - /// Returns the delegate for this tie. - /// - /// The delegate. - object ice_delegate(); - - /// - /// Returns the delegate for this tie. - /// - /// The delegate. - void ice_delegate(object o); - } + /// The delegate. + object ice_delegate(); + /// + /// Returns the delegate for this tie. + /// + /// The delegate. + void ice_delegate(object o); } diff --git a/csharp/src/Ice/Time.cs b/csharp/src/Ice/Time.cs index 92d2396808f..ed5d8575c78 100644 --- a/csharp/src/Ice/Time.cs +++ b/csharp/src/Ice/Time.cs @@ -1,23 +1,20 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal -{ - using System.Diagnostics; +using System.Diagnostics; - public static class Time - { - static Time() - { - _stopwatch.Start(); - } +namespace IceInternal; - public static long currentMonotonicTimeMillis() - { - return _stopwatch.ElapsedMilliseconds; - } +public static class Time +{ + static Time() + { + _stopwatch.Start(); + } - private static Stopwatch _stopwatch = new Stopwatch(); + public static long currentMonotonicTimeMillis() + { + return _stopwatch.ElapsedMilliseconds; } + + private static readonly Stopwatch _stopwatch = new(); } diff --git a/csharp/src/Ice/Timer.cs b/csharp/src/Ice/Timer.cs index 3876fbc910e..b102ead1593 100644 --- a/csharp/src/Ice/Timer.cs +++ b/csharp/src/Ice/Timer.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. // // NOTE: We don't use C# timers, the API is quite a bit different from @@ -56,7 +54,7 @@ public void schedule(TimerTask task, long delay) _tasks.Add(task, token); _tokens.Add(token, null); } - catch (System.ArgumentException) + catch (ArgumentException) { Debug.Assert(false); } @@ -338,7 +336,7 @@ public override int GetHashCode() private IDictionary _tasks = new Dictionary(); private Instance _instance; private long _wakeUpTime = long.MaxValue; - private int _tokenId = 0; + private int _tokenId; private Thread _thread; // diff --git a/csharp/src/Ice/TraceLevels.cs b/csharp/src/Ice/TraceLevels.cs index 34ac19d63e8..1ade3a2344c 100644 --- a/csharp/src/Ice/TraceLevels.cs +++ b/csharp/src/Ice/TraceLevels.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/TraceUtil.cs b/csharp/src/Ice/TraceUtil.cs index b476339d438..28c40586960 100644 --- a/csharp/src/Ice/TraceUtil.cs +++ b/csharp/src/Ice/TraceUtil.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System.Collections.Generic; using System.Diagnostics; using System.Globalization; +namespace IceInternal; internal sealed class TraceUtil { internal static void traceSend(Ice.OutputStream str, Ice.Logger logger, TraceLevels tl) @@ -71,7 +67,7 @@ internal static void trace(string heading, Ice.InputStream str, Ice.Logger logge int p = str.pos(); str.pos(0); - using (System.IO.StringWriter s = new System.IO.StringWriter(CultureInfo.CurrentCulture)) + using (var s = new StringWriter(CultureInfo.CurrentCulture)) { s.Write(heading); printMessage(s, str); @@ -82,15 +78,15 @@ internal static void trace(string heading, Ice.InputStream str, Ice.Logger logge } } - private static HashSet slicingIds = new HashSet(); + private static HashSet slicingIds = new(); internal static void traceSlicing(string kind, string typeId, string slicingCat, Ice.Logger logger) { - lock (typeof(TraceUtil)) + lock (_globalMutex) { if (slicingIds.Add(typeId)) { - using (System.IO.StringWriter s = new System.IO.StringWriter(CultureInfo.CurrentCulture)) + using (StringWriter s = new StringWriter(CultureInfo.CurrentCulture)) { s.Write("unknown " + kind + " type `" + typeId + "'"); logger.trace(slicingCat, s.ToString()); @@ -139,26 +135,26 @@ public static void dumpOctets(byte[] data) { s = "" + n; } - System.Console.Out.Write(s + " "); + Console.Out.Write(s + " "); } else { - System.Console.Out.Write(" "); + Console.Out.Write(" "); } } - System.Console.Out.Write('"'); + Console.Out.Write('"'); for (int j = i; j < data.Length && j - i < inc; j++) { // TODO: this needs fixing if (data[j] >= 32 && data[j] < 127) { - System.Console.Out.Write((char)data[j]); + Console.Out.Write((char)data[j]); } else { - System.Console.Out.Write('.'); + Console.Out.Write('.'); } } @@ -533,4 +529,6 @@ private static string getMessageTypeAsString(byte type) return "unknown"; } } + + private static readonly object _globalMutex = new object(); } diff --git a/csharp/src/Ice/Transceiver.cs b/csharp/src/Ice/Transceiver.cs index d64c580c64a..e78b130b893 100644 --- a/csharp/src/Ice/Transceiver.cs +++ b/csharp/src/Ice/Transceiver.cs @@ -1,11 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceInternal; +// Copyright (c) ZeroC, Inc. using System.Net.Sockets; +namespace IceInternal; + public interface Transceiver { Socket fd(); diff --git a/csharp/src/Ice/UdpConnector.cs b/csharp/src/Ice/UdpConnector.cs index f3735cb7b81..f090e834af1 100644 --- a/csharp/src/Ice/UdpConnector.cs +++ b/csharp/src/Ice/UdpConnector.cs @@ -1,11 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -namespace IceInternal; +// Copyright (c) ZeroC, Inc. using System.Net; +namespace IceInternal; + internal sealed class UdpConnector : Connector { public Transceiver connect() diff --git a/csharp/src/Ice/UdpEndpointI.cs b/csharp/src/Ice/UdpEndpointI.cs index f94197f1309..073045e000f 100644 --- a/csharp/src/Ice/UdpEndpointI.cs +++ b/csharp/src/Ice/UdpEndpointI.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Net; using System.Net.Security; +namespace IceInternal; + internal sealed class UdpEndpointI : IPEndpointI { public UdpEndpointI(ProtocolInstance instance, string ho, int po, EndPoint sourceAddr, string mcastInterface, @@ -199,7 +195,7 @@ public override string options() if (_mcastInterface.Length != 0) { - bool addQuote = _mcastInterface.IndexOf(':') != -1; + bool addQuote = _mcastInterface.Contains(':'); s += " --interface "; if (addQuote) { diff --git a/csharp/src/Ice/UdpTransceiver.cs b/csharp/src/Ice/UdpTransceiver.cs index 131072e57e1..2084334fee7 100644 --- a/csharp/src/Ice/UdpTransceiver.cs +++ b/csharp/src/Ice/UdpTransceiver.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Net; using System.Net.Sockets; using System.Text; +namespace IceInternal; + internal sealed class UdpTransceiver : Transceiver { public Socket fd() @@ -871,12 +867,12 @@ internal void ioCompleted(object sender, SocketAsyncEventArgs e) private Socket _fd; private EndPoint _addr; private EndPoint _sourceAddr; - private IPEndPoint _mcastAddr = null; - private EndPoint _peerAddr = null; - private string _mcastInterface = null; + private IPEndPoint _mcastAddr; + private EndPoint _peerAddr; + private string _mcastInterface; - private int _port = 0; - private bool _bound = false; + private int _port; + private bool _bound; private SocketAsyncEventArgs _writeEventArgs; private SocketAsyncEventArgs _readEventArgs; diff --git a/csharp/src/Ice/UnknownSlicedValue.cs b/csharp/src/Ice/UnknownSlicedValue.cs index a749076abd3..13e94618dd5 100644 --- a/csharp/src/Ice/UnknownSlicedValue.cs +++ b/csharp/src/Ice/UnknownSlicedValue.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/Util.cs b/csharp/src/Ice/Util.cs index 0cdc373dcb9..861ea480f5a 100644 --- a/csharp/src/Ice/Util.cs +++ b/csharp/src/Ice/Util.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Collections; using System.Globalization; using System.Net.Security; -using System.Threading; namespace Ice { @@ -239,7 +235,7 @@ public static Communicator initialize(InitializationData initData) } CommunicatorI result = new CommunicatorI(initData); - string[] args = new string[0]; + string[] args = []; result.finishSetup(ref args); return result; } @@ -256,7 +252,7 @@ public static Communicator initialize(string configFile) if (configFile != null) { initData = new InitializationData(); - initData.properties = Util.createProperties(); + initData.properties = createProperties(); initData.properties.load(configFile); } return initialize(initData); @@ -284,7 +280,7 @@ public static Identity stringToIdentity(string s) // backslash before the separator. // int slash = -1, pos = 0; - while ((pos = s.IndexOf((System.Char)'/', pos)) != -1) + while ((pos = s.IndexOf('/', pos)) != -1) { int escapes = 0; while (pos - escapes > 0 && s[pos - escapes - 1] == '\\') @@ -635,10 +631,10 @@ public static void registerPluginFactory(string name, PluginFactory factory, boo public static readonly EncodingVersion Encoding_1_0 = new EncodingVersion(1, 0); public static readonly EncodingVersion Encoding_1_1 = new EncodingVersion(1, 1); - public static readonly NoneType None = new NoneType(); + public static readonly NoneType None; private static object _processLoggerMutex = new object(); - private static Logger _processLogger = null; + private static Logger _processLogger; } } diff --git a/csharp/src/Ice/Value.cs b/csharp/src/Ice/Value.cs index 3d97edef7dc..3e407348231 100644 --- a/csharp/src/Ice/Value.cs +++ b/csharp/src/Ice/Value.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.ComponentModel; namespace Ice; diff --git a/csharp/src/Ice/ValueFactory.cs b/csharp/src/Ice/ValueFactory.cs index 69d5c2f4f33..6d0a21b35fe 100644 --- a/csharp/src/Ice/ValueFactory.cs +++ b/csharp/src/Ice/ValueFactory.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice; diff --git a/csharp/src/Ice/ValueFactoryManager.cs b/csharp/src/Ice/ValueFactoryManager.cs index 32b1951def9..b4f604c6e5b 100644 --- a/csharp/src/Ice/ValueFactoryManager.cs +++ b/csharp/src/Ice/ValueFactoryManager.cs @@ -1,11 +1,7 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; -using System.Collections.Generic; - public sealed class ValueFactoryManagerI : Ice.ValueFactoryManager { public void add(Ice.ValueFactory factory, string id) @@ -33,5 +29,5 @@ public Ice.ValueFactory find(string id) } } - private Dictionary _factoryMap = new Dictionary(); + private Dictionary _factoryMap = new(); } diff --git a/csharp/src/Ice/ValueWriter.cs b/csharp/src/Ice/ValueWriter.cs index 1aafeb77b7c..a8e2f604702 100644 --- a/csharp/src/Ice/ValueWriter.cs +++ b/csharp/src/Ice/ValueWriter.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/WSAcceptor.cs b/csharp/src/Ice/WSAcceptor.cs index f8d9f5e476f..a7475bc50b6 100644 --- a/csharp/src/Ice/WSAcceptor.cs +++ b/csharp/src/Ice/WSAcceptor.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/WSConnector.cs b/csharp/src/Ice/WSConnector.cs index 01b247366c8..ccf924989a2 100644 --- a/csharp/src/Ice/WSConnector.cs +++ b/csharp/src/Ice/WSConnector.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceInternal; diff --git a/csharp/src/Ice/WSEndpoint.cs b/csharp/src/Ice/WSEndpoint.cs index 1b6bca57896..ce96bd81726 100644 --- a/csharp/src/Ice/WSEndpoint.cs +++ b/csharp/src/Ice/WSEndpoint.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; -using System.Collections.Generic; using System.Net.Security; +namespace IceInternal; + internal sealed class WSEndpoint : EndpointI { internal WSEndpoint(ProtocolInstance instance, EndpointI del, string res) @@ -266,7 +262,7 @@ public override string options() if (_resource != null && _resource.Length > 0) { s += " -r "; - bool addQuote = _resource.IndexOf(':') != -1; + bool addQuote = _resource.Contains(':'); if (addQuote) { s += "\""; diff --git a/csharp/src/Ice/WSTransceiver.cs b/csharp/src/Ice/WSTransceiver.cs index 724497d6995..09487b9f71c 100644 --- a/csharp/src/Ice/WSTransceiver.cs +++ b/csharp/src/Ice/WSTransceiver.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceInternal; - -using System; using System.Diagnostics; using System.Net.Sockets; using System.Security.Cryptography; using System.Text; +namespace IceInternal; + internal sealed class WSTransceiver : Transceiver { public Socket fd() @@ -719,14 +716,14 @@ private void init(ProtocolInstance instance, Transceiver del) _state = StateInitializeDelegate; _parser = new HttpParser(); _readState = ReadStateOpcode; - _readBuffer = new Buffer(ByteBuffer.ByteOrder.BIG_ENDIAN); // Network byte order + _readBuffer = new Buffer(ByteBuffer.ByteOrder.BigEndian); // Network byte order _readBufferSize = 1024; _readLastFrame = true; _readOpCode = 0; _readHeaderLength = 0; _readPayloadLength = 0; _writeState = WriteStateHeader; - _writeBuffer = new Buffer(ByteBuffer.ByteOrder.BIG_ENDIAN); // Network byte order + _writeBuffer = new Buffer(ByteBuffer.ByteOrder.BigEndian); // Network byte order _writeBufferSize = 1024; _readPending = false; _finishRead = false; @@ -734,7 +731,7 @@ private void init(ProtocolInstance instance, Transceiver del) _readMask = new byte[4]; _writeMask = new byte[4]; _key = ""; - _pingPayload = new byte[0]; + _pingPayload = []; _rand = new Random(); } @@ -771,7 +768,7 @@ private void handleRequest(Buffer responseBuffer) { throw new WebSocketException("missing value for Connection field"); } - else if (val.IndexOf("upgrade") == -1) + else if (!val.Contains("upgrade", StringComparison.Ordinal)) { throw new WebSocketException("invalid value `" + val + "' for Connection field"); } @@ -926,7 +923,7 @@ private void handleResponse() { throw new WebSocketException("missing value for Connection field"); } - else if (val.IndexOf("upgrade") == -1) + else if (!val.Contains("upgrade", StringComparison.Ordinal)) { throw new WebSocketException("invalid value `" + val + "' for Connection field"); } @@ -1327,7 +1324,7 @@ private bool preWrite(Buffer buf) _writeBuffer.b.position(pos); } _writeBuffer.b.put(_pingPayload); - _pingPayload = new byte[0]; + _pingPayload = []; _writeState = WriteStateControlFrame; _writeBuffer.b.flip(); @@ -1668,19 +1665,19 @@ private void prepareWriteHeader(byte opCode, int payloadLength) private const int OP_CONT = 0x0; // Continuation frame private const int OP_TEXT = 0x1; // Text frame private const int OP_DATA = 0x2; // Data frame - private const int OP_RES_0x3 = 0x3; // Reserved - private const int OP_RES_0x4 = 0x4; // Reserved - private const int OP_RES_0x5 = 0x5; // Reserved - private const int OP_RES_0x6 = 0x6; // Reserved - private const int OP_RES_0x7 = 0x7; // Reserved + // private const int OP_RES_0x3 = 0x3; // Reserved + // private const int OP_RES_0x4 = 0x4; // Reserved + // private const int OP_RES_0x5 = 0x5; // Reserved + // private const int OP_RES_0x6 = 0x6; // Reserved + // private const int OP_RES_0x7 = 0x7; // Reserved private const int OP_CLOSE = 0x8; // Connection close private const int OP_PING = 0x9; // Ping private const int OP_PONG = 0xA; // Pong - private const int OP_RES_0xB = 0xB; // Reserved - private const int OP_RES_0xC = 0xC; // Reserved - private const int OP_RES_0xD = 0xD; // Reserved - private const int OP_RES_0xE = 0xE; // Reserved - private const int OP_RES_0xF = 0xF; // Reserved + // private const int OP_RES_0xB = 0xB; // Reserved + // private const int OP_RES_0xC = 0xC; // Reserved + // private const int OP_RES_0xD = 0xD; // Reserved + // private const int OP_RES_0xE = 0xE; // Reserved + // private const int OP_RES_0xF = 0xF; // Reserved private const int FLAG_FINAL = 0x80; // Last frame private const int FLAG_MASKED = 0x80; // Payload is masked diff --git a/csharp/src/IceBox/AssemblyInfo.cs b/csharp/src/IceBox/AssemblyInfo.cs index 64b4f31f669..7f507cf919a 100644 --- a/csharp/src/IceBox/AssemblyInfo.cs +++ b/csharp/src/IceBox/AssemblyInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; using System.Runtime.InteropServices; diff --git a/csharp/src/IceBox/Service.cs b/csharp/src/IceBox/Service.cs index 6789e19c9c9..bb0ecb5098e 100644 --- a/csharp/src/IceBox/Service.cs +++ b/csharp/src/IceBox/Service.cs @@ -1,74 +1,71 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceBox -{ - /// - /// This exception is a general failure notification. - /// It is thrown for errors such as a service encountering an error - /// during initialization, or the service manager being unable to load a service executable. - /// - public class FailureException : Ice.LocalException - { - public string reason; +namespace IceBox; - private void _initDM() - { - this.reason = ""; - } - - public FailureException() - { - _initDM(); - } +/// +/// This exception is a general failure notification. +/// It is thrown for errors such as a service encountering an error +/// during initialization, or the service manager being unable to load a service executable. +/// +public class FailureException : Ice.LocalException +{ + public string reason; - public FailureException(System.Exception ex) : base(ex) - { - _initDM(); - } + private void _initDM() + { + this.reason = ""; + } - private void _initDM(string reason) - { - this.reason = reason; - } + public FailureException() + { + _initDM(); + } - public FailureException(string reason) - { - _initDM(reason); - } + public FailureException(System.Exception ex) : base(ex) + { + _initDM(); + } - public FailureException(string reason, System.Exception ex) : base(ex) - { - _initDM(reason); - } + private void _initDM(string reason) + { + this.reason = reason; + } - public override string ice_id() - { - return "::IceBox::FailureException"; - } + public FailureException(string reason) + { + _initDM(reason); } - public interface Service + public FailureException(string reason, System.Exception ex) : base(ex) { - /// - /// Start the service. - /// The given communicator is created by the ServiceManager for use by the service. This - /// communicator may also be used by other services, depending on the service configuration. - /// <p class="Note">The ServiceManager owns this communicator, and is responsible for destroying it. - /// - /// The service's name, as determined by the configuration. - /// - /// A communicator for use by the service. - /// - /// The service arguments that were not converted into properties. - /// - /// Raised if start failed. - void start(string name, Ice.Communicator communicator, string[] args); + _initDM(reason); + } - /// - /// Stop the service. - /// - void stop(); + public override string ice_id() + { + return "::IceBox::FailureException"; } } + +public interface Service +{ + /// + /// Start the service. + /// The given communicator is created by the ServiceManager for use by the service. This + /// communicator may also be used by other services, depending on the service configuration. + /// <p class="Note">The ServiceManager owns this communicator, and is responsible for destroying it. + /// + /// The service's name, as determined by the configuration. + /// + /// A communicator for use by the service. + /// + /// The service arguments that were not converted into properties. + /// + /// Raised if start failed. + void start(string name, Ice.Communicator communicator, string[] args); + + /// + /// Stop the service. + /// + void stop(); +} diff --git a/csharp/src/IceBoxNet/AssemblyInfo.cs b/csharp/src/IceBoxNet/AssemblyInfo.cs index 3add513c349..94f4fb8468c 100644 --- a/csharp/src/IceBoxNet/AssemblyInfo.cs +++ b/csharp/src/IceBoxNet/AssemblyInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; using System.Runtime.InteropServices; diff --git a/csharp/src/IceBoxNet/Server.cs b/csharp/src/IceBoxNet/Server.cs index 3a13b2483fd..76378102dcb 100644 --- a/csharp/src/IceBoxNet/Server.cs +++ b/csharp/src/IceBoxNet/Server.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace IceBox; diff --git a/csharp/src/IceBoxNet/ServiceManagerI.cs b/csharp/src/IceBoxNet/ServiceManagerI.cs index d5349eb9594..f4a1425bcd1 100644 --- a/csharp/src/IceBoxNet/ServiceManagerI.cs +++ b/csharp/src/IceBoxNet/ServiceManagerI.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Collections; -using System.Collections.Generic; using System.Diagnostics; -using System.Threading.Tasks; namespace IceBox; @@ -116,7 +111,7 @@ public override void startService(string name, Ice.Current current) } } _pendingStatusChanges = false; - System.Threading.Monitor.PulseAll(this); + Monitor.PulseAll(this); } } @@ -187,7 +182,7 @@ public override void stopService(string name, Ice.Current current) } } _pendingStatusChanges = false; - System.Threading.Monitor.PulseAll(this); + Monitor.PulseAll(this); } } @@ -449,7 +444,7 @@ private void startService(string service, string entryPoint, string[] args) const string driveLetters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; if (entryPoint.Length > 3 && sepPos == 1 && - driveLetters.IndexOf(entryPoint[0]) != -1 && + driveLetters.Contains(entryPoint[0]) && (entryPoint[2] == '\\' || entryPoint[2] == '/')) { sepPos = entryPoint.IndexOf(':', 3); @@ -486,9 +481,7 @@ private void startService(string service, string entryPoint, string[] args) } catch (Exception) { -#pragma warning disable CA2200 // Rethrow to preserve stack details throw ex; -#pragma warning restore CA2200 // Rethrow to preserve stack details } } } @@ -524,7 +517,7 @@ private void startService(string service, string entryPoint, string[] args) // communicator for the service. The communicator inherits // from the shared communicator properties. If it's not // defined, add the service properties to the shared - // commnunicator property set. + // communicator property set. // Ice.Communicator communicator; if (_communicator.getProperties().getPropertyAsInt("IceBox.UseSharedCommunicator." + service) > 0) @@ -716,7 +709,7 @@ private void stopAll() // while (_pendingStatusChanges) { - System.Threading.Monitor.Wait(this); + Monitor.Wait(this); } // @@ -1017,13 +1010,13 @@ private void removeAdminFacets(string prefix) } private Ice.Communicator _communicator; - private bool _adminEnabled = false; - private HashSet _adminFacetFilter = null; - private Ice.Communicator _sharedCommunicator = null; + private bool _adminEnabled; + private HashSet _adminFacetFilter; + private Ice.Communicator _sharedCommunicator; private Ice.Logger _logger; private string[] _argv; // Filtered server argument vector - private List _services = new List(); - private bool _pendingStatusChanges = false; - private Dictionary _observers = new Dictionary(); - private int _traceServiceObserver = 0; + private List _services = new(); + private bool _pendingStatusChanges; + private Dictionary _observers = new(); + private int _traceServiceObserver; } diff --git a/csharp/src/IceDiscovery/AssemblyInfo.cs b/csharp/src/IceDiscovery/AssemblyInfo.cs index 79557f0b1d0..0a4730b2eb8 100644 --- a/csharp/src/IceDiscovery/AssemblyInfo.cs +++ b/csharp/src/IceDiscovery/AssemblyInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; using System.Runtime.InteropServices; diff --git a/csharp/src/IceDiscovery/LocatorI.cs b/csharp/src/IceDiscovery/LocatorI.cs index 4a5b0a64b81..cf8f8d0e71c 100644 --- a/csharp/src/IceDiscovery/LocatorI.cs +++ b/csharp/src/IceDiscovery/LocatorI.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace IceDiscovery; -using System.Collections.Generic; -using System.Threading.Tasks; - internal class LocatorRegistryI : Ice.LocatorRegistryDisp_ { public diff --git a/csharp/src/IceDiscovery/LookupI.cs b/csharp/src/IceDiscovery/LookupI.cs index c316aba31ec..d8af3aaae06 100644 --- a/csharp/src/IceDiscovery/LookupI.cs +++ b/csharp/src/IceDiscovery/LookupI.cs @@ -1,15 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceDiscovery; - -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Text; -using System.Threading.Tasks; + +namespace IceDiscovery; internal abstract class Request { diff --git a/csharp/src/IceDiscovery/PluginI.cs b/csharp/src/IceDiscovery/PluginI.cs index 6fd35aec6fd..41b3c2a8a85 100644 --- a/csharp/src/IceDiscovery/PluginI.cs +++ b/csharp/src/IceDiscovery/PluginI.cs @@ -1,12 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceDiscovery; - -using System; using System.Text; +namespace IceDiscovery; + public sealed class PluginFactory : Ice.PluginFactory { public Ice.Plugin @@ -48,7 +45,7 @@ public void initialize() s.Append("udp -h \"").Append(address).Append("\" -p ").Append(port); if (intf.Length != 0) { - s.Append(" --interface \"").Append(intf).Append("\""); + s.Append(" --interface \"").Append(intf).Append('"'); } properties.setProperty("IceDiscovery.Multicast.Endpoints", s.ToString()); } diff --git a/csharp/src/IceGrid/AssemblyInfo.cs b/csharp/src/IceGrid/AssemblyInfo.cs index 38437c24344..63dd36f09c7 100644 --- a/csharp/src/IceGrid/AssemblyInfo.cs +++ b/csharp/src/IceGrid/AssemblyInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; using System.Runtime.InteropServices; diff --git a/csharp/src/IceLocatorDiscovery/AssemblyInfo.cs b/csharp/src/IceLocatorDiscovery/AssemblyInfo.cs index 8d5b25ccb9a..355eaf95618 100644 --- a/csharp/src/IceLocatorDiscovery/AssemblyInfo.cs +++ b/csharp/src/IceLocatorDiscovery/AssemblyInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; using System.Runtime.InteropServices; diff --git a/csharp/src/IceLocatorDiscovery/PluginI.cs b/csharp/src/IceLocatorDiscovery/PluginI.cs index d7ac3c73f83..d211fdef2b5 100644 --- a/csharp/src/IceLocatorDiscovery/PluginI.cs +++ b/csharp/src/IceLocatorDiscovery/PluginI.cs @@ -1,16 +1,9 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -namespace IceLocatorDiscovery; - -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Text; -using System.Threading; -using System.Threading.Tasks; +namespace IceLocatorDiscovery; public sealed class PluginFactory : Ice.PluginFactory { public Ice.Plugin @@ -463,7 +456,7 @@ public void { s.Append("\ninstance name = ").Append(_instanceName); } - s.Append("\n").Append(ex); + s.Append('\n').Append(ex); _lookup.ice_getCommunicator().getLogger().trace("Lookup", s.ToString()); } @@ -512,7 +505,7 @@ private void exception(Exception ex) { s.Append("\ninstance name = ").Append(_instanceName); } - s.Append("\n").Append(ex); + s.Append('\n').Append(ex); _lookup.ice_getCommunicator().getLogger().trace("Lookup", s.ToString()); } diff --git a/csharp/src/IceStorm/AssemblyInfo.cs b/csharp/src/IceStorm/AssemblyInfo.cs index b68f2aeb155..5f6e1578341 100644 --- a/csharp/src/IceStorm/AssemblyInfo.cs +++ b/csharp/src/IceStorm/AssemblyInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; using System.Runtime.InteropServices; diff --git a/csharp/test/Glacier2/router/CallbackI.cs b/csharp/test/Glacier2/router/CallbackI.cs index e1b428a22bc..aeb88500fe2 100644 --- a/csharp/test/Glacier2/router/CallbackI.cs +++ b/csharp/test/Glacier2/router/CallbackI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; using Test; diff --git a/csharp/test/Glacier2/router/Client.cs b/csharp/test/Glacier2/router/Client.cs index fe997105f07..4a327a7abed 100644 --- a/csharp/test/Glacier2/router/Client.cs +++ b/csharp/test/Glacier2/router/Client.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Reflection; -using System.Threading.Tasks; using Test; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Glacier2/router/Server.cs b/csharp/test/Glacier2/router/Server.cs index c2f0a4414c6..2420091c1ed 100644 --- a/csharp/test/Glacier2/router/Server.cs +++ b/csharp/test/Glacier2/router/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Glacier2/sessionHelper/CallbackI.cs b/csharp/test/Glacier2/sessionHelper/CallbackI.cs index 1d659236971..7d41f2feac4 100644 --- a/csharp/test/Glacier2/sessionHelper/CallbackI.cs +++ b/csharp/test/Glacier2/sessionHelper/CallbackI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using Test; diff --git a/csharp/test/Glacier2/sessionHelper/Client.cs b/csharp/test/Glacier2/sessionHelper/Client.cs index 17044ceef4b..c19e8981486 100644 --- a/csharp/test/Glacier2/sessionHelper/Client.cs +++ b/csharp/test/Glacier2/sessionHelper/Client.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading; -using System.Threading.Tasks; using Test; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Glacier2/sessionHelper/Server.cs b/csharp/test/Glacier2/sessionHelper/Server.cs index 2d90dc22fdb..43d37b2de8d 100644 --- a/csharp/test/Glacier2/sessionHelper/Server.cs +++ b/csharp/test/Glacier2/sessionHelper/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/acm/AllTests.cs b/csharp/test/Ice/acm/AllTests.cs index 73bbd6bdc70..d8e6029d92f 100644 --- a/csharp/test/Ice/acm/AllTests.cs +++ b/csharp/test/Ice/acm/AllTests.cs @@ -1,13 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Globalization; -using System.IO; -using System.Threading; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/acm/Client.cs b/csharp/test/Ice/acm/Client.cs index eedd3bea8bb..79db110f791 100644 --- a/csharp/test/Ice/acm/Client.cs +++ b/csharp/test/Ice/acm/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/acm/Server.cs b/csharp/test/Ice/acm/Server.cs index ab7defcc2f6..874b39aaf41 100644 --- a/csharp/test/Ice/acm/Server.cs +++ b/csharp/test/Ice/acm/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/acm/TestI.cs b/csharp/test/Ice/acm/TestI.cs index 785416f02fd..8ec5c8175e4 100644 --- a/csharp/test/Ice/acm/TestI.cs +++ b/csharp/test/Ice/acm/TestI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/adapterDeactivation/AllTests.cs b/csharp/test/Ice/adapterDeactivation/AllTests.cs index eb87cd7ac12..6dc0cbd1efb 100644 --- a/csharp/test/Ice/adapterDeactivation/AllTests.cs +++ b/csharp/test/Ice/adapterDeactivation/AllTests.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/adapterDeactivation/Client.cs b/csharp/test/Ice/adapterDeactivation/Client.cs index 8c043e14fc0..eccd8ec4ec2 100644 --- a/csharp/test/Ice/adapterDeactivation/Client.cs +++ b/csharp/test/Ice/adapterDeactivation/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/adapterDeactivation/Collocated.cs b/csharp/test/Ice/adapterDeactivation/Collocated.cs index 886d97175c6..a34e9258102 100644 --- a/csharp/test/Ice/adapterDeactivation/Collocated.cs +++ b/csharp/test/Ice/adapterDeactivation/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/adapterDeactivation/Cookie.cs b/csharp/test/Ice/adapterDeactivation/Cookie.cs index 84732bdef83..3d50ff88725 100644 --- a/csharp/test/Ice/adapterDeactivation/Cookie.cs +++ b/csharp/test/Ice/adapterDeactivation/Cookie.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/adapterDeactivation/ServantLocatorI.cs b/csharp/test/Ice/adapterDeactivation/ServantLocatorI.cs index a62e0214e88..091202403e9 100644 --- a/csharp/test/Ice/adapterDeactivation/ServantLocatorI.cs +++ b/csharp/test/Ice/adapterDeactivation/ServantLocatorI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Text; diff --git a/csharp/test/Ice/adapterDeactivation/Server.cs b/csharp/test/Ice/adapterDeactivation/Server.cs index 5f7898d6903..1e6325ae8d4 100644 --- a/csharp/test/Ice/adapterDeactivation/Server.cs +++ b/csharp/test/Ice/adapterDeactivation/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/adapterDeactivation/TestI.cs b/csharp/test/Ice/adapterDeactivation/TestI.cs index 8628c7300a4..9b7ae6805b6 100644 --- a/csharp/test/Ice/adapterDeactivation/TestI.cs +++ b/csharp/test/Ice/adapterDeactivation/TestI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/admin/AllTests.cs b/csharp/test/Ice/admin/AllTests.cs index fa73a1bc0e8..b37d903b74a 100644 --- a/csharp/test/Ice/admin/AllTests.cs +++ b/csharp/test/Ice/admin/AllTests.cs @@ -1,10 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; -using System.Threading; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/admin/Client.cs b/csharp/test/Ice/admin/Client.cs index 7f8ebff1968..b9d3c17c478 100644 --- a/csharp/test/Ice/admin/Client.cs +++ b/csharp/test/Ice/admin/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/admin/Server.cs b/csharp/test/Ice/admin/Server.cs index 2f5f404fabb..ea1582cffc9 100644 --- a/csharp/test/Ice/admin/Server.cs +++ b/csharp/test/Ice/admin/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/admin/TestI.cs b/csharp/test/Ice/admin/TestI.cs index 4dccf09b86c..d2cf9988c6a 100644 --- a/csharp/test/Ice/admin/TestI.cs +++ b/csharp/test/Ice/admin/TestI.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; namespace Ice diff --git a/csharp/test/Ice/ami/AllTests.cs b/csharp/test/Ice/ami/AllTests.cs index 77437910324..335894165bc 100644 --- a/csharp/test/Ice/ami/AllTests.cs +++ b/csharp/test/Ice/ami/AllTests.cs @@ -1,12 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/ami/Client.cs b/csharp/test/Ice/ami/Client.cs index 1418cac2973..c6fdf46cba8 100644 --- a/csharp/test/Ice/ami/Client.cs +++ b/csharp/test/Ice/ami/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/ami/Collocated.cs b/csharp/test/Ice/ami/Collocated.cs index dc89db66909..163d437d3bb 100644 --- a/csharp/test/Ice/ami/Collocated.cs +++ b/csharp/test/Ice/ami/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/ami/Server.cs b/csharp/test/Ice/ami/Server.cs index ddaff702aaf..c1c7893232e 100644 --- a/csharp/test/Ice/ami/Server.cs +++ b/csharp/test/Ice/ami/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/ami/TestI.cs b/csharp/test/Ice/ami/TestI.cs index 52b78b33398..68106f58b37 100644 --- a/csharp/test/Ice/ami/TestI.cs +++ b/csharp/test/Ice/ami/TestI.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/assemblies/Client.cs b/csharp/test/Ice/assemblies/Client.cs index 193e42d262b..e56ab2baf88 100644 --- a/csharp/test/Ice/assemblies/Client.cs +++ b/csharp/test/Ice/assemblies/Client.cs @@ -1,12 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.IO; -using System.Linq; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/background/Acceptor.cs b/csharp/test/Ice/background/Acceptor.cs index 8b47df1da93..a437cf31920 100644 --- a/csharp/test/Ice/background/Acceptor.cs +++ b/csharp/test/Ice/background/Acceptor.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. internal class Acceptor : IceInternal.Acceptor { diff --git a/csharp/test/Ice/background/AllTests.cs b/csharp/test/Ice/background/AllTests.cs index bd34538922c..325c2ff403e 100644 --- a/csharp/test/Ice/background/AllTests.cs +++ b/csharp/test/Ice/background/AllTests.cs @@ -1,11 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. + using Test; public class AllTests diff --git a/csharp/test/Ice/background/BackgroundControllerI.cs b/csharp/test/Ice/background/BackgroundControllerI.cs index db6b1da2100..48efb5823eb 100644 --- a/csharp/test/Ice/background/BackgroundControllerI.cs +++ b/csharp/test/Ice/background/BackgroundControllerI.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using Test; internal class BackgroundControllerI : BackgroundControllerDisp_ diff --git a/csharp/test/Ice/background/BackgroundI.cs b/csharp/test/Ice/background/BackgroundI.cs index 39c210206e2..56a1cf40ba0 100644 --- a/csharp/test/Ice/background/BackgroundI.cs +++ b/csharp/test/Ice/background/BackgroundI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using Test; diff --git a/csharp/test/Ice/background/Client.cs b/csharp/test/Ice/background/Client.cs index 49b485b75f4..895042e971c 100644 --- a/csharp/test/Ice/background/Client.cs +++ b/csharp/test/Ice/background/Client.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/background/Configuration.cs b/csharp/test/Ice/background/Configuration.cs index d5c23e84943..8f330a8554b 100644 --- a/csharp/test/Ice/background/Configuration.cs +++ b/csharp/test/Ice/background/Configuration.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. internal class Configuration { diff --git a/csharp/test/Ice/background/Connector.cs b/csharp/test/Ice/background/Connector.cs index 9338429bd27..d5ef2ce1f61 100644 --- a/csharp/test/Ice/background/Connector.cs +++ b/csharp/test/Ice/background/Connector.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. internal class Connector : IceInternal.Connector { diff --git a/csharp/test/Ice/background/EndpointFactory.cs b/csharp/test/Ice/background/EndpointFactory.cs index f8138265cbd..913b2d87a61 100644 --- a/csharp/test/Ice/background/EndpointFactory.cs +++ b/csharp/test/Ice/background/EndpointFactory.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; internal class EndpointFactory : IceInternal.EndpointFactory diff --git a/csharp/test/Ice/background/EndpointI.cs b/csharp/test/Ice/background/EndpointI.cs index 0075824adc3..5902c27d623 100644 --- a/csharp/test/Ice/background/EndpointI.cs +++ b/csharp/test/Ice/background/EndpointI.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; using System.Net.Security; diff --git a/csharp/test/Ice/background/PluginI.cs b/csharp/test/Ice/background/PluginI.cs index ceecc756bcb..16a36bed01a 100644 --- a/csharp/test/Ice/background/PluginI.cs +++ b/csharp/test/Ice/background/PluginI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. internal class PluginI : Ice.Plugin { diff --git a/csharp/test/Ice/background/Server.cs b/csharp/test/Ice/background/Server.cs index 81dfaf1bc46..3e42a89a756 100644 --- a/csharp/test/Ice/background/Server.cs +++ b/csharp/test/Ice/background/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/background/Transceiver.cs b/csharp/test/Ice/background/Transceiver.cs index 607b119b1ac..8cb8792b571 100644 --- a/csharp/test/Ice/background/Transceiver.cs +++ b/csharp/test/Ice/background/Transceiver.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; using System.Net.Sockets; diff --git a/csharp/test/Ice/binding/AllTests.cs b/csharp/test/Ice/binding/AllTests.cs index 63e143c4459..47b2069b97d 100644 --- a/csharp/test/Ice/binding/AllTests.cs +++ b/csharp/test/Ice/binding/AllTests.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/binding/Client.cs b/csharp/test/Ice/binding/Client.cs index 256206911ed..d85730e878a 100644 --- a/csharp/test/Ice/binding/Client.cs +++ b/csharp/test/Ice/binding/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/binding/RemoteCommunicatorI.cs b/csharp/test/Ice/binding/RemoteCommunicatorI.cs index e4c68cab037..646ae000c8d 100644 --- a/csharp/test/Ice/binding/RemoteCommunicatorI.cs +++ b/csharp/test/Ice/binding/RemoteCommunicatorI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/binding/RemoteObjectAdapterI.cs b/csharp/test/Ice/binding/RemoteObjectAdapterI.cs index acbb5a980da..0c9143431f5 100644 --- a/csharp/test/Ice/binding/RemoteObjectAdapterI.cs +++ b/csharp/test/Ice/binding/RemoteObjectAdapterI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/binding/Server.cs b/csharp/test/Ice/binding/Server.cs index 38f3803b10e..f16c4c897d5 100644 --- a/csharp/test/Ice/binding/Server.cs +++ b/csharp/test/Ice/binding/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/binding/TestI.cs b/csharp/test/Ice/binding/TestI.cs index 63430e60542..9260e26a3f4 100644 --- a/csharp/test/Ice/binding/TestI.cs +++ b/csharp/test/Ice/binding/TestI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/defaultServant/AllTests.cs b/csharp/test/Ice/defaultServant/AllTests.cs index 10f283cc52d..fa4d44697bb 100644 --- a/csharp/test/Ice/defaultServant/AllTests.cs +++ b/csharp/test/Ice/defaultServant/AllTests.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/defaultServant/Client.cs b/csharp/test/Ice/defaultServant/Client.cs index 8ad7a3584c8..4ca03306a85 100644 --- a/csharp/test/Ice/defaultServant/Client.cs +++ b/csharp/test/Ice/defaultServant/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/defaultServant/MyObjectI.cs b/csharp/test/Ice/defaultServant/MyObjectI.cs index 6135124be42..a31c438c9d5 100644 --- a/csharp/test/Ice/defaultServant/MyObjectI.cs +++ b/csharp/test/Ice/defaultServant/MyObjectI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/defaultValue/AllTests.cs b/csharp/test/Ice/defaultValue/AllTests.cs index 65655f02a52..057fe3e190e 100644 --- a/csharp/test/Ice/defaultValue/AllTests.cs +++ b/csharp/test/Ice/defaultValue/AllTests.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/defaultValue/Client.cs b/csharp/test/Ice/defaultValue/Client.cs index 381feee3688..554c9f465a5 100644 --- a/csharp/test/Ice/defaultValue/Client.cs +++ b/csharp/test/Ice/defaultValue/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/dictMapping/AllTests.cs b/csharp/test/Ice/dictMapping/AllTests.cs index 49140afcbe5..fda67b3b716 100644 --- a/csharp/test/Ice/dictMapping/AllTests.cs +++ b/csharp/test/Ice/dictMapping/AllTests.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/dictMapping/Client.cs b/csharp/test/Ice/dictMapping/Client.cs index ad862fdca4f..db1532699d9 100644 --- a/csharp/test/Ice/dictMapping/Client.cs +++ b/csharp/test/Ice/dictMapping/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/dictMapping/Collocated.cs b/csharp/test/Ice/dictMapping/Collocated.cs index 42c21e1b536..b29a5284623 100644 --- a/csharp/test/Ice/dictMapping/Collocated.cs +++ b/csharp/test/Ice/dictMapping/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/dictMapping/MyClassAMDI.cs b/csharp/test/Ice/dictMapping/MyClassAMDI.cs index cdfd570db05..c1d91d1b170 100644 --- a/csharp/test/Ice/dictMapping/MyClassAMDI.cs +++ b/csharp/test/Ice/dictMapping/MyClassAMDI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/dictMapping/MyClassI.cs b/csharp/test/Ice/dictMapping/MyClassI.cs index a29761b8b6f..ba2f6bfb17a 100644 --- a/csharp/test/Ice/dictMapping/MyClassI.cs +++ b/csharp/test/Ice/dictMapping/MyClassI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/dictMapping/Server.cs b/csharp/test/Ice/dictMapping/Server.cs index ca0965c03e8..88bd31b650a 100644 --- a/csharp/test/Ice/dictMapping/Server.cs +++ b/csharp/test/Ice/dictMapping/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/dictMapping/ServerAMD.cs b/csharp/test/Ice/dictMapping/ServerAMD.cs index 9fc51d1eb58..16ded9e3ed0 100644 --- a/csharp/test/Ice/dictMapping/ServerAMD.cs +++ b/csharp/test/Ice/dictMapping/ServerAMD.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/dictMapping/Twoways.cs b/csharp/test/Ice/dictMapping/Twoways.cs index 03c01f937af..7df3e7cb9ae 100644 --- a/csharp/test/Ice/dictMapping/Twoways.cs +++ b/csharp/test/Ice/dictMapping/Twoways.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/dictMapping/TwowaysAMI.cs b/csharp/test/Ice/dictMapping/TwowaysAMI.cs index 40f9ab46e4b..f31d2b41a31 100644 --- a/csharp/test/Ice/dictMapping/TwowaysAMI.cs +++ b/csharp/test/Ice/dictMapping/TwowaysAMI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. /* Unmerged change from project 'collocated' Before: @@ -10,9 +8,6 @@ using System.Collections.Generic; using System.Diagnostics; */ -using System.Collections.Generic; -using System.Threading.Tasks; - namespace Ice { namespace dictMapping diff --git a/csharp/test/Ice/dispatcher/AllTests.cs b/csharp/test/Ice/dispatcher/AllTests.cs index 9c09cb74634..71153e764fd 100644 --- a/csharp/test/Ice/dispatcher/AllTests.cs +++ b/csharp/test/Ice/dispatcher/AllTests.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Threading.Tasks; using Test; public class AllTests : Test.AllTests diff --git a/csharp/test/Ice/dispatcher/Client.cs b/csharp/test/Ice/dispatcher/Client.cs index 5c99c344c85..5be859b5027 100644 --- a/csharp/test/Ice/dispatcher/Client.cs +++ b/csharp/test/Ice/dispatcher/Client.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/dispatcher/Collocated.cs b/csharp/test/Ice/dispatcher/Collocated.cs index afdf208b023..5e2064e0966 100644 --- a/csharp/test/Ice/dispatcher/Collocated.cs +++ b/csharp/test/Ice/dispatcher/Collocated.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/dispatcher/Dispatcher.cs b/csharp/test/Ice/dispatcher/Dispatcher.cs index a59dfed36e1..6deb9d0686d 100644 --- a/csharp/test/Ice/dispatcher/Dispatcher.cs +++ b/csharp/test/Ice/dispatcher/Dispatcher.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; public class Dispatcher { diff --git a/csharp/test/Ice/dispatcher/Server.cs b/csharp/test/Ice/dispatcher/Server.cs index 01993e3e5e1..7de3897ad79 100644 --- a/csharp/test/Ice/dispatcher/Server.cs +++ b/csharp/test/Ice/dispatcher/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/dispatcher/TestI.cs b/csharp/test/Ice/dispatcher/TestI.cs index 67906454bdd..ba76ca2dcd8 100644 --- a/csharp/test/Ice/dispatcher/TestI.cs +++ b/csharp/test/Ice/dispatcher/TestI.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading; using Test; public class TestI : TestIntfDisp_ diff --git a/csharp/test/Ice/echo/BlobjectI.cs b/csharp/test/Ice/echo/BlobjectI.cs index 8ffd5c7c4ad..9da9156a654 100644 --- a/csharp/test/Ice/echo/BlobjectI.cs +++ b/csharp/test/Ice/echo/BlobjectI.cs @@ -1,9 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; -using System.Threading.Tasks; public class BlobjectI : Ice.BlobjectAsync { diff --git a/csharp/test/Ice/echo/Server.cs b/csharp/test/Ice/echo/Server.cs index 7ef235765f9..07d5fefdd79 100644 --- a/csharp/test/Ice/echo/Server.cs +++ b/csharp/test/Ice/echo/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/enums/AllTests.cs b/csharp/test/Ice/enums/AllTests.cs index e146dcb8428..0531c52a453 100644 --- a/csharp/test/Ice/enums/AllTests.cs +++ b/csharp/test/Ice/enums/AllTests.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/enums/Client.cs b/csharp/test/Ice/enums/Client.cs index 018e9456a8e..f75fc0d5c14 100644 --- a/csharp/test/Ice/enums/Client.cs +++ b/csharp/test/Ice/enums/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/enums/Server.cs b/csharp/test/Ice/enums/Server.cs index f234ec846a6..178625f1f1d 100644 --- a/csharp/test/Ice/enums/Server.cs +++ b/csharp/test/Ice/enums/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/enums/TestI.cs b/csharp/test/Ice/enums/TestI.cs index c6bef2242d8..fdc5d611db3 100644 --- a/csharp/test/Ice/enums/TestI.cs +++ b/csharp/test/Ice/enums/TestI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/exceptions/AllTests.cs b/csharp/test/Ice/exceptions/AllTests.cs index 427d3ad63df..80d3aab0adb 100644 --- a/csharp/test/Ice/exceptions/AllTests.cs +++ b/csharp/test/Ice/exceptions/AllTests.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/exceptions/Client.cs b/csharp/test/Ice/exceptions/Client.cs index a0e97913404..d39570ef567 100644 --- a/csharp/test/Ice/exceptions/Client.cs +++ b/csharp/test/Ice/exceptions/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/exceptions/Collocated.cs b/csharp/test/Ice/exceptions/Collocated.cs index 2f33783f998..2daeafb30c9 100644 --- a/csharp/test/Ice/exceptions/Collocated.cs +++ b/csharp/test/Ice/exceptions/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/exceptions/EmptyAMDI.cs b/csharp/test/Ice/exceptions/EmptyAMDI.cs index 0b47273ac04..d49ec237150 100644 --- a/csharp/test/Ice/exceptions/EmptyAMDI.cs +++ b/csharp/test/Ice/exceptions/EmptyAMDI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/exceptions/EmptyI.cs b/csharp/test/Ice/exceptions/EmptyI.cs index 37a5827543e..cc797a9fd8e 100644 --- a/csharp/test/Ice/exceptions/EmptyI.cs +++ b/csharp/test/Ice/exceptions/EmptyI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/exceptions/ServantLocatorI.cs b/csharp/test/Ice/exceptions/ServantLocatorI.cs index 47f616ca25a..89a49c5e44c 100644 --- a/csharp/test/Ice/exceptions/ServantLocatorI.cs +++ b/csharp/test/Ice/exceptions/ServantLocatorI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/exceptions/Server.cs b/csharp/test/Ice/exceptions/Server.cs index bafcb231400..1827364fc1c 100644 --- a/csharp/test/Ice/exceptions/Server.cs +++ b/csharp/test/Ice/exceptions/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/exceptions/ServerAMD.cs b/csharp/test/Ice/exceptions/ServerAMD.cs index 2d45c2c3e0d..b4e7a779ce0 100644 --- a/csharp/test/Ice/exceptions/ServerAMD.cs +++ b/csharp/test/Ice/exceptions/ServerAMD.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/exceptions/ThrowerAMDI.cs b/csharp/test/Ice/exceptions/ThrowerAMDI.cs index d06413692c3..3a7823f49ac 100644 --- a/csharp/test/Ice/exceptions/ThrowerAMDI.cs +++ b/csharp/test/Ice/exceptions/ThrowerAMDI.cs @@ -1,9 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/exceptions/ThrowerI.cs b/csharp/test/Ice/exceptions/ThrowerI.cs index 73cb67f67e5..9bf84004c1a 100644 --- a/csharp/test/Ice/exceptions/ThrowerI.cs +++ b/csharp/test/Ice/exceptions/ThrowerI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; diff --git a/csharp/test/Ice/facets/AI.cs b/csharp/test/Ice/facets/AI.cs index b925256f7f0..2fdf644b609 100644 --- a/csharp/test/Ice/facets/AI.cs +++ b/csharp/test/Ice/facets/AI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/facets/AllTests.cs b/csharp/test/Ice/facets/AllTests.cs index fb2eae8dfc8..b677a35a3b3 100644 --- a/csharp/test/Ice/facets/AllTests.cs +++ b/csharp/test/Ice/facets/AllTests.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/facets/BI.cs b/csharp/test/Ice/facets/BI.cs index 2575aa33258..8b3baab73ab 100644 --- a/csharp/test/Ice/facets/BI.cs +++ b/csharp/test/Ice/facets/BI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/facets/CI.cs b/csharp/test/Ice/facets/CI.cs index 7c7deb07264..63b84f42bab 100644 --- a/csharp/test/Ice/facets/CI.cs +++ b/csharp/test/Ice/facets/CI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/facets/Client.cs b/csharp/test/Ice/facets/Client.cs index 011209951c8..a53e0b0e201 100644 --- a/csharp/test/Ice/facets/Client.cs +++ b/csharp/test/Ice/facets/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/facets/Collocated.cs b/csharp/test/Ice/facets/Collocated.cs index 0f76b55acef..2e8e49c9d31 100644 --- a/csharp/test/Ice/facets/Collocated.cs +++ b/csharp/test/Ice/facets/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/facets/DI.cs b/csharp/test/Ice/facets/DI.cs index 2e13d7e13d6..85ddc5d7a50 100644 --- a/csharp/test/Ice/facets/DI.cs +++ b/csharp/test/Ice/facets/DI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/facets/EI.cs b/csharp/test/Ice/facets/EI.cs index dd8586c8513..e24c203efe8 100644 --- a/csharp/test/Ice/facets/EI.cs +++ b/csharp/test/Ice/facets/EI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/facets/EmptyI.cs b/csharp/test/Ice/facets/EmptyI.cs index c97f4063141..800a660e661 100644 --- a/csharp/test/Ice/facets/EmptyI.cs +++ b/csharp/test/Ice/facets/EmptyI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/facets/FI.cs b/csharp/test/Ice/facets/FI.cs index c28f0d2ebb7..aafd4aa3d51 100644 --- a/csharp/test/Ice/facets/FI.cs +++ b/csharp/test/Ice/facets/FI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/facets/GI.cs b/csharp/test/Ice/facets/GI.cs index 517f63ddde7..6817c1c3f71 100644 --- a/csharp/test/Ice/facets/GI.cs +++ b/csharp/test/Ice/facets/GI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/facets/HI.cs b/csharp/test/Ice/facets/HI.cs index 854dc23245d..2c85d6951df 100644 --- a/csharp/test/Ice/facets/HI.cs +++ b/csharp/test/Ice/facets/HI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/facets/Server.cs b/csharp/test/Ice/facets/Server.cs index d052a850ba3..7d21e1ac70c 100644 --- a/csharp/test/Ice/facets/Server.cs +++ b/csharp/test/Ice/facets/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/faultTolerance/AllTests.cs b/csharp/test/Ice/faultTolerance/AllTests.cs index 787ced1b29d..58e2ba30ef8 100644 --- a/csharp/test/Ice/faultTolerance/AllTests.cs +++ b/csharp/test/Ice/faultTolerance/AllTests.cs @@ -1,12 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.IO; -using System.Threading.Tasks; using Test; public class AllTests : Test.AllTests diff --git a/csharp/test/Ice/faultTolerance/Client.cs b/csharp/test/Ice/faultTolerance/Client.cs index 616fe9c8aa3..e53d6d05751 100644 --- a/csharp/test/Ice/faultTolerance/Client.cs +++ b/csharp/test/Ice/faultTolerance/Client.cs @@ -1,12 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; -using System.Linq; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/faultTolerance/Server.cs b/csharp/test/Ice/faultTolerance/Server.cs index f83e9f83861..9245be5288a 100644 --- a/csharp/test/Ice/faultTolerance/Server.cs +++ b/csharp/test/Ice/faultTolerance/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/faultTolerance/TestI.cs b/csharp/test/Ice/faultTolerance/TestI.cs index c0c5b7a6757..a3c34388299 100644 --- a/csharp/test/Ice/faultTolerance/TestI.cs +++ b/csharp/test/Ice/faultTolerance/TestI.cs @@ -1,9 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; -using System.Threading; using Test; public sealed class TestI : TestIntfDisp_ diff --git a/csharp/test/Ice/hash/Client.cs b/csharp/test/Ice/hash/Client.cs index f2a529cc179..f1a27b04323 100644 --- a/csharp/test/Ice/hash/Client.cs +++ b/csharp/test/Ice/hash/Client.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/hold/AllTests.cs b/csharp/test/Ice/hold/AllTests.cs index 65bbc4a48fb..25206993126 100644 --- a/csharp/test/Ice/hold/AllTests.cs +++ b/csharp/test/Ice/hold/AllTests.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/hold/Client.cs b/csharp/test/Ice/hold/Client.cs index bb42c4ffc81..65c59f162cd 100644 --- a/csharp/test/Ice/hold/Client.cs +++ b/csharp/test/Ice/hold/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/hold/HoldI.cs b/csharp/test/Ice/hold/HoldI.cs index 6614b82c93d..4ac972583a4 100644 --- a/csharp/test/Ice/hold/HoldI.cs +++ b/csharp/test/Ice/hold/HoldI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/hold/Server.cs b/csharp/test/Ice/hold/Server.cs index bf33f08fca2..1946afa62e3 100644 --- a/csharp/test/Ice/hold/Server.cs +++ b/csharp/test/Ice/hold/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/hold/Timer.cs b/csharp/test/Ice/hold/Timer.cs index 18369b22a7d..875f60c5099 100644 --- a/csharp/test/Ice/hold/Timer.cs +++ b/csharp/test/Ice/hold/Timer.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; // // TODO replace with System.Timers.Timer diff --git a/csharp/test/Ice/info/AllTests.cs b/csharp/test/Ice/info/AllTests.cs index 991a9d91834..fab21455134 100644 --- a/csharp/test/Ice/info/AllTests.cs +++ b/csharp/test/Ice/info/AllTests.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/info/Client.cs b/csharp/test/Ice/info/Client.cs index 29f37514b7f..49ce3fae67d 100644 --- a/csharp/test/Ice/info/Client.cs +++ b/csharp/test/Ice/info/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/info/Server.cs b/csharp/test/Ice/info/Server.cs index b1035a90e49..fac774d34d8 100644 --- a/csharp/test/Ice/info/Server.cs +++ b/csharp/test/Ice/info/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/info/TestI.cs b/csharp/test/Ice/info/TestI.cs index 6f93605e58e..9f7600effec 100644 --- a/csharp/test/Ice/info/TestI.cs +++ b/csharp/test/Ice/info/TestI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/inheritance/AllTests.cs b/csharp/test/Ice/inheritance/AllTests.cs index e877490b549..9c0606fa6d3 100644 --- a/csharp/test/Ice/inheritance/AllTests.cs +++ b/csharp/test/Ice/inheritance/AllTests.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/inheritance/Client.cs b/csharp/test/Ice/inheritance/Client.cs index fe1a4edf83d..36dde06484d 100644 --- a/csharp/test/Ice/inheritance/Client.cs +++ b/csharp/test/Ice/inheritance/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/inheritance/Collocated.cs b/csharp/test/Ice/inheritance/Collocated.cs index fc7c1af7da9..97ce0c0fff6 100644 --- a/csharp/test/Ice/inheritance/Collocated.cs +++ b/csharp/test/Ice/inheritance/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/inheritance/IAI.cs b/csharp/test/Ice/inheritance/IAI.cs index 073f30fc2c9..5af94c939cb 100644 --- a/csharp/test/Ice/inheritance/IAI.cs +++ b/csharp/test/Ice/inheritance/IAI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/inheritance/IB1I.cs b/csharp/test/Ice/inheritance/IB1I.cs index ff3f52aee59..72455772f92 100644 --- a/csharp/test/Ice/inheritance/IB1I.cs +++ b/csharp/test/Ice/inheritance/IB1I.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/inheritance/IB2I.cs b/csharp/test/Ice/inheritance/IB2I.cs index ec01fed09dc..9d716bbb7e6 100644 --- a/csharp/test/Ice/inheritance/IB2I.cs +++ b/csharp/test/Ice/inheritance/IB2I.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/inheritance/ICI.cs b/csharp/test/Ice/inheritance/ICI.cs index b9e286afe1e..a3991a07a20 100644 --- a/csharp/test/Ice/inheritance/ICI.cs +++ b/csharp/test/Ice/inheritance/ICI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/inheritance/InitialI.cs b/csharp/test/Ice/inheritance/InitialI.cs index ea7081d9ddb..4b5893d20fb 100644 --- a/csharp/test/Ice/inheritance/InitialI.cs +++ b/csharp/test/Ice/inheritance/InitialI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/inheritance/Server.cs b/csharp/test/Ice/inheritance/Server.cs index 8ad9473dcaa..3a3b35af69a 100644 --- a/csharp/test/Ice/inheritance/Server.cs +++ b/csharp/test/Ice/inheritance/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/interceptor/Client.cs b/csharp/test/Ice/interceptor/Client.cs index 9869a5caa7b..d5de210e0d8 100644 --- a/csharp/test/Ice/interceptor/Client.cs +++ b/csharp/test/Ice/interceptor/Client.cs @@ -1,10 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/interceptor/InterceptorI.cs b/csharp/test/Ice/interceptor/InterceptorI.cs index c5b04e6e361..0e1ae2396e2 100644 --- a/csharp/test/Ice/interceptor/InterceptorI.cs +++ b/csharp/test/Ice/interceptor/InterceptorI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/interceptor/MyObjectI.cs b/csharp/test/Ice/interceptor/MyObjectI.cs index 6030a41e8fb..484b9754ec1 100644 --- a/csharp/test/Ice/interceptor/MyObjectI.cs +++ b/csharp/test/Ice/interceptor/MyObjectI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/invoke/AllTests.cs b/csharp/test/Ice/invoke/AllTests.cs index 5da644d0188..54a24f1ce3f 100644 --- a/csharp/test/Ice/invoke/AllTests.cs +++ b/csharp/test/Ice/invoke/AllTests.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/invoke/BlobjectI.cs b/csharp/test/Ice/invoke/BlobjectI.cs index c6a10370c54..82cb029368e 100644 --- a/csharp/test/Ice/invoke/BlobjectI.cs +++ b/csharp/test/Ice/invoke/BlobjectI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/invoke/Client.cs b/csharp/test/Ice/invoke/Client.cs index 8f39922a734..6b3819f97bc 100644 --- a/csharp/test/Ice/invoke/Client.cs +++ b/csharp/test/Ice/invoke/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/invoke/Server.cs b/csharp/test/Ice/invoke/Server.cs index d76b44b4209..cbc7ad1c686 100644 --- a/csharp/test/Ice/invoke/Server.cs +++ b/csharp/test/Ice/invoke/Server.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Linq; -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/location/AllTests.cs b/csharp/test/Ice/location/AllTests.cs index d95b3249b78..3f19cda4f56 100644 --- a/csharp/test/Ice/location/AllTests.cs +++ b/csharp/test/Ice/location/AllTests.cs @@ -1,10 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/location/Client.cs b/csharp/test/Ice/location/Client.cs index daedc858adf..284a1bf8172 100644 --- a/csharp/test/Ice/location/Client.cs +++ b/csharp/test/Ice/location/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/location/HelloI.cs b/csharp/test/Ice/location/HelloI.cs index acf698663d2..a2719b8328d 100644 --- a/csharp/test/Ice/location/HelloI.cs +++ b/csharp/test/Ice/location/HelloI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/location/Server.cs b/csharp/test/Ice/location/Server.cs index 426f477e2eb..68d169a9128 100644 --- a/csharp/test/Ice/location/Server.cs +++ b/csharp/test/Ice/location/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/location/ServerLocator.cs b/csharp/test/Ice/location/ServerLocator.cs index 4202e673f9d..d497bade95f 100644 --- a/csharp/test/Ice/location/ServerLocator.cs +++ b/csharp/test/Ice/location/ServerLocator.cs @@ -1,9 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/location/ServerLocatorRegistry.cs b/csharp/test/Ice/location/ServerLocatorRegistry.cs index 24908636d22..950b6a595c4 100644 --- a/csharp/test/Ice/location/ServerLocatorRegistry.cs +++ b/csharp/test/Ice/location/ServerLocatorRegistry.cs @@ -1,9 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Collections; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/location/ServerManagerI.cs b/csharp/test/Ice/location/ServerManagerI.cs index 6f1de6d5cfd..03b9180ae02 100644 --- a/csharp/test/Ice/location/ServerManagerI.cs +++ b/csharp/test/Ice/location/ServerManagerI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Collections; diff --git a/csharp/test/Ice/location/TestI.cs b/csharp/test/Ice/location/TestI.cs index 86932084a9d..450781cdcfa 100644 --- a/csharp/test/Ice/location/TestI.cs +++ b/csharp/test/Ice/location/TestI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/logger/Client.cs b/csharp/test/Ice/logger/Client.cs index c02e81cd73d..854c1a06b01 100644 --- a/csharp/test/Ice/logger/Client.cs +++ b/csharp/test/Ice/logger/Client.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.IO; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/metrics/AllTests.cs b/csharp/test/Ice/metrics/AllTests.cs index 4654cf93396..e071ff0dc41 100644 --- a/csharp/test/Ice/metrics/AllTests.cs +++ b/csharp/test/Ice/metrics/AllTests.cs @@ -1,12 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; -using System.IO; -using System.Threading; -using System.Threading.Tasks; using Test; public class AllTests : Test.AllTests diff --git a/csharp/test/Ice/metrics/Client.cs b/csharp/test/Ice/metrics/Client.cs index 5399122dad5..7cf4bc0e9da 100644 --- a/csharp/test/Ice/metrics/Client.cs +++ b/csharp/test/Ice/metrics/Client.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/metrics/Collocated.cs b/csharp/test/Ice/metrics/Collocated.cs index 07fe7c7df46..967c8938de4 100644 --- a/csharp/test/Ice/metrics/Collocated.cs +++ b/csharp/test/Ice/metrics/Collocated.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/metrics/InstrumentationI.cs b/csharp/test/Ice/metrics/InstrumentationI.cs index 1fda521f9f5..33a13b7ec2d 100644 --- a/csharp/test/Ice/metrics/InstrumentationI.cs +++ b/csharp/test/Ice/metrics/InstrumentationI.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; public class ObserverI : Ice.Instrumentation.Observer diff --git a/csharp/test/Ice/metrics/MetricsAMDI.cs b/csharp/test/Ice/metrics/MetricsAMDI.cs index 3a5cf20ceed..8adef9cb784 100644 --- a/csharp/test/Ice/metrics/MetricsAMDI.cs +++ b/csharp/test/Ice/metrics/MetricsAMDI.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Threading.Tasks; using Test; public sealed class ControllerI : ControllerDisp_ diff --git a/csharp/test/Ice/metrics/MetricsI.cs b/csharp/test/Ice/metrics/MetricsI.cs index 0caaf49d58e..8d6bfffecdf 100644 --- a/csharp/test/Ice/metrics/MetricsI.cs +++ b/csharp/test/Ice/metrics/MetricsI.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using Test; public sealed class ControllerI : ControllerDisp_ diff --git a/csharp/test/Ice/metrics/Server.cs b/csharp/test/Ice/metrics/Server.cs index 0e871c5986d..c14db4e9767 100644 --- a/csharp/test/Ice/metrics/Server.cs +++ b/csharp/test/Ice/metrics/Server.cs @@ -1,11 +1,6 @@ +// Copyright (c) ZeroC, Inc. -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/namespacemd/AllTests.cs b/csharp/test/Ice/namespacemd/AllTests.cs index bbdcb2fe4cc..33dc780058b 100644 --- a/csharp/test/Ice/namespacemd/AllTests.cs +++ b/csharp/test/Ice/namespacemd/AllTests.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using Test; diff --git a/csharp/test/Ice/namespacemd/Client.cs b/csharp/test/Ice/namespacemd/Client.cs index 48091b72a76..dfd59f1aa4a 100644 --- a/csharp/test/Ice/namespacemd/Client.cs +++ b/csharp/test/Ice/namespacemd/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/namespacemd/InitialI.cs b/csharp/test/Ice/namespacemd/InitialI.cs index 72733708e91..ce694098174 100644 --- a/csharp/test/Ice/namespacemd/InitialI.cs +++ b/csharp/test/Ice/namespacemd/InitialI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/namespacemd/Server.cs b/csharp/test/Ice/namespacemd/Server.cs index 7fe243b799f..519cda17599 100644 --- a/csharp/test/Ice/namespacemd/Server.cs +++ b/csharp/test/Ice/namespacemd/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/networkProxy/AllTests.cs b/csharp/test/Ice/networkProxy/AllTests.cs index 1a7b6ddecc3..ed3ff186110 100644 --- a/csharp/test/Ice/networkProxy/AllTests.cs +++ b/csharp/test/Ice/networkProxy/AllTests.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. public class AllTests : Test.AllTests { diff --git a/csharp/test/Ice/networkProxy/Client.cs b/csharp/test/Ice/networkProxy/Client.cs index 2da545587d4..aa7e400f0c0 100644 --- a/csharp/test/Ice/networkProxy/Client.cs +++ b/csharp/test/Ice/networkProxy/Client.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/networkProxy/Server.cs b/csharp/test/Ice/networkProxy/Server.cs index 23cc68580ff..29affd55b3b 100644 --- a/csharp/test/Ice/networkProxy/Server.cs +++ b/csharp/test/Ice/networkProxy/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/objects/AllTests.cs b/csharp/test/Ice/objects/AllTests.cs index 6825825e0e1..b9275e14c5f 100644 --- a/csharp/test/Ice/objects/AllTests.cs +++ b/csharp/test/Ice/objects/AllTests.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; namespace Ice diff --git a/csharp/test/Ice/objects/BI.cs b/csharp/test/Ice/objects/BI.cs index 8aa1b27a3d8..12a56cf5909 100644 --- a/csharp/test/Ice/objects/BI.cs +++ b/csharp/test/Ice/objects/BI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/objects/CI.cs b/csharp/test/Ice/objects/CI.cs index c0b4ee4cfc7..ae064f44e3a 100644 --- a/csharp/test/Ice/objects/CI.cs +++ b/csharp/test/Ice/objects/CI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/objects/Client.cs b/csharp/test/Ice/objects/Client.cs index cc9a89a08ae..c1ec5a40e5c 100644 --- a/csharp/test/Ice/objects/Client.cs +++ b/csharp/test/Ice/objects/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/objects/Collocated.cs b/csharp/test/Ice/objects/Collocated.cs index 305857eba32..195aab1f08b 100644 --- a/csharp/test/Ice/objects/Collocated.cs +++ b/csharp/test/Ice/objects/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/objects/DI.cs b/csharp/test/Ice/objects/DI.cs index ffba2f1c1c2..9de624fc361 100644 --- a/csharp/test/Ice/objects/DI.cs +++ b/csharp/test/Ice/objects/DI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/objects/EI.cs b/csharp/test/Ice/objects/EI.cs index c8a938d72e2..370ef4315c4 100644 --- a/csharp/test/Ice/objects/EI.cs +++ b/csharp/test/Ice/objects/EI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/objects/F2I.cs b/csharp/test/Ice/objects/F2I.cs index f270d99b5b3..705a311505e 100644 --- a/csharp/test/Ice/objects/F2I.cs +++ b/csharp/test/Ice/objects/F2I.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/objects/FI.cs b/csharp/test/Ice/objects/FI.cs index 35ed4517f26..d40fb4f1020 100644 --- a/csharp/test/Ice/objects/FI.cs +++ b/csharp/test/Ice/objects/FI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/objects/II.cs b/csharp/test/Ice/objects/II.cs index b3f964e16d0..24f20e6969a 100644 --- a/csharp/test/Ice/objects/II.cs +++ b/csharp/test/Ice/objects/II.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/objects/InitialI.cs b/csharp/test/Ice/objects/InitialI.cs index 3897177a267..a41aba68753 100644 --- a/csharp/test/Ice/objects/InitialI.cs +++ b/csharp/test/Ice/objects/InitialI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/objects/JI.cs b/csharp/test/Ice/objects/JI.cs index e6748c59b59..fcb804c8b2b 100644 --- a/csharp/test/Ice/objects/JI.cs +++ b/csharp/test/Ice/objects/JI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/objects/Server.cs b/csharp/test/Ice/objects/Server.cs index e86904986be..bd152729880 100644 --- a/csharp/test/Ice/objects/Server.cs +++ b/csharp/test/Ice/objects/Server.cs @@ -1,9 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/objects/UnexpectedObjectExceptionTestI.cs b/csharp/test/Ice/objects/UnexpectedObjectExceptionTestI.cs index de7a136fde5..8ec1eab2157 100644 --- a/csharp/test/Ice/objects/UnexpectedObjectExceptionTestI.cs +++ b/csharp/test/Ice/objects/UnexpectedObjectExceptionTestI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/operations/AllTests.cs b/csharp/test/Ice/operations/AllTests.cs index b404dcf67cc..6de147c0a3f 100644 --- a/csharp/test/Ice/operations/AllTests.cs +++ b/csharp/test/Ice/operations/AllTests.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/operations/BatchOneways.cs b/csharp/test/Ice/operations/BatchOneways.cs index 54d4929301e..7be2a934f78 100644 --- a/csharp/test/Ice/operations/BatchOneways.cs +++ b/csharp/test/Ice/operations/BatchOneways.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/operations/BatchOnewaysAMI.cs b/csharp/test/Ice/operations/BatchOnewaysAMI.cs index bbc2053fcf8..06657e28f12 100644 --- a/csharp/test/Ice/operations/BatchOnewaysAMI.cs +++ b/csharp/test/Ice/operations/BatchOnewaysAMI.cs @@ -1,9 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/operations/Client.cs b/csharp/test/Ice/operations/Client.cs index 1297c0020d0..61c0d30c6bf 100644 --- a/csharp/test/Ice/operations/Client.cs +++ b/csharp/test/Ice/operations/Client.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/operations/Collocated.cs b/csharp/test/Ice/operations/Collocated.cs index 10cf16ab968..e2cf97c81db 100644 --- a/csharp/test/Ice/operations/Collocated.cs +++ b/csharp/test/Ice/operations/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs index 38d8cfaa092..68a0db0ea9a 100644 --- a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs @@ -1,11 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs b/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs index e2427cc8d83..b86ac38fd1e 100644 --- a/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs @@ -1,11 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/operations/MyDerivedClassI.cs b/csharp/test/Ice/operations/MyDerivedClassI.cs index 9abf64fcb64..5a993c60442 100644 --- a/csharp/test/Ice/operations/MyDerivedClassI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/operations/MyDerivedClassTieI.cs b/csharp/test/Ice/operations/MyDerivedClassTieI.cs index 46051d75899..e85a38021da 100644 --- a/csharp/test/Ice/operations/MyDerivedClassTieI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassTieI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/operations/Oneways.cs b/csharp/test/Ice/operations/Oneways.cs index e08ecb8277d..6e9a670d360 100644 --- a/csharp/test/Ice/operations/Oneways.cs +++ b/csharp/test/Ice/operations/Oneways.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/operations/OnewaysAMI.cs b/csharp/test/Ice/operations/OnewaysAMI.cs index 3e0987867d8..8adb735c99f 100644 --- a/csharp/test/Ice/operations/OnewaysAMI.cs +++ b/csharp/test/Ice/operations/OnewaysAMI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/operations/Server.cs b/csharp/test/Ice/operations/Server.cs index c28074634e3..54b99931345 100644 --- a/csharp/test/Ice/operations/Server.cs +++ b/csharp/test/Ice/operations/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/operations/ServerAMD.cs b/csharp/test/Ice/operations/ServerAMD.cs index ed6c9b504cf..fae7a1c4785 100644 --- a/csharp/test/Ice/operations/ServerAMD.cs +++ b/csharp/test/Ice/operations/ServerAMD.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/operations/ServerAMDTie.cs b/csharp/test/Ice/operations/ServerAMDTie.cs index bef5f9fc463..1d3ca218f4f 100644 --- a/csharp/test/Ice/operations/ServerAMDTie.cs +++ b/csharp/test/Ice/operations/ServerAMDTie.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/operations/ServerTie.cs b/csharp/test/Ice/operations/ServerTie.cs index 305c457ee40..5c553102ab5 100644 --- a/csharp/test/Ice/operations/ServerTie.cs +++ b/csharp/test/Ice/operations/ServerTie.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/operations/Twoways.cs b/csharp/test/Ice/operations/Twoways.cs index 890b3c00e15..980a9156e06 100644 --- a/csharp/test/Ice/operations/Twoways.cs +++ b/csharp/test/Ice/operations/Twoways.cs @@ -1,10 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; -using System.Threading; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/operations/TwowaysAMI.cs b/csharp/test/Ice/operations/TwowaysAMI.cs index 795e2da994a..81b6d64f6be 100644 --- a/csharp/test/Ice/operations/TwowaysAMI.cs +++ b/csharp/test/Ice/operations/TwowaysAMI.cs @@ -1,10 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/optional/AllTests.cs b/csharp/test/Ice/optional/AllTests.cs index e05df3d711b..75c9fe2192a 100644 --- a/csharp/test/Ice/optional/AllTests.cs +++ b/csharp/test/Ice/optional/AllTests.cs @@ -1,10 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/optional/Client.cs b/csharp/test/Ice/optional/Client.cs index fb14c43c630..fe33f045ab5 100644 --- a/csharp/test/Ice/optional/Client.cs +++ b/csharp/test/Ice/optional/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/optional/Server.cs b/csharp/test/Ice/optional/Server.cs index 84c48dc3fd4..fa95e2d9f3c 100644 --- a/csharp/test/Ice/optional/Server.cs +++ b/csharp/test/Ice/optional/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/optional/ServerAMD.cs b/csharp/test/Ice/optional/ServerAMD.cs index 5af806c3863..ea8409f43be 100644 --- a/csharp/test/Ice/optional/ServerAMD.cs +++ b/csharp/test/Ice/optional/ServerAMD.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/optional/TestAMDI.cs b/csharp/test/Ice/optional/TestAMDI.cs index 7143149ea6a..eec672f9382 100644 --- a/csharp/test/Ice/optional/TestAMDI.cs +++ b/csharp/test/Ice/optional/TestAMDI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/optional/TestI.cs b/csharp/test/Ice/optional/TestI.cs index e77f5ea8942..0a0c4a639f3 100644 --- a/csharp/test/Ice/optional/TestI.cs +++ b/csharp/test/Ice/optional/TestI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/plugin/BasePlugin.cs b/csharp/test/Ice/plugin/BasePlugin.cs index 37314c3b508..5274e5d5b1b 100644 --- a/csharp/test/Ice/plugin/BasePlugin.cs +++ b/csharp/test/Ice/plugin/BasePlugin.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. public abstract class BasePlugin : Ice.Plugin { diff --git a/csharp/test/Ice/plugin/BasePluginFail.cs b/csharp/test/Ice/plugin/BasePluginFail.cs index 86f582ad941..2fb91ac5a42 100644 --- a/csharp/test/Ice/plugin/BasePluginFail.cs +++ b/csharp/test/Ice/plugin/BasePluginFail.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. public abstract class BasePluginFail : Ice.Plugin { diff --git a/csharp/test/Ice/plugin/Client.cs b/csharp/test/Ice/plugin/Client.cs index 07bfa9c0aec..f7d87ef9f52 100644 --- a/csharp/test/Ice/plugin/Client.cs +++ b/csharp/test/Ice/plugin/Client.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/plugin/PluginFactory.cs b/csharp/test/Ice/plugin/PluginFactory.cs index 602b8c0e6c7..2cde4648c0c 100644 --- a/csharp/test/Ice/plugin/PluginFactory.cs +++ b/csharp/test/Ice/plugin/PluginFactory.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; +// Copyright (c) ZeroC, Inc. public class PluginFactory : Ice.PluginFactory { diff --git a/csharp/test/Ice/plugin/PluginInitializeFailException.cs b/csharp/test/Ice/plugin/PluginInitializeFailException.cs index a75336772df..fbec575730d 100644 --- a/csharp/test/Ice/plugin/PluginInitializeFailException.cs +++ b/csharp/test/Ice/plugin/PluginInitializeFailException.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. public class PluginInitializeFailException : System.Exception { diff --git a/csharp/test/Ice/plugin/PluginInitializeFailFactory.cs b/csharp/test/Ice/plugin/PluginInitializeFailFactory.cs index 8ecb2b4016c..97ed300626e 100644 --- a/csharp/test/Ice/plugin/PluginInitializeFailFactory.cs +++ b/csharp/test/Ice/plugin/PluginInitializeFailFactory.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. public class PluginInitializeFailFactory : Ice.PluginFactory { diff --git a/csharp/test/Ice/plugin/PluginOneFactory.cs b/csharp/test/Ice/plugin/PluginOneFactory.cs index e046b525b0a..60cccbef1a5 100644 --- a/csharp/test/Ice/plugin/PluginOneFactory.cs +++ b/csharp/test/Ice/plugin/PluginOneFactory.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. public class PluginOneFactory : Ice.PluginFactory { diff --git a/csharp/test/Ice/plugin/PluginOneFailFactory.cs b/csharp/test/Ice/plugin/PluginOneFailFactory.cs index 6febc297fe4..2be585d6d44 100644 --- a/csharp/test/Ice/plugin/PluginOneFailFactory.cs +++ b/csharp/test/Ice/plugin/PluginOneFailFactory.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; +// Copyright (c) ZeroC, Inc. public class PluginOneFailFactory : Ice.PluginFactory { diff --git a/csharp/test/Ice/plugin/PluginThreeFactory.cs b/csharp/test/Ice/plugin/PluginThreeFactory.cs index 636fb12f0d2..b8be776d160 100644 --- a/csharp/test/Ice/plugin/PluginThreeFactory.cs +++ b/csharp/test/Ice/plugin/PluginThreeFactory.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. public class PluginThreeFactory : Ice.PluginFactory { diff --git a/csharp/test/Ice/plugin/PluginThreeFailFactory.cs b/csharp/test/Ice/plugin/PluginThreeFailFactory.cs index ba9cbb3776c..5bcd7c49a3b 100644 --- a/csharp/test/Ice/plugin/PluginThreeFailFactory.cs +++ b/csharp/test/Ice/plugin/PluginThreeFailFactory.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; +// Copyright (c) ZeroC, Inc. public class PluginThreeFailFactory : Ice.PluginFactory { diff --git a/csharp/test/Ice/plugin/PluginTwoFactory.cs b/csharp/test/Ice/plugin/PluginTwoFactory.cs index aacc732c771..38d1f2bd358 100644 --- a/csharp/test/Ice/plugin/PluginTwoFactory.cs +++ b/csharp/test/Ice/plugin/PluginTwoFactory.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. public class PluginTwoFactory : Ice.PluginFactory { diff --git a/csharp/test/Ice/plugin/PluginTwoFailFactory.cs b/csharp/test/Ice/plugin/PluginTwoFailFactory.cs index 5e06efaa513..426993fa834 100644 --- a/csharp/test/Ice/plugin/PluginTwoFailFactory.cs +++ b/csharp/test/Ice/plugin/PluginTwoFailFactory.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; +// Copyright (c) ZeroC, Inc. public class PluginTwoFailFactory : Ice.PluginFactory { diff --git a/csharp/test/Ice/properties/Client.cs b/csharp/test/Ice/properties/Client.cs index 11fa0df1350..4ef9c9f8ea4 100644 --- a/csharp/test/Ice/properties/Client.cs +++ b/csharp/test/Ice/properties/Client.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/Ice/proxy/AllTests.cs b/csharp/test/Ice/proxy/AllTests.cs index e5e1ee5244a..fa288a39ce8 100644 --- a/csharp/test/Ice/proxy/AllTests.cs +++ b/csharp/test/Ice/proxy/AllTests.cs @@ -1,10 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/proxy/Client.cs b/csharp/test/Ice/proxy/Client.cs index d08aeb28a6f..30e68c3d716 100644 --- a/csharp/test/Ice/proxy/Client.cs +++ b/csharp/test/Ice/proxy/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/proxy/Collocated.cs b/csharp/test/Ice/proxy/Collocated.cs index f23f6d4132e..2195eb0b6fc 100644 --- a/csharp/test/Ice/proxy/Collocated.cs +++ b/csharp/test/Ice/proxy/Collocated.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/proxy/MyDerivedClassAMDI.cs b/csharp/test/Ice/proxy/MyDerivedClassAMDI.cs index e7a21599440..9fa0fc925e6 100644 --- a/csharp/test/Ice/proxy/MyDerivedClassAMDI.cs +++ b/csharp/test/Ice/proxy/MyDerivedClassAMDI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/proxy/MyDerivedClassI.cs b/csharp/test/Ice/proxy/MyDerivedClassI.cs index dc442a6937d..28c4ede7355 100644 --- a/csharp/test/Ice/proxy/MyDerivedClassI.cs +++ b/csharp/test/Ice/proxy/MyDerivedClassI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/proxy/Server.cs b/csharp/test/Ice/proxy/Server.cs index a6f665b6e8a..8103c04f29a 100644 --- a/csharp/test/Ice/proxy/Server.cs +++ b/csharp/test/Ice/proxy/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/proxy/ServerAMD.cs b/csharp/test/Ice/proxy/ServerAMD.cs index 9490971057c..207eddf3d1f 100644 --- a/csharp/test/Ice/proxy/ServerAMD.cs +++ b/csharp/test/Ice/proxy/ServerAMD.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/retry/AllTests.cs b/csharp/test/Ice/retry/AllTests.cs index 4249714df4c..839cc70c0d0 100644 --- a/csharp/test/Ice/retry/AllTests.cs +++ b/csharp/test/Ice/retry/AllTests.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/retry/Client.cs b/csharp/test/Ice/retry/Client.cs index 54fe95ece78..858bd672dd5 100644 --- a/csharp/test/Ice/retry/Client.cs +++ b/csharp/test/Ice/retry/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/retry/Collocated.cs b/csharp/test/Ice/retry/Collocated.cs index 8e65f03ae98..f3a52ef57af 100644 --- a/csharp/test/Ice/retry/Collocated.cs +++ b/csharp/test/Ice/retry/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/retry/Instrumentation.cs b/csharp/test/Ice/retry/Instrumentation.cs index a1af9a1f676..fa4e69737fe 100644 --- a/csharp/test/Ice/retry/Instrumentation.cs +++ b/csharp/test/Ice/retry/Instrumentation.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/retry/RetryI.cs b/csharp/test/Ice/retry/RetryI.cs index 341b033d582..36dbdaec2c5 100644 --- a/csharp/test/Ice/retry/RetryI.cs +++ b/csharp/test/Ice/retry/RetryI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/retry/Server.cs b/csharp/test/Ice/retry/Server.cs index 0de5ab19f46..2944fd1ca85 100644 --- a/csharp/test/Ice/retry/Server.cs +++ b/csharp/test/Ice/retry/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/retry/SystemFailure.cs b/csharp/test/Ice/retry/SystemFailure.cs index 7f822ff58ac..3486bf6dd59 100644 --- a/csharp/test/Ice/retry/SystemFailure.cs +++ b/csharp/test/Ice/retry/SystemFailure.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/scope/AllTests.cs b/csharp/test/Ice/scope/AllTests.cs index 97c28f2a945..8fdc44f7ac2 100644 --- a/csharp/test/Ice/scope/AllTests.cs +++ b/csharp/test/Ice/scope/AllTests.cs @@ -1,10 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/scope/Client.cs b/csharp/test/Ice/scope/Client.cs index a0c4246838f..375cab1e8a3 100644 --- a/csharp/test/Ice/scope/Client.cs +++ b/csharp/test/Ice/scope/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/scope/Server.cs b/csharp/test/Ice/scope/Server.cs index d801c2486fe..cae642ac4ac 100644 --- a/csharp/test/Ice/scope/Server.cs +++ b/csharp/test/Ice/scope/Server.cs @@ -1,10 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/seqMapping/AllTests.cs b/csharp/test/Ice/seqMapping/AllTests.cs index 267251117b7..f48c48aa8d6 100644 --- a/csharp/test/Ice/seqMapping/AllTests.cs +++ b/csharp/test/Ice/seqMapping/AllTests.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/seqMapping/Client.cs b/csharp/test/Ice/seqMapping/Client.cs index df40f1fd9e8..837029c9abd 100644 --- a/csharp/test/Ice/seqMapping/Client.cs +++ b/csharp/test/Ice/seqMapping/Client.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/seqMapping/Collocated.cs b/csharp/test/Ice/seqMapping/Collocated.cs index 424fab0da67..862a586f31e 100644 --- a/csharp/test/Ice/seqMapping/Collocated.cs +++ b/csharp/test/Ice/seqMapping/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/seqMapping/Custom.cs b/csharp/test/Ice/seqMapping/Custom.cs index 9909a4d5f31..fc5a2731593 100644 --- a/csharp/test/Ice/seqMapping/Custom.cs +++ b/csharp/test/Ice/seqMapping/Custom.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/seqMapping/MyClassAMDI.cs b/csharp/test/Ice/seqMapping/MyClassAMDI.cs index 2792e87ff9a..1b5a6dd1ce0 100644 --- a/csharp/test/Ice/seqMapping/MyClassAMDI.cs +++ b/csharp/test/Ice/seqMapping/MyClassAMDI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/seqMapping/MyClassI.cs b/csharp/test/Ice/seqMapping/MyClassI.cs index a88f541faa4..d80a09f8d96 100644 --- a/csharp/test/Ice/seqMapping/MyClassI.cs +++ b/csharp/test/Ice/seqMapping/MyClassI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/seqMapping/Server.cs b/csharp/test/Ice/seqMapping/Server.cs index 0da550f9353..7a3c458ec68 100644 --- a/csharp/test/Ice/seqMapping/Server.cs +++ b/csharp/test/Ice/seqMapping/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/seqMapping/ServerAMD.cs b/csharp/test/Ice/seqMapping/ServerAMD.cs index 51369baa8f9..b9658af5c8a 100644 --- a/csharp/test/Ice/seqMapping/ServerAMD.cs +++ b/csharp/test/Ice/seqMapping/ServerAMD.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/seqMapping/Twoways.cs b/csharp/test/Ice/seqMapping/Twoways.cs index 6cb89a68ea6..5ed8737a94f 100644 --- a/csharp/test/Ice/seqMapping/Twoways.cs +++ b/csharp/test/Ice/seqMapping/Twoways.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/seqMapping/TwowaysAMI.cs b/csharp/test/Ice/seqMapping/TwowaysAMI.cs index a7d7b72eb4e..e3479a86ada 100644 --- a/csharp/test/Ice/seqMapping/TwowaysAMI.cs +++ b/csharp/test/Ice/seqMapping/TwowaysAMI.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/servantLocator/AllTests.cs b/csharp/test/Ice/servantLocator/AllTests.cs index 30dff4bb65f..1d9a8c100da 100644 --- a/csharp/test/Ice/servantLocator/AllTests.cs +++ b/csharp/test/Ice/servantLocator/AllTests.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/servantLocator/Client.cs b/csharp/test/Ice/servantLocator/Client.cs index bb350f9ed50..66f30a3b0c2 100644 --- a/csharp/test/Ice/servantLocator/Client.cs +++ b/csharp/test/Ice/servantLocator/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/servantLocator/Collocated.cs b/csharp/test/Ice/servantLocator/Collocated.cs index 14827d9e8f7..0869030b74b 100644 --- a/csharp/test/Ice/servantLocator/Collocated.cs +++ b/csharp/test/Ice/servantLocator/Collocated.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/servantLocator/Cookie.cs b/csharp/test/Ice/servantLocator/Cookie.cs index aa1f0fa0244..2c47d4a3921 100644 --- a/csharp/test/Ice/servantLocator/Cookie.cs +++ b/csharp/test/Ice/servantLocator/Cookie.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/servantLocator/ServantLocatorAMDI.cs b/csharp/test/Ice/servantLocator/ServantLocatorAMDI.cs index 95e3e7ebf98..426b351b056 100644 --- a/csharp/test/Ice/servantLocator/ServantLocatorAMDI.cs +++ b/csharp/test/Ice/servantLocator/ServantLocatorAMDI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/servantLocator/ServantLocatorI.cs b/csharp/test/Ice/servantLocator/ServantLocatorI.cs index d7aab6a51ec..971f8c5ff66 100644 --- a/csharp/test/Ice/servantLocator/ServantLocatorI.cs +++ b/csharp/test/Ice/servantLocator/ServantLocatorI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; +// Copyright (c) ZeroC, Inc. namespace Ice { @@ -10,7 +6,7 @@ namespace servantLocator { public sealed class ServantLocatorI : Ice.ServantLocator { - public ServantLocatorI(String category) + public ServantLocatorI(string category) { _category = category; _deactivated = false; diff --git a/csharp/test/Ice/servantLocator/Server.cs b/csharp/test/Ice/servantLocator/Server.cs index 71c7d6174a5..0a3738fa9f8 100644 --- a/csharp/test/Ice/servantLocator/Server.cs +++ b/csharp/test/Ice/servantLocator/Server.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/servantLocator/ServerAMD.cs b/csharp/test/Ice/servantLocator/ServerAMD.cs index 3b28281bed6..41e84e2fee1 100644 --- a/csharp/test/Ice/servantLocator/ServerAMD.cs +++ b/csharp/test/Ice/servantLocator/ServerAMD.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; namespace Ice diff --git a/csharp/test/Ice/servantLocator/TestAMDI.cs b/csharp/test/Ice/servantLocator/TestAMDI.cs index 30fdd6b96c1..98c3badf218 100644 --- a/csharp/test/Ice/servantLocator/TestAMDI.cs +++ b/csharp/test/Ice/servantLocator/TestAMDI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/servantLocator/TestActivationAMDI.cs b/csharp/test/Ice/servantLocator/TestActivationAMDI.cs index 9b50adb1adf..16b50bc2d1f 100644 --- a/csharp/test/Ice/servantLocator/TestActivationAMDI.cs +++ b/csharp/test/Ice/servantLocator/TestActivationAMDI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/servantLocator/TestActivationI.cs b/csharp/test/Ice/servantLocator/TestActivationI.cs index fd176bbf5f5..c4ab139824e 100644 --- a/csharp/test/Ice/servantLocator/TestActivationI.cs +++ b/csharp/test/Ice/servantLocator/TestActivationI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/servantLocator/TestI.cs b/csharp/test/Ice/servantLocator/TestI.cs index d51f96fb552..6ea3f8eea88 100644 --- a/csharp/test/Ice/servantLocator/TestI.cs +++ b/csharp/test/Ice/servantLocator/TestI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/slicing/exceptions/AllTests.cs b/csharp/test/Ice/slicing/exceptions/AllTests.cs index 2204646143a..ed0db3d1253 100644 --- a/csharp/test/Ice/slicing/exceptions/AllTests.cs +++ b/csharp/test/Ice/slicing/exceptions/AllTests.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; using Test; public class AllTests : Test.AllTests diff --git a/csharp/test/Ice/slicing/exceptions/Client.cs b/csharp/test/Ice/slicing/exceptions/Client.cs index 03954541d60..14e2a0b4218 100644 --- a/csharp/test/Ice/slicing/exceptions/Client.cs +++ b/csharp/test/Ice/slicing/exceptions/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; public class Client : Test.TestHelper diff --git a/csharp/test/Ice/slicing/exceptions/Server.cs b/csharp/test/Ice/slicing/exceptions/Server.cs index fc7fdbbecaa..75a15a30990 100644 --- a/csharp/test/Ice/slicing/exceptions/Server.cs +++ b/csharp/test/Ice/slicing/exceptions/Server.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. public class Server : Test.TestHelper { diff --git a/csharp/test/Ice/slicing/exceptions/ServerAMD.cs b/csharp/test/Ice/slicing/exceptions/ServerAMD.cs index 93421e5b347..a524391f5c9 100644 --- a/csharp/test/Ice/slicing/exceptions/ServerAMD.cs +++ b/csharp/test/Ice/slicing/exceptions/ServerAMD.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. public class Server : Test.TestHelper { diff --git a/csharp/test/Ice/slicing/exceptions/TestAMDI.cs b/csharp/test/Ice/slicing/exceptions/TestAMDI.cs index 65885e49f69..072711c451b 100644 --- a/csharp/test/Ice/slicing/exceptions/TestAMDI.cs +++ b/csharp/test/Ice/slicing/exceptions/TestAMDI.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; public sealed class TestI : TestIntfDisp_ diff --git a/csharp/test/Ice/slicing/exceptions/TestI.cs b/csharp/test/Ice/slicing/exceptions/TestI.cs index df6e622f776..4cd3f963d1f 100644 --- a/csharp/test/Ice/slicing/exceptions/TestI.cs +++ b/csharp/test/Ice/slicing/exceptions/TestI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using Test; diff --git a/csharp/test/Ice/slicing/objects/AllTests.cs b/csharp/test/Ice/slicing/objects/AllTests.cs index 4cb2e49a173..84639c94741 100644 --- a/csharp/test/Ice/slicing/objects/AllTests.cs +++ b/csharp/test/Ice/slicing/objects/AllTests.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using System.Diagnostics; using Test; diff --git a/csharp/test/Ice/slicing/objects/Client.cs b/csharp/test/Ice/slicing/objects/Client.cs index e83423715b1..ebf55735e9d 100644 --- a/csharp/test/Ice/slicing/objects/Client.cs +++ b/csharp/test/Ice/slicing/objects/Client.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Threading.Tasks; using Test; public class Client : Test.TestHelper diff --git a/csharp/test/Ice/slicing/objects/Server.cs b/csharp/test/Ice/slicing/objects/Server.cs index 93421e5b347..a524391f5c9 100644 --- a/csharp/test/Ice/slicing/objects/Server.cs +++ b/csharp/test/Ice/slicing/objects/Server.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. public class Server : Test.TestHelper { diff --git a/csharp/test/Ice/slicing/objects/ServerAMD.cs b/csharp/test/Ice/slicing/objects/ServerAMD.cs index fc7fdbbecaa..75a15a30990 100644 --- a/csharp/test/Ice/slicing/objects/ServerAMD.cs +++ b/csharp/test/Ice/slicing/objects/ServerAMD.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. public class Server : Test.TestHelper { diff --git a/csharp/test/Ice/slicing/objects/TestAMDI.cs b/csharp/test/Ice/slicing/objects/TestAMDI.cs index 057a6c085ff..84e4933fd18 100644 --- a/csharp/test/Ice/slicing/objects/TestAMDI.cs +++ b/csharp/test/Ice/slicing/objects/TestAMDI.cs @@ -1,10 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Test; public sealed class TestI : TestIntfDisp_ diff --git a/csharp/test/Ice/slicing/objects/TestI.cs b/csharp/test/Ice/slicing/objects/TestI.cs index 1f4a09d12d1..8f584ffbc3d 100644 --- a/csharp/test/Ice/slicing/objects/TestI.cs +++ b/csharp/test/Ice/slicing/objects/TestI.cs @@ -1,10 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Test; public sealed class TestI : TestIntfDisp_ diff --git a/csharp/test/Ice/stream/AllTests.cs b/csharp/test/Ice/stream/AllTests.cs index a4705f3865b..79d3e91197d 100644 --- a/csharp/test/Ice/stream/AllTests.cs +++ b/csharp/test/Ice/stream/AllTests.cs @@ -1,9 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Collections; -using System.Collections.Generic; using System.Diagnostics; namespace Ice diff --git a/csharp/test/Ice/stream/Client.cs b/csharp/test/Ice/stream/Client.cs index ee9359c5775..1af080f9dab 100644 --- a/csharp/test/Ice/stream/Client.cs +++ b/csharp/test/Ice/stream/Client.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/threadPoolPriority/Client.cs b/csharp/test/Ice/threadPoolPriority/Client.cs index 2636f54836e..2128fe95938 100644 --- a/csharp/test/Ice/threadPoolPriority/Client.cs +++ b/csharp/test/Ice/threadPoolPriority/Client.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/threadPoolPriority/PriorityI.cs b/csharp/test/Ice/threadPoolPriority/PriorityI.cs index 19d33f83582..ab38a249d23 100644 --- a/csharp/test/Ice/threadPoolPriority/PriorityI.cs +++ b/csharp/test/Ice/threadPoolPriority/PriorityI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/threadPoolPriority/Server.cs b/csharp/test/Ice/threadPoolPriority/Server.cs index 17b80325e32..72264772975 100644 --- a/csharp/test/Ice/threadPoolPriority/Server.cs +++ b/csharp/test/Ice/threadPoolPriority/Server.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/timeout/AllTests.cs b/csharp/test/Ice/timeout/AllTests.cs index 8053782adec..1fa2bb30055 100644 --- a/csharp/test/Ice/timeout/AllTests.cs +++ b/csharp/test/Ice/timeout/AllTests.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/timeout/Client.cs b/csharp/test/Ice/timeout/Client.cs index 2dca5267847..bcd269c40cc 100644 --- a/csharp/test/Ice/timeout/Client.cs +++ b/csharp/test/Ice/timeout/Client.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/timeout/Server.cs b/csharp/test/Ice/timeout/Server.cs index ce78dd60eed..61441a1082c 100644 --- a/csharp/test/Ice/timeout/Server.cs +++ b/csharp/test/Ice/timeout/Server.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/timeout/TestI.cs b/csharp/test/Ice/timeout/TestI.cs index 346c28f027d..36d1f590d2b 100644 --- a/csharp/test/Ice/timeout/TestI.cs +++ b/csharp/test/Ice/timeout/TestI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Threading; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/udp/AllTests.cs b/csharp/test/Ice/udp/AllTests.cs index ef083666ad9..a44a22cb1b5 100644 --- a/csharp/test/Ice/udp/AllTests.cs +++ b/csharp/test/Ice/udp/AllTests.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Text; namespace Ice diff --git a/csharp/test/Ice/udp/Client.cs b/csharp/test/Ice/udp/Client.cs index db2c01e42aa..867e90973c7 100644 --- a/csharp/test/Ice/udp/Client.cs +++ b/csharp/test/Ice/udp/Client.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. namespace Ice { diff --git a/csharp/test/Ice/udp/Server.cs b/csharp/test/Ice/udp/Server.cs index eddba37f501..56981f53742 100644 --- a/csharp/test/Ice/udp/Server.cs +++ b/csharp/test/Ice/udp/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Text; -using System.Threading.Tasks; namespace Ice { diff --git a/csharp/test/Ice/udp/TestIntfI.cs b/csharp/test/Ice/udp/TestIntfI.cs index c4406d4784b..66f8eb8a7c0 100644 --- a/csharp/test/Ice/udp/TestIntfI.cs +++ b/csharp/test/Ice/udp/TestIntfI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using System.Diagnostics; diff --git a/csharp/test/IceBox/admin/AllTests.cs b/csharp/test/IceBox/admin/AllTests.cs index dee1a51621c..fccbd85a940 100644 --- a/csharp/test/IceBox/admin/AllTests.cs +++ b/csharp/test/IceBox/admin/AllTests.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. using Test; diff --git a/csharp/test/IceBox/admin/Client.cs b/csharp/test/IceBox/admin/Client.cs index b4f89e460d1..e606883c5e6 100644 --- a/csharp/test/IceBox/admin/Client.cs +++ b/csharp/test/IceBox/admin/Client.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/IceBox/admin/TestI.cs b/csharp/test/IceBox/admin/TestI.cs index 3d21401211f..a4838314e8c 100644 --- a/csharp/test/IceBox/admin/TestI.cs +++ b/csharp/test/IceBox/admin/TestI.cs @@ -1,8 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System.Collections.Generic; +// Copyright (c) ZeroC, Inc. using Test; diff --git a/csharp/test/IceBox/admin/TestServiceI.cs b/csharp/test/IceBox/admin/TestServiceI.cs index 86ffb1e1e3f..9af4e074a2c 100644 --- a/csharp/test/IceBox/admin/TestServiceI.cs +++ b/csharp/test/IceBox/admin/TestServiceI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. public class TestServiceI : IceBox.Service { diff --git a/csharp/test/IceBox/configuration/AllTests.cs b/csharp/test/IceBox/configuration/AllTests.cs index 97bc9d77b65..cfcaaa6e95b 100644 --- a/csharp/test/IceBox/configuration/AllTests.cs +++ b/csharp/test/IceBox/configuration/AllTests.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using Test; public class AllTests : Test.AllTests diff --git a/csharp/test/IceBox/configuration/Client.cs b/csharp/test/IceBox/configuration/Client.cs index b4f89e460d1..e606883c5e6 100644 --- a/csharp/test/IceBox/configuration/Client.cs +++ b/csharp/test/IceBox/configuration/Client.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/IceBox/configuration/TestI.cs b/csharp/test/IceBox/configuration/TestI.cs index b4bde228cd6..574a0665d59 100644 --- a/csharp/test/IceBox/configuration/TestI.cs +++ b/csharp/test/IceBox/configuration/TestI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. using Test; diff --git a/csharp/test/IceBox/configuration/TestServiceI.cs b/csharp/test/IceBox/configuration/TestServiceI.cs index 8ffd5c3868b..c6e556d2469 100644 --- a/csharp/test/IceBox/configuration/TestServiceI.cs +++ b/csharp/test/IceBox/configuration/TestServiceI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. internal class TestServiceI : IceBox.Service { diff --git a/csharp/test/IceDiscovery/simple/AllTests.cs b/csharp/test/IceDiscovery/simple/AllTests.cs index 26f2f414ab3..b2126322c60 100644 --- a/csharp/test/IceDiscovery/simple/AllTests.cs +++ b/csharp/test/IceDiscovery/simple/AllTests.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; using Test; public class AllTests : Test.AllTests diff --git a/csharp/test/IceDiscovery/simple/Client.cs b/csharp/test/IceDiscovery/simple/Client.cs index a4769e7c6ae..69e62491fcc 100644 --- a/csharp/test/IceDiscovery/simple/Client.cs +++ b/csharp/test/IceDiscovery/simple/Client.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/IceDiscovery/simple/Server.cs b/csharp/test/IceDiscovery/simple/Server.cs index 8243f31560e..7374b0cee2b 100644 --- a/csharp/test/IceDiscovery/simple/Server.cs +++ b/csharp/test/IceDiscovery/simple/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/IceDiscovery/simple/TestI.cs b/csharp/test/IceDiscovery/simple/TestI.cs index cd1833c9209..c026a6e0fea 100644 --- a/csharp/test/IceDiscovery/simple/TestI.cs +++ b/csharp/test/IceDiscovery/simple/TestI.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System.Collections.Generic; using System.Diagnostics; public sealed class ControllerI : Test.ControllerDisp_ diff --git a/csharp/test/IceGrid/simple/AllTests.cs b/csharp/test/IceGrid/simple/AllTests.cs index 47f8c462e7b..45f6a334a95 100644 --- a/csharp/test/IceGrid/simple/AllTests.cs +++ b/csharp/test/IceGrid/simple/AllTests.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using Test; public class AllTests : Test.AllTests diff --git a/csharp/test/IceGrid/simple/Client.cs b/csharp/test/IceGrid/simple/Client.cs index da7f7cb2916..7732685b536 100644 --- a/csharp/test/IceGrid/simple/Client.cs +++ b/csharp/test/IceGrid/simple/Client.cs @@ -1,11 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Linq; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/IceGrid/simple/Server.cs b/csharp/test/IceGrid/simple/Server.cs index c9affa6a029..f8981054c24 100644 --- a/csharp/test/IceGrid/simple/Server.cs +++ b/csharp/test/IceGrid/simple/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/IceGrid/simple/TestI.cs b/csharp/test/IceGrid/simple/TestI.cs index ee98db8d3e2..fbc535e22e6 100644 --- a/csharp/test/IceGrid/simple/TestI.cs +++ b/csharp/test/IceGrid/simple/TestI.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. public sealed class TestI : Test.TestIntfDisp_ { diff --git a/csharp/test/IceSSL/configuration/AllTests.cs b/csharp/test/IceSSL/configuration/AllTests.cs index fc71719260e..5572b9a16dc 100644 --- a/csharp/test/IceSSL/configuration/AllTests.cs +++ b/csharp/test/IceSSL/configuration/AllTests.cs @@ -1,19 +1,12 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. // // NOTE: This test is not interoperable with other language mappings. // -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; using System.Net.Security; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; -using System.Threading; using Test; public class AllTests diff --git a/csharp/test/IceSSL/configuration/Client.cs b/csharp/test/IceSSL/configuration/Client.cs index e8b5bd8d77f..601df71255c 100644 --- a/csharp/test/IceSSL/configuration/Client.cs +++ b/csharp/test/IceSSL/configuration/Client.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/IceSSL/configuration/Server.cs b/csharp/test/IceSSL/configuration/Server.cs index 148084ff15d..2423602acad 100644 --- a/csharp/test/IceSSL/configuration/Server.cs +++ b/csharp/test/IceSSL/configuration/Server.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Reflection; -using System.Threading.Tasks; [assembly: CLSCompliant(true)] diff --git a/csharp/test/IceSSL/configuration/TestI.cs b/csharp/test/IceSSL/configuration/TestI.cs index e33295beaad..f7b9ff6f15e 100644 --- a/csharp/test/IceSSL/configuration/TestI.cs +++ b/csharp/test/IceSSL/configuration/TestI.cs @@ -1,10 +1,6 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Collections; -using System.Collections.Generic; using Test; internal sealed class ServerI : ServerDisp_ diff --git a/csharp/test/IceUtil/inputUtil/Client.cs b/csharp/test/IceUtil/inputUtil/Client.cs index 3feb9e4f783..36f9fedc44b 100644 --- a/csharp/test/IceUtil/inputUtil/Client.cs +++ b/csharp/test/IceUtil/inputUtil/Client.cs @@ -1,9 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. public class Client : Test.TestHelper { diff --git a/csharp/test/Slice/escape/Client.cs b/csharp/test/Slice/escape/Client.cs index 5eb0e4adc35..de430f94d10 100644 --- a/csharp/test/Slice/escape/Client.cs +++ b/csharp/test/Slice/escape/Client.cs @@ -1,10 +1,4 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; +// Copyright (c) ZeroC, Inc. public class Client : Test.TestHelper { diff --git a/csharp/test/Slice/macros/Client.cs b/csharp/test/Slice/macros/Client.cs index 494cce53228..2ae85a37662 100644 --- a/csharp/test/Slice/macros/Client.cs +++ b/csharp/test/Slice/macros/Client.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Threading.Tasks; using Test; public class Client : TestHelper diff --git a/csharp/test/Slice/structure/Client.cs b/csharp/test/Slice/structure/Client.cs index d9723f98b48..25087369277 100644 --- a/csharp/test/Slice/structure/Client.cs +++ b/csharp/test/Slice/structure/Client.cs @@ -1,10 +1,5 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Test; public class Client : TestHelper diff --git a/csharp/test/TestCommon/TestHelper.cs b/csharp/test/TestCommon/TestHelper.cs index 0204ff0d8e2..06d65027bb8 100644 --- a/csharp/test/TestCommon/TestHelper.cs +++ b/csharp/test/TestCommon/TestHelper.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +// Copyright (c) ZeroC, Inc. -using System; using System.Diagnostics; -using System.IO; using System.Text; -using System.Threading.Tasks; namespace Test { From 611371f5b48db1448e3123211cb46949ad102b12 Mon Sep 17 00:00:00 2001 From: Austin Henriksen Date: Thu, 4 Apr 2024 10:31:08 -0400 Subject: [PATCH 03/13] Add Test to Ensure we Only Validate Metadata for the Current Language. (#2022) --- cpp/test/Slice/errorDetection/WarningInvalidMetaData.err | 5 +++-- cpp/test/Slice/errorDetection/WarningInvalidMetaData.ice | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cpp/test/Slice/errorDetection/WarningInvalidMetaData.err b/cpp/test/Slice/errorDetection/WarningInvalidMetaData.err index 8df97ea53a1..2033070f198 100644 --- a/cpp/test/Slice/errorDetection/WarningInvalidMetaData.err +++ b/cpp/test/Slice/errorDetection/WarningInvalidMetaData.err @@ -16,5 +16,6 @@ WarningInvalidMetaData.ice:42: warning: ignoring invalid metadata `cpp:view-type WarningInvalidMetaData.ice:47: warning: ignoring invalid metadata `cpp:const' WarningInvalidMetaData.ice:47: warning: ignoring invalid metadata `cpp:ice_print' WarningInvalidMetaData.ice:53: warning: ignoring invalid metadata `cpp:virtual' -WarningInvalidMetaData.ice:58: warning: ignoring invalid metadata `cpp98:foo' -WarningInvalidMetaData.ice:58: warning: ignoring invalid metadata `cpp11:bar' +WarningInvalidMetaData.ice:58: warning: ignoring invalid metadata `cpp:bad' +WarningInvalidMetaData.ice:63: warning: ignoring invalid metadata `cpp98:foo' +WarningInvalidMetaData.ice:63: warning: ignoring invalid metadata `cpp11:bar' diff --git a/cpp/test/Slice/errorDetection/WarningInvalidMetaData.ice b/cpp/test/Slice/errorDetection/WarningInvalidMetaData.ice index 464e6d6e669..a228e6b264d 100644 --- a/cpp/test/Slice/errorDetection/WarningInvalidMetaData.ice +++ b/cpp/test/Slice/errorDetection/WarningInvalidMetaData.ice @@ -53,6 +53,11 @@ exception E { } +["bad", "cpp:bad", "java:bad"] // We only validate metadata when it has an applicable language prefix. +class C +{ +} + ["cpp98:foo", "cpp11:bar"] // The cpp98 and cpp11 attributes were removed in 3.8. We issue a friendly warning. class P { From 98f756ed09ea9b9386323f1f7b1a7f12a3c812a1 Mon Sep 17 00:00:00 2001 From: Austin Henriksen Date: Thu, 4 Apr 2024 10:31:22 -0400 Subject: [PATCH 04/13] Remove More Useless Metadata (#2023) --- cpp/src/IceGrid/Internal.ice | 26 +++--- cpp/test/Ice/operations/Oneways.cpp | 4 - cpp/test/Ice/operations/OnewaysAMI.cpp | 6 -- cpp/test/Ice/operations/Test.ice | 2 - cpp/test/Ice/operations/TestAMD.ice | 2 - cpp/test/Ice/operations/TestAMDI.cpp | 7 -- cpp/test/Ice/operations/TestAMDI.h | 2 - cpp/test/Ice/operations/TestI.cpp | 6 -- cpp/test/Ice/operations/TestI.h | 2 - cpp/test/Ice/operations/Twoways.cpp | 2 - cpp/test/Ice/operations/TwowaysAMI.cpp | 23 ----- .../Slice/errorDetection/IdentAsKeyword.err | 13 +++ .../Slice/errorDetection/IdentAsKeyword.ice | 22 ++--- .../IdentAsKeywordUnderscore.err | 69 -------------- .../IdentAsKeywordUnderscore.ice | 93 ------------------- .../test/Ice/operations/MyDerivedClassAMDI.cs | 7 -- .../Ice/operations/MyDerivedClassAMDTieI.cs | 7 -- csharp/test/Ice/operations/MyDerivedClassI.cs | 5 - .../test/Ice/operations/MyDerivedClassTieI.cs | 5 - csharp/test/Ice/operations/Oneways.cs | 4 - csharp/test/Ice/operations/OnewaysAMI.cs | 1 - csharp/test/Ice/operations/Test.ice | 2 - csharp/test/Ice/operations/TestAMD.ice | 2 - csharp/test/Ice/operations/Twoways.cs | 4 - csharp/test/Ice/operations/TwowaysAMI.cs | 4 - csharp/test/Slice/escape/Clash.ice | 2 - .../Ice/operations/AMDMyDerivedClassI.java | 6 -- .../test/Ice/operations/MyDerivedClassI.java | 5 - .../java/test/Ice/operations/Oneways.java | 1 - .../java/test/Ice/operations/OnewaysAMI.java | 13 --- .../main/java/test/Ice/operations/Test.ice | 2 - .../main/java/test/Ice/operations/TestAMD.ice | 2 - .../java/test/Ice/operations/Twoways.java | 2 - .../java/test/Ice/operations/TwowaysAMI.java | 11 --- .../src/main/java/test/Slice/escape/Clash.ice | 1 - js/test/Ice/operations/AMDMyDerivedClassI.js | 5 - js/test/Ice/operations/MyDerivedClassI.js | 5 - js/test/Ice/operations/Oneways.js | 1 - js/test/Ice/operations/Test.ice | 2 - js/test/Ice/operations/Twoways.js | 1 - js/test/Slice/escape/Clash.ice | 2 - .../Ice/operations/AMDMyDerivedClassI.ts | 5 - .../Ice/operations/MyDerivedClassI.ts | 5 - js/test/typescript/Ice/operations/Oneways.ts | 1 - js/test/typescript/Ice/operations/Test.ice | 2 - js/test/typescript/Ice/operations/Twoways.ts | 1 - matlab/test/Ice/operations/Oneways.m | 2 - matlab/test/Ice/operations/OnewaysAMI.m | 2 - matlab/test/Ice/operations/Test.ice | 2 - matlab/test/Ice/operations/Twoways.m | 2 - matlab/test/Ice/operations/TwowaysAMI.m | 2 - php/test/Ice/operations/Client.php | 4 - php/test/Ice/operations/Test.ice | 2 - php/test/Slice/escape/Clash.ice | 2 - php/test/Slice/escape/Key.ice | 2 +- python/test/Ice/operations/Oneways.py | 5 - python/test/Ice/operations/OnewaysFuture.py | 3 - python/test/Ice/operations/Test.ice | 2 - python/test/Ice/operations/TestAMDCoroI.py | 4 - python/test/Ice/operations/TestAMDI.py | 4 - python/test/Ice/operations/TestI.py | 3 - python/test/Ice/operations/Twoways.py | 5 - python/test/Ice/operations/TwowaysFuture.py | 7 -- python/test/Slice/escape/Clash.ice | 2 - ruby/test/Ice/operations/Test.ice | 2 - ruby/test/Ice/operations/Twoways.rb | 5 - ruby/test/Slice/escape/Clash.ice | 2 - ruby/test/Slice/escape/Key.ice | 2 +- slice/Glacier2/Metrics.ice | 2 - slice/Glacier2/PermissionsVerifier.ice | 4 +- slice/Glacier2/Router.ice | 6 +- slice/Ice/BuiltinSequences.ice | 2 - slice/Ice/Context.ice | 2 - slice/Ice/EndpointTypes.ice | 2 - slice/Ice/Identity.ice | 2 - slice/Ice/Locator.ice | 8 +- slice/Ice/Metrics.ice | 2 - slice/Ice/OperationMode.ice | 2 - slice/Ice/Process.ice | 2 - slice/Ice/PropertiesAdmin.ice | 2 - slice/Ice/PropertyDict.ice | 2 - slice/Ice/RemoteLogger.ice | 2 - slice/Ice/Router.ice | 6 +- slice/Ice/Version.ice | 2 - slice/IceBox/ServiceManager.ice | 2 - slice/IceDiscovery/IceDiscovery.ice | 2 - slice/IceGrid/Admin.ice | 42 ++++----- slice/IceGrid/Descriptor.ice | 2 - slice/IceGrid/Exception.ice | 2 - slice/IceGrid/FileParser.ice | 2 - slice/IceGrid/Registry.ice | 14 ++- slice/IceGrid/Session.ice | 2 - slice/IceGrid/UserAccountMapper.ice | 2 - .../IceLocatorDiscovery.ice | 2 - slice/IceStorm/IceStorm.ice | 12 +-- slice/IceStorm/Metrics.ice | 2 - swift/test/Ice/operations/Oneways.swift | 1 - swift/test/Ice/operations/OnewaysAMI.swift | 9 -- swift/test/Ice/operations/Test.ice | 2 - swift/test/Ice/operations/TestAMD.ice | 2 - swift/test/Ice/operations/TestAMDI.swift | 11 --- swift/test/Ice/operations/TestI.swift | 4 - swift/test/Ice/operations/Twoways.swift | 4 - swift/test/Slice/escape/Clash.ice | 2 - swift/test/Slice/escape/Key.ice | 1 - 105 files changed, 80 insertions(+), 551 deletions(-) delete mode 100644 cpp/test/Slice/errorDetection/IdentAsKeywordUnderscore.err delete mode 100644 cpp/test/Slice/errorDetection/IdentAsKeywordUnderscore.ice diff --git a/cpp/src/IceGrid/Internal.ice b/cpp/src/IceGrid/Internal.ice index fe736d588dc..7dd17cf85fd 100644 --- a/cpp/src/IceGrid/Internal.ice +++ b/cpp/src/IceGrid/Internal.ice @@ -120,7 +120,7 @@ interface Adapter /// Get the adapter direct proxy. The adapter direct proxy is a proxy created with the object adapter. The proxy /// contains the last known adapter endpoints. /// @return A direct proxy containing the last known adapter endpoints if the adapter is already active. - ["nonmutating", "cpp:const"] idempotent Object* getDirectProxy() + ["cpp:const"] idempotent Object* getDirectProxy() throws AdapterNotActiveException; /// Set the direct proxy for this adapter. @@ -172,7 +172,7 @@ interface Server extends FileReader void setEnabled(bool enable); /// Check if the server is enabled. - ["nonmutating", "cpp:const"] idempotent bool isEnabled(); + ["cpp:const"] idempotent bool isEnabled(); /// Send signal to the server void sendSignal(string signal) @@ -184,11 +184,11 @@ interface Server extends FileReader /// Return the server state. /// @return The server state. /// @see ServerState - ["nonmutating", "cpp:const"] idempotent ServerState getState(); + ["cpp:const"] idempotent ServerState getState(); /// Get the server pid. Note that the value returned by this method is system dependant. On Unix operating systems, /// it's the pid value returned by the fork() system call and converted to an integer. - ["nonmutating", "cpp:const"] idempotent int getPid(); + ["cpp:const"] idempotent int getPid(); /// Set the process proxy. ["amd"] void setProcess(Ice::Process* proc); @@ -243,19 +243,19 @@ interface Node extends FileReader, ReplicaObserver void registerWithReplica(InternalRegistry* replica); /// Get the node name. - ["nonmutating", "cpp:const"] idempotent string getName(); + ["cpp:const"] idempotent string getName(); /// Get the node hostname. - ["nonmutating", "cpp:const"] idempotent string getHostname(); + ["cpp:const"] idempotent string getHostname(); /// Get the node load. - ["nonmutating", "cpp:const"] idempotent LoadInfo getLoad(); + ["cpp:const"] idempotent LoadInfo getLoad(); /// Get the number of processor sockets for the machine where this node is running. - ["nonmutating", "cpp:const"] idempotent int getProcessorSocketCount(); + ["cpp:const"] idempotent int getProcessorSocketCount(); /// Shutdown the node. - ["nonmutating", "cpp:const"] idempotent void shutdown(); + ["cpp:const"] idempotent void shutdown(); } sequence NodePrxSeq; @@ -275,16 +275,16 @@ interface NodeSession void setReplicaObserver(ReplicaObserver* observer); /// Return the node session timeout. - ["nonmutating", "cpp:const"] idempotent int getTimeout(); + ["cpp:const"] idempotent int getTimeout(); /// Return the node observer. - ["nonmutating", "cpp:const"] idempotent NodeObserver* getObserver(); + ["cpp:const"] idempotent NodeObserver* getObserver(); /// Ask the registry to load the servers on the node. - ["amd", "nonmutating", "cpp:const"] idempotent void loadServers(); + ["amd", "cpp:const"] idempotent void loadServers(); /// Get the name of the servers deployed on the node. - ["nonmutating", "cpp:const"] idempotent Ice::StringSeq getServers(); + ["cpp:const"] idempotent Ice::StringSeq getServers(); /// Wait for the application update to complete (the application is completely updated once all the registry /// replicas have been updated). This is used by the node to ensure that before to start a server all the diff --git a/cpp/test/Ice/operations/Oneways.cpp b/cpp/test/Ice/operations/Oneways.cpp index ad0d19c6287..adb2c5cac9b 100644 --- a/cpp/test/Ice/operations/Oneways.cpp +++ b/cpp/test/Ice/operations/Oneways.cpp @@ -58,10 +58,6 @@ oneways(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) p->opIdempotent(); } - { - p->opNonmutating(); - } - { uint8_t b; diff --git a/cpp/test/Ice/operations/OnewaysAMI.cpp b/cpp/test/Ice/operations/OnewaysAMI.cpp index e17d5085692..a95e457d990 100644 --- a/cpp/test/Ice/operations/OnewaysAMI.cpp +++ b/cpp/test/Ice/operations/OnewaysAMI.cpp @@ -107,12 +107,6 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) cb->check(); } - { - CallbackPtr cb = std::make_shared(); - p->opNonmutatingAsync(nullptr, [](exception_ptr) { test(false); }, [&](bool sent) { cb->sent(sent); }); - cb->check(); - } - { try { diff --git a/cpp/test/Ice/operations/Test.ice b/cpp/test/Ice/operations/Test.ice index 4ecbd6f4ea8..9382f058f94 100644 --- a/cpp/test/Ice/operations/Test.ice +++ b/cpp/test/Ice/operations/Test.ice @@ -233,8 +233,6 @@ interface MyClass idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/cpp/test/Ice/operations/TestAMD.ice b/cpp/test/Ice/operations/TestAMD.ice index a667f6a387c..a73f813ef8d 100644 --- a/cpp/test/Ice/operations/TestAMD.ice +++ b/cpp/test/Ice/operations/TestAMD.ice @@ -230,8 +230,6 @@ dictionary MyEnumMyEnumSD; idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/cpp/test/Ice/operations/TestAMDI.cpp b/cpp/test/Ice/operations/TestAMDI.cpp index afe08e0d52a..fec9d2b29d6 100644 --- a/cpp/test/Ice/operations/TestAMDI.cpp +++ b/cpp/test/Ice/operations/TestAMDI.cpp @@ -759,13 +759,6 @@ MyDerivedClassI::opIdempotentAsync(function response, function response, function, const Current& current) -{ - test(current.mode == OperationMode::Nonmutating); - response(); -} - void MyDerivedClassI::opDerivedAsync(function response, function, const Current&) { diff --git a/cpp/test/Ice/operations/TestAMDI.h b/cpp/test/Ice/operations/TestAMDI.h index c986d848514..45a8a0c6337 100644 --- a/cpp/test/Ice/operations/TestAMDI.h +++ b/cpp/test/Ice/operations/TestAMDI.h @@ -354,8 +354,6 @@ class MyDerivedClassI final : public Test::MyDerivedClass void opIdempotentAsync(std::function, std::function, const Ice::Current&) final; - void opNonmutatingAsync(std::function, std::function, const Ice::Current&) final; - void opDerivedAsync(std::function, std::function, const Ice::Current&) final; void opByte1Async( diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp index 066d796105c..cdd3e3ab256 100644 --- a/cpp/test/Ice/operations/TestI.cpp +++ b/cpp/test/Ice/operations/TestI.cpp @@ -595,12 +595,6 @@ MyDerivedClassI::opIdempotent(const Ice::Current& current) test(current.mode == OperationMode::Idempotent); } -void -MyDerivedClassI::opNonmutating(const Ice::Current& current) -{ - test(current.mode == OperationMode::Nonmutating); -} - void MyDerivedClassI::opDerived(const Ice::Current&) { diff --git a/cpp/test/Ice/operations/TestI.h b/cpp/test/Ice/operations/TestI.h index ec786d5a54e..e4d99b8a4a1 100644 --- a/cpp/test/Ice/operations/TestI.h +++ b/cpp/test/Ice/operations/TestI.h @@ -162,8 +162,6 @@ class MyDerivedClassI final : public Test::MyDerivedClass void opIdempotent(const Ice::Current&) final; - void opNonmutating(const Ice::Current&) final; - void opDerived(const Ice::Current&) final; std::uint8_t opByte1(std::uint8_t, const Ice::Current&) final; diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index af764004561..651baaf51f9 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -1737,8 +1737,6 @@ twoways(const Ice::CommunicatorPtr& communicator, Test::TestHelper*, const Test: p->opIdempotent(); - p->opNonmutating(); - test(p->opByte1(0xFF) == 0xFF); test(p->opShort1(0x7FFF) == 0x7FFF); test(p->opInt1(0x7FFFFFFF) == 0x7FFFFFFF); diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index 5496bd9bd32..138b21c5be9 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -962,8 +962,6 @@ namespace void opIdempotent() { called(); } - void opNonmutating() { called(); } - void opDerived() { called(); } void exCB(std::exception_ptr ex) @@ -2120,12 +2118,6 @@ twowaysAMI(const CommunicatorPtr& communicator, const MyClassPrx& p) cb->check(); } - { - CallbackPtr cb = make_shared(); - p->opNonmutatingAsync([&]() { cb->opNonmutating(); }, makeExceptionClosure(cb)); - cb->check(); - } - { MyDerivedClassPrx derived(p); CallbackPtr cb = make_shared(); @@ -3294,21 +3286,6 @@ twowaysAMI(const CommunicatorPtr& communicator, const MyClassPrx& p) cb->check(); } - { - CallbackPtr cb = make_shared(); - auto f = p->opNonmutatingAsync(); - try - { - f.get(); - cb->opNonmutating(); - } - catch (...) - { - cb->exCB(current_exception()); - } - cb->check(); - } - { MyDerivedClassPrx derived(p); CallbackPtr cb = make_shared(); diff --git a/cpp/test/Slice/errorDetection/IdentAsKeyword.err b/cpp/test/Slice/errorDetection/IdentAsKeyword.err index 990847bcff1..c3e811c3474 100644 --- a/cpp/test/Slice/errorDetection/IdentAsKeyword.err +++ b/cpp/test/Slice/errorDetection/IdentAsKeyword.err @@ -22,6 +22,9 @@ IdentAsKeyword.ice:28: `C': a class can be defined only at module scope IdentAsKeyword.ice:28: keyword `extends' cannot be used as data member name IdentAsKeyword.ice:29: `D': a class can be defined only at module scope IdentAsKeyword.ice:29: keyword `extends' cannot be used as data member name +IdentAsKeyword.ice:31: keyword `idempotent' cannot be used as interface name +IdentAsKeyword.ice:31: `idempotent': an interface can be defined only at module scope +IdentAsKeyword.ice:32: `IDEMPOTENT': an interface can be defined only at module scope IdentAsKeyword.ice:34: keyword `Object' cannot be used as interface name IdentAsKeyword.ice:34: `Object': an interface can be defined only at module scope IdentAsKeyword.ice:35: `object': an interface can be defined only at module scope @@ -36,12 +39,16 @@ IdentAsKeyword.ice:43: `moDule' is not defined IdentAsKeyword.ice:45: `throws': a dictionary can be defined only at module scope IdentAsKeyword.ice:45: keyword `throws' cannot be used as dictionary name IdentAsKeyword.ice:46: dictionary `thRows' differs only in capitalization from dictionary `throws' +IdentAsKeyword.ice:47: `LOCALobject': a dictionary can be defined only at module scope IdentAsKeyword.ice:49: syntax error IdentAsKeyword.ice:50: `MODULE' is not defined IdentAsKeyword.ice:52: syntax error IdentAsKeyword.ice:53: `d4': a dictionary can be defined only at module scope IdentAsKeyword.ice:55: syntax error IdentAsKeyword.ice:56: `VOID' is an exception, which cannot be used as a type +IdentAsKeyword.ice:58: keyword `idempotent' cannot be used as enumeration name +IdentAsKeyword.ice:58: `idempotent': an enumeration can be defined only at module scope +IdentAsKeyword.ice:59: enumeration `IDEMPOTENT' differs only in capitalization from enumeration `idempotent' IdentAsKeyword.ice:61: `e1': an enumeration can be defined only at module scope IdentAsKeyword.ice:61: keyword `long' cannot be used as enumerator IdentAsKeyword.ice:61: keyword `byte' cannot be used as enumerator @@ -58,6 +65,12 @@ IdentAsKeyword.ice:74: `i8': an interface can be defined only at module scope IdentAsKeyword.ice:76: `i9': an interface can be defined only at module scope IdentAsKeyword.ice:77: `i10': an interface can be defined only at module scope IdentAsKeyword.ice:79: `true': an interface can be defined only at module scope +IdentAsKeyword.ice:81: illegal leading underscore in identifier `_a' +IdentAsKeyword.ice:82: illegal leading underscore in identifier `_true' +IdentAsKeyword.ice:83: illegal leading underscore in identifier `_true' +IdentAsKeyword.ice:85: illegal trailing underscore in identifier `b_' IdentAsKeyword.ice:87: illegal double underscore in identifier `b__c' IdentAsKeyword.ice:88: illegal double underscore in identifier `b___c' +IdentAsKeyword.ice:90: `a_b': an interface can be defined only at module scope +IdentAsKeyword.ice:91: `a_b_c': an interface can be defined only at module scope IdentAsKeyword.ice:93: syntax error diff --git a/cpp/test/Slice/errorDetection/IdentAsKeyword.ice b/cpp/test/Slice/errorDetection/IdentAsKeyword.ice index 067f58a8855..30f1b193f9d 100644 --- a/cpp/test/Slice/errorDetection/IdentAsKeyword.ice +++ b/cpp/test/Slice/errorDetection/IdentAsKeyword.ice @@ -28,8 +28,8 @@ class C { long extendS; } class C { long extends; } class D { long extends; } -// interface local; -// interface Local; +interface idempotent; +interface IDEMPOTENT; interface Object { void op(); } interface object { void op(); } @@ -44,7 +44,7 @@ sequence seq2; dictionary throws; dictionary thRows; -// dictionary LOCALobject; +dictionary LOCALobject; // Ok as of 3.7 dictionary d1; dictionary d2; @@ -55,8 +55,8 @@ dictionary d4; dictionary d5; dictionary d6; -// enum local { a, b } -// enum LOCAL { c, e } +enum idempotent { a, b } +enum IDEMPOTENT { c, e } enum e1 { long, byte, foo } enum e2 { LONG, BYTE, bar } // Ok as of 3.7 @@ -78,16 +78,16 @@ interface i10 { void op(out double BYTE); } interface \true {} // OK, escaped keyword -// interface _a; // Illegal leading underscore -// interface _true; // Illegal leading underscore -// interface \_true; // Illegal leading underscore +interface _a; // Illegal leading underscore +interface _true; // Illegal leading underscore +interface \_true; // Illegal leading underscore -// interface b_; // Illegal trailing underscore +interface b_; // Illegal trailing underscore interface b__c; // Illegal underscores interface b___c; // Illegal underscores -// interface a_b; // Illegal underscore -// interface a_b_c; // Illegal underscores +interface a_b; // Ok as of 3.7 +interface a_b_c; // Ok as of 3.7 } diff --git a/cpp/test/Slice/errorDetection/IdentAsKeywordUnderscore.err b/cpp/test/Slice/errorDetection/IdentAsKeywordUnderscore.err deleted file mode 100644 index c2b25ac7ada..00000000000 --- a/cpp/test/Slice/errorDetection/IdentAsKeywordUnderscore.err +++ /dev/null @@ -1,69 +0,0 @@ -IdentAsKeywordUnderscore.ice:8: syntax error -IdentAsKeywordUnderscore.ice:10: `Void': an exception can be defined only at module scope -IdentAsKeywordUnderscore.ice:11: keyword `int' cannot be used as exception name -IdentAsKeywordUnderscore.ice:11: `int': an exception can be defined only at module scope -IdentAsKeywordUnderscore.ice:13: `OUT': a structure can be defined only at module scope -IdentAsKeywordUnderscore.ice:14: keyword `double' cannot be used as struct name -IdentAsKeywordUnderscore.ice:14: `double': a structure can be defined only at module scope -IdentAsKeywordUnderscore.ice:16: `s1': a structure can be defined only at module scope -IdentAsKeywordUnderscore.ice:17: `s2': a structure can be defined only at module scope -IdentAsKeywordUnderscore.ice:17: keyword `byte' cannot be used as data member name -IdentAsKeywordUnderscore.ice:18: `s3': a structure can be defined only at module scope -IdentAsKeywordUnderscore.ice:19: `s4': a structure can be defined only at module scope -IdentAsKeywordUnderscore.ice:19: keyword `byte' cannot be used as data member name -IdentAsKeywordUnderscore.ice:21: `inTERface': a class can be defined only at module scope -IdentAsKeywordUnderscore.ice:22: keyword `interface' cannot be used as class name -IdentAsKeywordUnderscore.ice:22: `interface': a class can be defined only at module scope -IdentAsKeywordUnderscore.ice:24: `MOdule': a class can be defined only at module scope -IdentAsKeywordUnderscore.ice:25: keyword `module' cannot be used as class name -IdentAsKeywordUnderscore.ice:25: `module': a class can be defined only at module scope -IdentAsKeywordUnderscore.ice:27: `C': a class can be defined only at module scope -IdentAsKeywordUnderscore.ice:28: `C': a class can be defined only at module scope -IdentAsKeywordUnderscore.ice:28: keyword `extends' cannot be used as data member name -IdentAsKeywordUnderscore.ice:29: `D': a class can be defined only at module scope -IdentAsKeywordUnderscore.ice:29: keyword `extends' cannot be used as data member name -IdentAsKeywordUnderscore.ice:34: keyword `Object' cannot be used as interface name -IdentAsKeywordUnderscore.ice:34: `Object': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:35: `object': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:36: keyword `long' cannot be used as interface name -IdentAsKeywordUnderscore.ice:36: `long': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:38: `impLEments': a sequence can be defined only at module scope -IdentAsKeywordUnderscore.ice:39: sequence `implements' differs only in capitalization from sequence `impLEments' -IdentAsKeywordUnderscore.ice:40: `short': a sequence can be defined only at module scope -IdentAsKeywordUnderscore.ice:40: keyword `short' cannot be used as sequence name -IdentAsKeywordUnderscore.ice:42: syntax error -IdentAsKeywordUnderscore.ice:43: `moDule' is not defined -IdentAsKeywordUnderscore.ice:45: `throws': a dictionary can be defined only at module scope -IdentAsKeywordUnderscore.ice:45: keyword `throws' cannot be used as dictionary name -IdentAsKeywordUnderscore.ice:46: dictionary `thRows' differs only in capitalization from dictionary `throws' -IdentAsKeywordUnderscore.ice:49: syntax error -IdentAsKeywordUnderscore.ice:50: `MODULE' is not defined -IdentAsKeywordUnderscore.ice:52: syntax error -IdentAsKeywordUnderscore.ice:53: `d4': a dictionary can be defined only at module scope -IdentAsKeywordUnderscore.ice:55: syntax error -IdentAsKeywordUnderscore.ice:56: `VOID' is an exception, which cannot be used as a type -IdentAsKeywordUnderscore.ice:61: `e1': an enumeration can be defined only at module scope -IdentAsKeywordUnderscore.ice:61: keyword `long' cannot be used as enumerator -IdentAsKeywordUnderscore.ice:61: keyword `byte' cannot be used as enumerator -IdentAsKeywordUnderscore.ice:62: `e2': an enumeration can be defined only at module scope -IdentAsKeywordUnderscore.ice:64: `i1': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:65: `i2': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:67: `i3': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:68: `i4': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:70: `i5': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:70: syntax error -IdentAsKeywordUnderscore.ice:71: `i6': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:73: `i7': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:74: `i8': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:76: `i9': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:77: `i10': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:79: `true': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:81: illegal leading underscore in identifier `_a' -IdentAsKeywordUnderscore.ice:82: illegal leading underscore in identifier `_true' -IdentAsKeywordUnderscore.ice:83: illegal leading underscore in identifier `_true' -IdentAsKeywordUnderscore.ice:85: illegal trailing underscore in identifier `b_' -IdentAsKeywordUnderscore.ice:87: illegal double underscore in identifier `b__c' -IdentAsKeywordUnderscore.ice:88: illegal double underscore in identifier `b___c' -IdentAsKeywordUnderscore.ice:90: `a_b': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:91: `a_b_c': an interface can be defined only at module scope -IdentAsKeywordUnderscore.ice:93: syntax error diff --git a/cpp/test/Slice/errorDetection/IdentAsKeywordUnderscore.ice b/cpp/test/Slice/errorDetection/IdentAsKeywordUnderscore.ice deleted file mode 100644 index 410713a1578..00000000000 --- a/cpp/test/Slice/errorDetection/IdentAsKeywordUnderscore.ice +++ /dev/null @@ -1,93 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -module Test -{ - -INTERFACE i { void op(); } - -exception Void {} -exception int {} - -struct OUT { long l; } -struct double { long l; } - -struct s1 { long Int; } -struct s2 { long byte; } -struct s3 { short Int; byte b; } -struct s4 { float byte; byte b; } - -class inTERface; -class interface; - -class MOdule { long l; } -class module { long l; } - -class C { long extendS; } -class C { long extends; } -class D { long extends; } - -// interface local; -// interface Local; - -interface Object { void op(); } -interface object { void op(); } -interface long { void op(); } - -sequence impLEments; -sequence implements; -sequence short; - -sequence seq1; -sequence seq2; - -dictionary throws; -dictionary thRows; -// dictionary LOCALobject; - -dictionary d1; -dictionary d2; - -dictionary d3; -dictionary d4; - -dictionary d5; -dictionary d6; - -// enum local { a, b } -// enum LOCAL { c, e } - -enum e1 { long, byte, foo } -enum e2 { LONG, BYTE, bar } - -interface i1 { long module(); } -interface i2 { long mODule(); } - -interface i3 { void exception(); } -interface i4 { void EXception(); } - -interface i5 { out op(); } -interface i6 { OUT op(); } - -interface i7 { void op(double byte); } -interface i8 { void op(double BYTE); } - -interface i9 { void op(out double byte); } -interface i10 { void op(out double BYTE); } - -interface \true {} // OK, escaped keyword - -interface _a; // Illegal leading underscore -interface _true; // Illegal leading underscore -interface \_true; // Illegal leading underscore - -interface b_; // Illegal trailing underscore - -interface b__c; // Illegal underscores -interface b___c; // Illegal underscores - -interface a_b; // OK -interface a_b_c; // OK - -} diff --git a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs index 68a0db0ea9a..5b3aa9bc038 100644 --- a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs @@ -768,13 +768,6 @@ public override Task return null; } - public override Task - opNonmutatingAsync(Ice.Current current) - { - test(current.mode == Ice.OperationMode.Nonmutating); - return null; - } - public override Task opDerivedAsync(Ice.Current current) { diff --git a/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs b/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs index b86ac38fd1e..987cfdc06dd 100644 --- a/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassAMDTieI.cs @@ -749,13 +749,6 @@ public Task return null; } - public Task - opNonmutatingAsync(Ice.Current current) - { - test(current.mode == Ice.OperationMode.Nonmutating); - return null; - } - public Task opDerivedAsync(Ice.Current current) { diff --git a/csharp/test/Ice/operations/MyDerivedClassI.cs b/csharp/test/Ice/operations/MyDerivedClassI.cs index 5a993c60442..14caa7554de 100644 --- a/csharp/test/Ice/operations/MyDerivedClassI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassI.cs @@ -749,11 +749,6 @@ public override void opIdempotent(Ice.Current current) test(current.mode == Ice.OperationMode.Idempotent); } - public override void opNonmutating(Ice.Current current) - { - test(current.mode == Ice.OperationMode.Nonmutating); - } - public override void opDerived(Ice.Current current) { } diff --git a/csharp/test/Ice/operations/MyDerivedClassTieI.cs b/csharp/test/Ice/operations/MyDerivedClassTieI.cs index e85a38021da..33a2d3d3dd8 100644 --- a/csharp/test/Ice/operations/MyDerivedClassTieI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassTieI.cs @@ -727,11 +727,6 @@ public void opIdempotent(Ice.Current current) test(current.mode == Ice.OperationMode.Idempotent); } - public void opNonmutating(Ice.Current current) - { - test(current.mode == Ice.OperationMode.Nonmutating); - } - public void opDerived(Ice.Current current) { } diff --git a/csharp/test/Ice/operations/Oneways.cs b/csharp/test/Ice/operations/Oneways.cs index 6e9a670d360..5d64ef63996 100644 --- a/csharp/test/Ice/operations/Oneways.cs +++ b/csharp/test/Ice/operations/Oneways.cs @@ -31,10 +31,6 @@ internal static void oneways(global::Test.TestHelper helper, Test.MyClassPrx p) p.opIdempotent(); } - { - p.opNonmutating(); - } - { byte b; try diff --git a/csharp/test/Ice/operations/OnewaysAMI.cs b/csharp/test/Ice/operations/OnewaysAMI.cs index 8adb735c99f..1f26de3cc54 100644 --- a/csharp/test/Ice/operations/OnewaysAMI.cs +++ b/csharp/test/Ice/operations/OnewaysAMI.cs @@ -49,7 +49,6 @@ internal static async Task onewaysAMI(Test.MyClassPrx proxy) await p.opVoidAsync(); await p.opIdempotentAsync(); - await p.opNonmutatingAsync(); try { diff --git a/csharp/test/Ice/operations/Test.ice b/csharp/test/Ice/operations/Test.ice index 3b6710d369b..276a383a248 100644 --- a/csharp/test/Ice/operations/Test.ice +++ b/csharp/test/Ice/operations/Test.ice @@ -235,8 +235,6 @@ interface MyClass idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/csharp/test/Ice/operations/TestAMD.ice b/csharp/test/Ice/operations/TestAMD.ice index 0fae4e55016..67a8d91691d 100644 --- a/csharp/test/Ice/operations/TestAMD.ice +++ b/csharp/test/Ice/operations/TestAMD.ice @@ -233,8 +233,6 @@ dictionary MyEnumMyEnumSD; idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/csharp/test/Ice/operations/Twoways.cs b/csharp/test/Ice/operations/Twoways.cs index 980a9156e06..1a851075528 100644 --- a/csharp/test/Ice/operations/Twoways.cs +++ b/csharp/test/Ice/operations/Twoways.cs @@ -1500,10 +1500,6 @@ internal static void twoways(global::Test.TestHelper helper, Test.MyClassPrx p) p.opIdempotent(); } - { - p.opNonmutating(); - } - { test(p.opByte1(0xFF) == 0xFF); test(p.opShort1(0x7FFF) == 0x7FFF); diff --git a/csharp/test/Ice/operations/TwowaysAMI.cs b/csharp/test/Ice/operations/TwowaysAMI.cs index 81b6d64f6be..07ee1b89177 100644 --- a/csharp/test/Ice/operations/TwowaysAMI.cs +++ b/csharp/test/Ice/operations/TwowaysAMI.cs @@ -1320,10 +1320,6 @@ internal static async Task twowaysAMI(global::Test.TestHelper helper, Test.MyCla p.opIdempotentAsync().Wait(); } - { - p.opNonmutatingAsync().Wait(); - } - { var derived = Test.MyDerivedClassPrxHelper.checkedCast(p); test(derived != null); diff --git a/csharp/test/Slice/escape/Clash.ice b/csharp/test/Slice/escape/Clash.ice index a09cd215854..4e6bc406ee0 100644 --- a/csharp/test/Slice/escape/Clash.ice +++ b/csharp/test/Slice/escape/Clash.ice @@ -2,8 +2,6 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -[["underscore"]] - module Clash { diff --git a/java/test/src/main/java/test/Ice/operations/AMDMyDerivedClassI.java b/java/test/src/main/java/test/Ice/operations/AMDMyDerivedClassI.java index 11362f56168..dd2847f20df 100644 --- a/java/test/src/main/java/test/Ice/operations/AMDMyDerivedClassI.java +++ b/java/test/src/main/java/test/Ice/operations/AMDMyDerivedClassI.java @@ -639,12 +639,6 @@ public CompletionStage opIdempotentAsync(Current current) { return CompletableFuture.completedFuture((Void) null); } - @Override - public CompletionStage opNonmutatingAsync(Current current) { - test(current.mode == com.zeroc.Ice.OperationMode.Nonmutating); - return CompletableFuture.completedFuture((Void) null); - } - @Override public CompletionStage opDerivedAsync(Current current) { return CompletableFuture.completedFuture((Void) null); diff --git a/java/test/src/main/java/test/Ice/operations/MyDerivedClassI.java b/java/test/src/main/java/test/Ice/operations/MyDerivedClassI.java index 4950c58e5a9..0588dadb771 100644 --- a/java/test/src/main/java/test/Ice/operations/MyDerivedClassI.java +++ b/java/test/src/main/java/test/Ice/operations/MyDerivedClassI.java @@ -586,11 +586,6 @@ public void opIdempotent(Current current) { test(current.mode == com.zeroc.Ice.OperationMode.Idempotent); } - @Override - public void opNonmutating(Current current) { - test(current.mode == com.zeroc.Ice.OperationMode.Nonmutating); - } - @Override public void opDerived(Current current) {} diff --git a/java/test/src/main/java/test/Ice/operations/Oneways.java b/java/test/src/main/java/test/Ice/operations/Oneways.java index 165b632f404..b6eabbddb5b 100644 --- a/java/test/src/main/java/test/Ice/operations/Oneways.java +++ b/java/test/src/main/java/test/Ice/operations/Oneways.java @@ -19,7 +19,6 @@ static void oneways(test.TestHelper helper, MyClassPrx p) { p.ice_ping(); p.opVoid(); p.opIdempotent(); - p.opNonmutating(); try { p.opByte((byte) 0xff, (byte) 0x0f); diff --git a/java/test/src/main/java/test/Ice/operations/OnewaysAMI.java b/java/test/src/main/java/test/Ice/operations/OnewaysAMI.java index 080932d7513..1d1e1ab4dce 100644 --- a/java/test/src/main/java/test/Ice/operations/OnewaysAMI.java +++ b/java/test/src/main/java/test/Ice/operations/OnewaysAMI.java @@ -106,19 +106,6 @@ static void onewaysAMI(test.TestHelper helper, MyClassPrx proxy) { cb.check(); } - { - final Callback cb = new Callback(); - CompletableFuture f = p.opNonmutatingAsync(); - f.whenComplete((result, ex) -> test(ex == null)); - Util.getInvocationFuture(f) - .whenSent( - (sentSynchronously, ex) -> { - test(ex == null); - cb.called(); - }); - cb.check(); - } - { try { p.opByteAsync((byte) 0xff, (byte) 0x0f); diff --git a/java/test/src/main/java/test/Ice/operations/Test.ice b/java/test/src/main/java/test/Ice/operations/Test.ice index 07958d2f13f..4566b50f711 100644 --- a/java/test/src/main/java/test/Ice/operations/Test.ice +++ b/java/test/src/main/java/test/Ice/operations/Test.ice @@ -231,8 +231,6 @@ interface MyClass idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/java/test/src/main/java/test/Ice/operations/TestAMD.ice b/java/test/src/main/java/test/Ice/operations/TestAMD.ice index 6d9f8f19c39..7abd12cc02d 100644 --- a/java/test/src/main/java/test/Ice/operations/TestAMD.ice +++ b/java/test/src/main/java/test/Ice/operations/TestAMD.ice @@ -231,8 +231,6 @@ dictionary MyEnumMyEnumSD; idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/java/test/src/main/java/test/Ice/operations/Twoways.java b/java/test/src/main/java/test/Ice/operations/Twoways.java index bbc1dc0332f..567bd7f27f7 100644 --- a/java/test/src/main/java/test/Ice/operations/Twoways.java +++ b/java/test/src/main/java/test/Ice/operations/Twoways.java @@ -1397,8 +1397,6 @@ static void twoways(test.TestHelper helper, MyClassPrx p) { p.opIdempotent(); - p.opNonmutating(); - test(p.opByte1((byte) 0xFF) == (byte) 0xFF); test(p.opShort1((short) 0x7FFF) == (short) 0x7FFF); test(p.opInt1(0x7FFFFFFF) == 0x7FFFFFFF); diff --git a/java/test/src/main/java/test/Ice/operations/TwowaysAMI.java b/java/test/src/main/java/test/Ice/operations/TwowaysAMI.java index c7079d32756..c7be0aadc58 100644 --- a/java/test/src/main/java/test/Ice/operations/TwowaysAMI.java +++ b/java/test/src/main/java/test/Ice/operations/TwowaysAMI.java @@ -1615,17 +1615,6 @@ static void twowaysAMI(test.TestHelper helper, MyClassPrx p) { cb.check(); } - { - Callback cb = new Callback(); - p.opNonmutatingAsync() - .whenComplete( - (result, ex) -> { - test(ex == null); - cb.called(); - }); - cb.check(); - } - { MyDerivedClassPrx derived = MyDerivedClassPrx.checkedCast(p); test(derived != null); diff --git a/java/test/src/main/java/test/Slice/escape/Clash.ice b/java/test/src/main/java/test/Slice/escape/Clash.ice index 9f8a79bc0f7..f73f8757079 100644 --- a/java/test/src/main/java/test/Slice/escape/Clash.ice +++ b/java/test/src/main/java/test/Slice/escape/Clash.ice @@ -2,7 +2,6 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -[["underscore"]] [["java:package:test.Slice.escape"]] module Clash diff --git a/js/test/Ice/operations/AMDMyDerivedClassI.js b/js/test/Ice/operations/AMDMyDerivedClassI.js index 11dd95e27b2..a96f80e1db6 100644 --- a/js/test/Ice/operations/AMDMyDerivedClassI.js +++ b/js/test/Ice/operations/AMDMyDerivedClassI.js @@ -394,11 +394,6 @@ test(current.mode === Ice.OperationMode.Idempotent); } - opNonmutating(current) - { - test(current.mode === Ice.OperationMode.Nonmutating); - } - opDerived(current) { } diff --git a/js/test/Ice/operations/MyDerivedClassI.js b/js/test/Ice/operations/MyDerivedClassI.js index 23b3b376e7e..6cd76a03121 100644 --- a/js/test/Ice/operations/MyDerivedClassI.js +++ b/js/test/Ice/operations/MyDerivedClassI.js @@ -394,11 +394,6 @@ test(current.mode === Ice.OperationMode.Idempotent); } - opNonmutating(current) - { - test(current.mode === Ice.OperationMode.Nonmutating); - } - opDerived(current) { } diff --git a/js/test/Ice/operations/Oneways.js b/js/test/Ice/operations/Oneways.js index 0b4d4bacf3c..5f24b8edd30 100644 --- a/js/test/Ice/operations/Oneways.js +++ b/js/test/Ice/operations/Oneways.js @@ -47,7 +47,6 @@ await prx.opVoid(); await prx.opIdempotent(); - await prx.opNonmutating(); try { diff --git a/js/test/Ice/operations/Test.ice b/js/test/Ice/operations/Test.ice index 676107fc88a..311ca516703 100644 --- a/js/test/Ice/operations/Test.ice +++ b/js/test/Ice/operations/Test.ice @@ -230,8 +230,6 @@ interface MyClass idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/js/test/Ice/operations/Twoways.js b/js/test/Ice/operations/Twoways.js index 4bc92fd8b40..05522ea4851 100644 --- a/js/test/Ice/operations/Twoways.js +++ b/js/test/Ice/operations/Twoways.js @@ -1406,7 +1406,6 @@ await prx.opDoubleMarshaling(d, ds); await prx.opIdempotent(); - await prx.opNonmutating(); } { diff --git a/js/test/Slice/escape/Clash.ice b/js/test/Slice/escape/Clash.ice index a09cd215854..4e6bc406ee0 100644 --- a/js/test/Slice/escape/Clash.ice +++ b/js/test/Slice/escape/Clash.ice @@ -2,8 +2,6 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -[["underscore"]] - module Clash { diff --git a/js/test/typescript/Ice/operations/AMDMyDerivedClassI.ts b/js/test/typescript/Ice/operations/AMDMyDerivedClassI.ts index 0739f14a50f..bebd16558e1 100644 --- a/js/test/typescript/Ice/operations/AMDMyDerivedClassI.ts +++ b/js/test/typescript/Ice/operations/AMDMyDerivedClassI.ts @@ -409,11 +409,6 @@ export class AMDMyDerivedClassI extends Test.MyDerivedClass test(current.mode === Ice.OperationMode.Idempotent); } - opNonmutating(current:Ice.Current):void - { - test(current.mode === Ice.OperationMode.Nonmutating); - } - opDerived(current:Ice.Current):void { } diff --git a/js/test/typescript/Ice/operations/MyDerivedClassI.ts b/js/test/typescript/Ice/operations/MyDerivedClassI.ts index 5b2d37f4f71..d48d6b910ad 100644 --- a/js/test/typescript/Ice/operations/MyDerivedClassI.ts +++ b/js/test/typescript/Ice/operations/MyDerivedClassI.ts @@ -408,11 +408,6 @@ export class MyDerivedClassI extends Test.MyDerivedClass test(current.mode === Ice.OperationMode.Idempotent); } - opNonmutating(current:Ice.Current):void - { - test(current.mode === Ice.OperationMode.Nonmutating); - } - opDerived(current:Ice.Current):void { } diff --git a/js/test/typescript/Ice/operations/Oneways.ts b/js/test/typescript/Ice/operations/Oneways.ts index 248dc78284d..e94e73d0b2a 100644 --- a/js/test/typescript/Ice/operations/Oneways.ts +++ b/js/test/typescript/Ice/operations/Oneways.ts @@ -48,7 +48,6 @@ export async function run(communicator:Ice.Communicator, prx:Test.MyClassPrx, bi await prx.opVoid(); await prx.opIdempotent(); - await prx.opNonmutating(); try { diff --git a/js/test/typescript/Ice/operations/Test.ice b/js/test/typescript/Ice/operations/Test.ice index 050336002a2..7ae1f97c5d6 100644 --- a/js/test/typescript/Ice/operations/Test.ice +++ b/js/test/typescript/Ice/operations/Test.ice @@ -232,8 +232,6 @@ interface MyClass idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/js/test/typescript/Ice/operations/Twoways.ts b/js/test/typescript/Ice/operations/Twoways.ts index c5f779355e9..9f5a6c51741 100644 --- a/js/test/typescript/Ice/operations/Twoways.ts +++ b/js/test/typescript/Ice/operations/Twoways.ts @@ -1406,7 +1406,6 @@ export async function run(communicator:Ice.Communicator, prx:Test.MyClassPrx, bi await prx.opDoubleMarshaling(d, ds); await prx.opIdempotent(); - await prx.opNonmutating(); } { diff --git a/matlab/test/Ice/operations/Oneways.m b/matlab/test/Ice/operations/Oneways.m index 77ca5d01933..81585b6b23a 100644 --- a/matlab/test/Ice/operations/Oneways.m +++ b/matlab/test/Ice/operations/Oneways.m @@ -13,8 +13,6 @@ function oneways(p) p.opIdempotent(); - p.opNonmutating(); - try p.opByte(hex2dec('ff'), hex2dec('0f')); assert(false); diff --git a/matlab/test/Ice/operations/OnewaysAMI.m b/matlab/test/Ice/operations/OnewaysAMI.m index 2db74d9fb5b..bbd8b8ee9f8 100644 --- a/matlab/test/Ice/operations/OnewaysAMI.m +++ b/matlab/test/Ice/operations/OnewaysAMI.m @@ -33,8 +33,6 @@ function onewaysAMI(p) call(p, 'opIdempotent'); - call(p, 'opNonmutating'); - try p.opByteAsync(hex2dec('ff'), hex2dec('0f')); catch ex diff --git a/matlab/test/Ice/operations/Test.ice b/matlab/test/Ice/operations/Test.ice index 6f140991524..d4017de2bb6 100644 --- a/matlab/test/Ice/operations/Test.ice +++ b/matlab/test/Ice/operations/Test.ice @@ -232,8 +232,6 @@ interface MyClass idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/matlab/test/Ice/operations/Twoways.m b/matlab/test/Ice/operations/Twoways.m index 99ff6a73bdd..96e9779c4a4 100644 --- a/matlab/test/Ice/operations/Twoways.m +++ b/matlab/test/Ice/operations/Twoways.m @@ -1359,8 +1359,6 @@ function checkStructDict(d) p.opIdempotent(); - p.opNonmutating(); - assert(p.opByte1(hex2dec('FF')) == hex2dec('FF')); assert(p.opShort1(hex2dec('7FFF')) == hex2dec('7FFF')); assert(p.opInt1(hex2dec('7FFFFFFF')) == hex2dec('7FFFFFFF')); diff --git a/matlab/test/Ice/operations/TwowaysAMI.m b/matlab/test/Ice/operations/TwowaysAMI.m index 06c4d3405b8..19ead341c43 100644 --- a/matlab/test/Ice/operations/TwowaysAMI.m +++ b/matlab/test/Ice/operations/TwowaysAMI.m @@ -1200,8 +1200,6 @@ function checkStructDict(d) call(p, 'opIdempotent'); - call(p, 'opNonmutating'); - assert(call(p, 'opByte1', hex2dec('FF')) == hex2dec('FF')); assert(call(p, 'opShort1', hex2dec('7FFF')) == hex2dec('7FFF')); assert(call(p, 'opInt1', hex2dec('7FFFFFFF')) == hex2dec('7FFFFFFF')); diff --git a/php/test/Ice/operations/Client.php b/php/test/Ice/operations/Client.php index 49515101c1d..4da894dd8a7 100644 --- a/php/test/Ice/operations/Client.php +++ b/php/test/Ice/operations/Client.php @@ -967,10 +967,6 @@ function twoways($communicator, $p, $bprx) $p->opIdempotent(); } - { - $p->opNonmutating(); - } - test($p->opByte1(0xFF) == 0xFF); test($p->opShort1(0x7FFF) == 0x7FFF); test($p->opInt1(0x7FFFFFFF) == 0x7FFFFFFF); diff --git a/php/test/Ice/operations/Test.ice b/php/test/Ice/operations/Test.ice index 55c142c0556..ddcb8d30168 100644 --- a/php/test/Ice/operations/Test.ice +++ b/php/test/Ice/operations/Test.ice @@ -207,8 +207,6 @@ interface MyClass idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/php/test/Slice/escape/Clash.ice b/php/test/Slice/escape/Clash.ice index 12bb37e8f93..966bacdcf45 100644 --- a/php/test/Slice/escape/Clash.ice +++ b/php/test/Slice/escape/Clash.ice @@ -2,8 +2,6 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -[["underscore"]] - module Clash { diff --git a/php/test/Slice/escape/Key.ice b/php/test/Slice/escape/Key.ice index e0c575bc533..a3e5a4dee28 100644 --- a/php/test/Slice/escape/Key.ice +++ b/php/test/Slice/escape/Key.ice @@ -2,7 +2,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -[["underscore", "suppress-warning:deprecated"]] +[["suppress-warning:deprecated"]] module and { diff --git a/python/test/Ice/operations/Oneways.py b/python/test/Ice/operations/Oneways.py index d162d428897..ccdcbb6f745 100644 --- a/python/test/Ice/operations/Oneways.py +++ b/python/test/Ice/operations/Oneways.py @@ -29,11 +29,6 @@ def oneways(helper, p): # p.opIdempotent() - # - # opNonmutating - # - p.opNonmutating() - # # opByte # diff --git a/python/test/Ice/operations/OnewaysFuture.py b/python/test/Ice/operations/OnewaysFuture.py index 2142c9bb6b7..04dfb0dd196 100644 --- a/python/test/Ice/operations/OnewaysFuture.py +++ b/python/test/Ice/operations/OnewaysFuture.py @@ -41,9 +41,6 @@ def onewaysFuture(helper, proxy): f = p.opIdempotentAsync() f.sent() - f = p.opNonmutatingAsync() - f.sent() - try: p.opByteAsync(0xFF, 0x0F) test(False) diff --git a/python/test/Ice/operations/Test.ice b/python/test/Ice/operations/Test.ice index 8584bd60efa..ec6d685b4f9 100644 --- a/python/test/Ice/operations/Test.ice +++ b/python/test/Ice/operations/Test.ice @@ -229,8 +229,6 @@ interface MyClass idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/python/test/Ice/operations/TestAMDCoroI.py b/python/test/Ice/operations/TestAMDCoroI.py index cd671e4905a..876492682df 100755 --- a/python/test/Ice/operations/TestAMDCoroI.py +++ b/python/test/Ice/operations/TestAMDCoroI.py @@ -374,10 +374,6 @@ def opIdempotent(self, current=None): test(current.mode == Ice.OperationMode.Idempotent) return Ice.Future.completed(None) - def opNonmutating(self, current=None): - test(current.mode == Ice.OperationMode.Nonmutating) - return Ice.Future.completed(None) - def opDerived(self, current=None): return Ice.Future.completed(None) diff --git a/python/test/Ice/operations/TestAMDI.py b/python/test/Ice/operations/TestAMDI.py index f607c171fda..df20147b5e5 100755 --- a/python/test/Ice/operations/TestAMDI.py +++ b/python/test/Ice/operations/TestAMDI.py @@ -359,10 +359,6 @@ def opIdempotent(self, current=None): test(current.mode == Ice.OperationMode.Idempotent) return Ice.Future.completed(None) - def opNonmutating(self, current=None): - test(current.mode == Ice.OperationMode.Nonmutating) - return Ice.Future.completed(None) - def opDerived(self, current=None): return Ice.Future.completed(None) diff --git a/python/test/Ice/operations/TestI.py b/python/test/Ice/operations/TestI.py index cfecc28668c..cac6917157f 100644 --- a/python/test/Ice/operations/TestI.py +++ b/python/test/Ice/operations/TestI.py @@ -315,9 +315,6 @@ def opDoubleMarshaling(self, p1, p2, current=None): def opIdempotent(self, current=None): test(current.mode == Ice.OperationMode.Idempotent) - def opNonmutating(self, current=None): - test(current.mode == Ice.OperationMode.Nonmutating) - def opDerived(self, current=None): pass diff --git a/python/test/Ice/operations/Twoways.py b/python/test/Ice/operations/Twoways.py index c35277d6dca..69ddfa6268c 100644 --- a/python/test/Ice/operations/Twoways.py +++ b/python/test/Ice/operations/Twoways.py @@ -1363,11 +1363,6 @@ def twoways(helper, p): # p.opIdempotent() - # - # opNonmutating - # - p.opNonmutating() - test(p.opByte1(0xFF) == 0xFF) test(p.opShort1(0x7FFF) == 0x7FFF) test(p.opInt1(0x7FFFFFFF) == 0x7FFFFFFF) diff --git a/python/test/Ice/operations/TwowaysFuture.py b/python/test/Ice/operations/TwowaysFuture.py index d16fa4e74d2..0eff3defec7 100644 --- a/python/test/Ice/operations/TwowaysFuture.py +++ b/python/test/Ice/operations/TwowaysFuture.py @@ -861,9 +861,6 @@ def opIntS(self, f): def opIdempotent(self, f): self.called() - def opNonmutating(self, f): - self.called() - def opDerived(self, f): self.called() @@ -1307,10 +1304,6 @@ def twowaysFuture(helper, p): p.opIdempotentAsync().add_done_callback(cb.opIdempotent) cb.check() - cb = Callback() - p.opNonmutatingAsync().add_done_callback(cb.opNonmutating) - cb.check() - derived = Test.MyDerivedClassPrx.checkedCast(p) test(derived) cb = Callback() diff --git a/python/test/Slice/escape/Clash.ice b/python/test/Slice/escape/Clash.ice index 12bb37e8f93..966bacdcf45 100644 --- a/python/test/Slice/escape/Clash.ice +++ b/python/test/Slice/escape/Clash.ice @@ -2,8 +2,6 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -[["underscore"]] - module Clash { diff --git a/ruby/test/Ice/operations/Test.ice b/ruby/test/Ice/operations/Test.ice index d15403ae2a7..9141d84ffad 100644 --- a/ruby/test/Ice/operations/Test.ice +++ b/ruby/test/Ice/operations/Test.ice @@ -226,8 +226,6 @@ interface MyClass idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/ruby/test/Ice/operations/Twoways.rb b/ruby/test/Ice/operations/Twoways.rb index 73c3d30603f..0b4d3bc6ae2 100644 --- a/ruby/test/Ice/operations/Twoways.rb +++ b/ruby/test/Ice/operations/Twoways.rb @@ -1171,11 +1171,6 @@ def twoways(helper, communicator, p) # p.opIdempotent - # - # opNonmutating - # - p.opNonmutating - test(p.opByte1(0xFF) == 0xFF) test(p.opShort1(0x7FFF) == 0x7FFF) test(p.opInt1(0x7FFFFFFF) == 0x7FFFFFFF) diff --git a/ruby/test/Slice/escape/Clash.ice b/ruby/test/Slice/escape/Clash.ice index 12bb37e8f93..966bacdcf45 100644 --- a/ruby/test/Slice/escape/Clash.ice +++ b/ruby/test/Slice/escape/Clash.ice @@ -2,8 +2,6 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -[["underscore"]] - module Clash { diff --git a/ruby/test/Slice/escape/Key.ice b/ruby/test/Slice/escape/Key.ice index f413705fd0d..116fd417477 100644 --- a/ruby/test/Slice/escape/Key.ice +++ b/ruby/test/Slice/escape/Key.ice @@ -2,7 +2,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -[["underscore", "suppress-warning:deprecated"]] +[["suppress-warning:deprecated"]] module BEGIN { diff --git a/slice/Glacier2/Metrics.ice b/slice/Glacier2/Metrics.ice index da840f22b4e..9322c3f2c40 100644 --- a/slice/Glacier2/Metrics.ice +++ b/slice/Glacier2/Metrics.ice @@ -9,8 +9,6 @@ [["cpp:header-ext:h"]] [["cpp:include:Glacier2/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["python:pkgdir:Glacier2"]] diff --git a/slice/Glacier2/PermissionsVerifier.ice b/slice/Glacier2/PermissionsVerifier.ice index 606a44b2156..153fe950e2d 100644 --- a/slice/Glacier2/PermissionsVerifier.ice +++ b/slice/Glacier2/PermissionsVerifier.ice @@ -38,7 +38,7 @@ module Glacier2 /// @return True if access is granted, or false otherwise. /// @throws PermissionDeniedException Raised if the user access is denied. This can be raised in place of /// returning false with a reason set in the reason out parameter. - ["nonmutating", "cpp:const", "format:sliced"] + ["cpp:const", "format:sliced"] idempotent bool checkPermissions(string userId, string password, out string reason) throws PermissionDeniedException; } @@ -54,7 +54,7 @@ module Glacier2 /// @throws PermissionDeniedException Raised if the user access is denied. This can be raised in place of /// returning false with a reason set in the reason out parameter. /// @see SSLInfo - ["nonmutating", "cpp:const", "format:sliced"] + ["cpp:const", "format:sliced"] idempotent bool authorize(SSLInfo info, out string reason) throws PermissionDeniedException; } diff --git a/slice/Glacier2/Router.ice b/slice/Glacier2/Router.ice index ad1ec67c46e..45d8b51a0ec 100644 --- a/slice/Glacier2/Router.ice +++ b/slice/Glacier2/Router.ice @@ -40,7 +40,7 @@ module Glacier2 /// order for the router to forward callback requests to the intended client. If the Glacier2 server endpoints /// are not set, the returned category is an empty string. /// @return The category. - ["nonmutating", "cpp:const"] idempotent string getCategoryForClient(); + ["cpp:const"] idempotent string getCategoryForClient(); /// Create a per-client session with the router. If a {@link SessionManager} has been installed, a proxy to a /// {@link Session} object is returned to the client. Otherwise, null is returned and only an internal session @@ -90,11 +90,11 @@ module Glacier2 /// Get the value of the session timeout. Sessions are destroyed if they see no activity for this period of /// time. /// @return The timeout (in seconds). - ["nonmutating", "cpp:const"] idempotent long getSessionTimeout(); + ["cpp:const"] idempotent long getSessionTimeout(); /// Get the value of the ACM timeout. Clients supporting connection heartbeats can enable them instead of /// explicitly sending keep alives requests. This method is only available since Ice 3.6. /// @return The timeout (in seconds). - ["nonmutating", "cpp:const"] idempotent int getACMTimeout(); + ["cpp:const"] idempotent int getACMTimeout(); } } diff --git a/slice/Ice/BuiltinSequences.ice b/slice/Ice/BuiltinSequences.ice index 0906218828c..a0ed90ef18d 100644 --- a/slice/Ice/BuiltinSequences.ice +++ b/slice/Ice/BuiltinSequences.ice @@ -18,8 +18,6 @@ [["cpp:include:string"]] [["cpp:include:vector"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/Ice/Context.ice b/slice/Ice/Context.ice index 44baf07f069..1b8b9496f1a 100644 --- a/slice/Ice/Context.ice +++ b/slice/Ice/Context.ice @@ -13,8 +13,6 @@ [["cpp:include:map"]] [["cpp:include:string"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/Ice/EndpointTypes.ice b/slice/Ice/EndpointTypes.ice index 492668fe68a..429fa1a1b3c 100644 --- a/slice/Ice/EndpointTypes.ice +++ b/slice/Ice/EndpointTypes.ice @@ -12,8 +12,6 @@ [["cpp:include:Ice/Config.h"]] [["cpp:include:cstdint"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/Ice/Identity.ice b/slice/Ice/Identity.ice index 338c5f30816..1409c7d55e1 100644 --- a/slice/Ice/Identity.ice +++ b/slice/Ice/Identity.ice @@ -15,8 +15,6 @@ [["cpp:include:string"]] [["cpp:include:vector"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/Ice/Locator.ice b/slice/Ice/Locator.ice index fa2f1bfbfab..d8aeb8c1063 100644 --- a/slice/Ice/Locator.ice +++ b/slice/Ice/Locator.ice @@ -10,8 +10,6 @@ [["cpp:source-include:Ice/Process.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] @@ -63,19 +61,19 @@ module Ice /// @param id The identity. /// @return The proxy, or null if the object is not active. /// @throws ObjectNotFoundException Raised if the object cannot be found. - ["amd", "nonmutating", "cpp:const"] idempotent Object* findObjectById(Identity id) + ["amd", "cpp:const"] idempotent Object* findObjectById(Identity id) throws ObjectNotFoundException; /// Find an adapter by id and return a proxy that contains its endpoints. /// @param id The adapter id. /// @return The adapter proxy, or null if the adapter is not active. /// @throws AdapterNotFoundException Raised if the adapter cannot be found. - ["amd", "nonmutating", "cpp:const"] idempotent Object* findAdapterById(string id) + ["amd", "cpp:const"] idempotent Object* findAdapterById(string id) throws AdapterNotFoundException; /// Get the locator registry. /// @return The locator registry. - ["nonmutating", "cpp:const"] idempotent LocatorRegistry* getRegistry(); + ["cpp:const"] idempotent LocatorRegistry* getRegistry(); } /// The Ice locator registry interface. This interface is used by servers to register adapter endpoints with the diff --git a/slice/Ice/Metrics.ice b/slice/Ice/Metrics.ice index f687a0cc9b1..5f4e721a5dc 100644 --- a/slice/Ice/Metrics.ice +++ b/slice/Ice/Metrics.ice @@ -8,8 +8,6 @@ [["cpp:doxygen:include:Ice/Ice.h"]] [["cpp:header-ext:h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/Ice/OperationMode.ice b/slice/Ice/OperationMode.ice index 5bfe350600e..7a7d8c427c3 100644 --- a/slice/Ice/OperationMode.ice +++ b/slice/Ice/OperationMode.ice @@ -12,8 +12,6 @@ [["cpp:include:Ice/Config.h"]] [["cpp:include:Ice/StreamHelpers.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/Ice/Process.ice b/slice/Ice/Process.ice index f4125beece1..564b4af8ec2 100644 --- a/slice/Ice/Process.ice +++ b/slice/Ice/Process.ice @@ -8,8 +8,6 @@ [["cpp:doxygen:include:Ice/Ice.h"]] [["cpp:header-ext:h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/Ice/PropertiesAdmin.ice b/slice/Ice/PropertiesAdmin.ice index 65e3b9cbd33..5a16bfd67dd 100644 --- a/slice/Ice/PropertiesAdmin.ice +++ b/slice/Ice/PropertiesAdmin.ice @@ -8,8 +8,6 @@ [["cpp:doxygen:include:Ice/Ice.h"]] [["cpp:header-ext:h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/Ice/PropertyDict.ice b/slice/Ice/PropertyDict.ice index 5e31264680c..89727990a35 100644 --- a/slice/Ice/PropertyDict.ice +++ b/slice/Ice/PropertyDict.ice @@ -13,8 +13,6 @@ [["cpp:include:map"]] [["cpp:include:string"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/Ice/RemoteLogger.ice b/slice/Ice/RemoteLogger.ice index 59e2600cf34..e5ba2cedb79 100644 --- a/slice/Ice/RemoteLogger.ice +++ b/slice/Ice/RemoteLogger.ice @@ -9,8 +9,6 @@ [["cpp:header-ext:h"]] [["cpp:include:list"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/Ice/Router.ice b/slice/Ice/Router.ice index b48bf9f43c2..c4e7c6dbb33 100644 --- a/slice/Ice/Router.ice +++ b/slice/Ice/Router.ice @@ -8,8 +8,6 @@ [["cpp:doxygen:include:Ice/Ice.h"]] [["cpp:header-ext:h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] @@ -32,11 +30,11 @@ module Ice /// starting with Ice 3.7. /// The Ice runtime assumes the router has a routing table if the hasRoutingTable is not set. /// @return The router's client proxy. - ["nonmutating", "cpp:const"] idempotent Object* getClientProxy(out tag(1) bool hasRoutingTable); + ["cpp:const"] idempotent Object* getClientProxy(out tag(1) bool hasRoutingTable); /// Get the router's server proxy, i.e., the proxy to use for forwarding requests from the server to the router. /// @return The router's server proxy. - ["nonmutating", "cpp:const"] idempotent Object* getServerProxy(); + ["cpp:const"] idempotent Object* getServerProxy(); /// Add new proxy information to the router's routing table. /// @param proxies The proxies to add. Adding a null proxy is an error. diff --git a/slice/Ice/Version.ice b/slice/Ice/Version.ice index 3867e480b97..fffc19f97de 100644 --- a/slice/Ice/Version.ice +++ b/slice/Ice/Version.ice @@ -14,8 +14,6 @@ [["cpp:include:Ice/Comparable.h"]] [["cpp:include:cstdint"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/IceBox/ServiceManager.ice b/slice/IceBox/ServiceManager.ice index 4989254feb7..cab38de411b 100644 --- a/slice/IceBox/ServiceManager.ice +++ b/slice/IceBox/ServiceManager.ice @@ -9,8 +9,6 @@ [["cpp:header-ext:h"]] [["cpp:include:IceBox/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/IceDiscovery/IceDiscovery.ice b/slice/IceDiscovery/IceDiscovery.ice index b6deede1142..06a58c756d6 100644 --- a/slice/IceDiscovery/IceDiscovery.ice +++ b/slice/IceDiscovery/IceDiscovery.ice @@ -7,8 +7,6 @@ [["cpp:doxygen:include:IceDiscovery/IceDiscovery.h"]] [["cpp:header-ext:h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/IceGrid/Admin.ice b/slice/IceGrid/Admin.ice index bb82f6662ea..a75bd3ed7bb 100644 --- a/slice/IceGrid/Admin.ice +++ b/slice/IceGrid/Admin.ice @@ -9,8 +9,6 @@ [["cpp:header-ext:h"]] [["cpp:include:IceGrid/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] @@ -283,24 +281,24 @@ module IceGrid /// @param name The application name. /// @return The application descriptor. /// @throws ApplicationNotExistException Raised if the application doesn't exist. - ["nonmutating", "cpp:const"] idempotent ApplicationInfo getApplicationInfo(string name) + ["cpp:const"] idempotent ApplicationInfo getApplicationInfo(string name) throws ApplicationNotExistException; /// Get the default application descriptor. /// @return The default application descriptor. /// @throws DeploymentException Raised if the default application descriptor can't be accessed or is invalid. - ["nonmutating", "cpp:const"] idempotent ApplicationDescriptor getDefaultApplicationDescriptor() + ["cpp:const"] idempotent ApplicationDescriptor getDefaultApplicationDescriptor() throws DeploymentException; /// Get all the IceGrid applications currently registered. /// @return The application names. - ["nonmutating", "cpp:const"] idempotent Ice::StringSeq getAllApplicationNames(); + ["cpp:const"] idempotent Ice::StringSeq getAllApplicationNames(); /// Get the server information for the server with the given id. /// @param id The server id. /// @throws ServerNotExistException Raised if the server doesn't exist. /// @return The server information. - ["nonmutating", "cpp:const"] idempotent ServerInfo getServerInfo(string id) + ["cpp:const"] idempotent ServerInfo getServerInfo(string id) throws ServerNotExistException; /// Get a server's state. @@ -309,7 +307,7 @@ module IceGrid /// @throws ServerNotExistException Raised if the server doesn't exist. /// @throws NodeUnreachableException Raised if the node could not be reached. /// @throws DeploymentException Raised if the server couldn't be deployed on the node. - ["nonmutating", "cpp:const"] idempotent ServerState getServerState(string id) + ["cpp:const"] idempotent ServerState getServerState(string id) throws ServerNotExistException, NodeUnreachableException, DeploymentException; /// Get a server's system process id. The process id is operating system dependent. @@ -318,7 +316,7 @@ module IceGrid /// @throws ServerNotExistException Raised if the server doesn't exist. /// @throws NodeUnreachableException Raised if the node could not be reached. /// @throws DeploymentException Raised if the server couldn't be deployed on the node. - ["nonmutating", "cpp:const"] idempotent int getServerPid(string id) + ["cpp:const"] idempotent int getServerPid(string id) throws ServerNotExistException, NodeUnreachableException, DeploymentException; /// Get the category for server admin objects. You can manufacture a server admin proxy from the admin proxy by @@ -354,7 +352,7 @@ module IceGrid /// @throws ServerNotExistException Raised if the server doesn't exist. /// @throws NodeUnreachableException Raised if the node could not be reached. /// @throws DeploymentException Raised if the server couldn't be deployed on the node. - ["nonmutating", "cpp:const"] idempotent bool isServerEnabled(string id) + ["cpp:const"] idempotent bool isServerEnabled(string id) throws ServerNotExistException, NodeUnreachableException, DeploymentException; /// Start a server and wait for its activation. @@ -387,7 +385,7 @@ module IceGrid /// Get all the server ids registered with IceGrid. /// @return The server ids. - ["nonmutating", "cpp:const"] idempotent Ice::StringSeq getAllServerIds(); + ["cpp:const"] idempotent Ice::StringSeq getAllServerIds(); /// Get the adapter information for the replica group or adapter with the given id. /// @param id The adapter id. @@ -395,7 +393,7 @@ module IceGrid /// will contain only one element. If the given id refers to a replica group, the sequence will contain the /// adapter information of each member of the replica group. /// @throws AdapterNotExistException Raised if the adapter or replica group doesn't exist. - ["nonmutating", "cpp:const"] idempotent AdapterInfoSeq getAdapterInfo(string id) + ["cpp:const"] idempotent AdapterInfoSeq getAdapterInfo(string id) throws AdapterNotExistException; /// Remove the adapter with the given id. @@ -407,7 +405,7 @@ module IceGrid /// Get all the adapter ids registered with IceGrid. /// @return The adapter ids. - ["nonmutating", "cpp:const"] idempotent Ice::StringSeq getAllAdapterIds(); + ["cpp:const"] idempotent Ice::StringSeq getAllAdapterIds(); /// Add an object to the object registry. IceGrid will get the object type by calling ice_id on the /// given proxy. The object must be reachable. @@ -448,25 +446,25 @@ module IceGrid /// @param id The identity of the object. /// @return The object info. /// @throws ObjectNotRegisteredException Raised if the object isn't registered with the registry. - ["nonmutating", "cpp:const"] idempotent ObjectInfo getObjectInfo(Ice::Identity id) + ["cpp:const"] idempotent ObjectInfo getObjectInfo(Ice::Identity id) throws ObjectNotRegisteredException; /// Get the object info of all the registered objects with the given type. /// @param type The type of the object. /// @return The object infos. - ["nonmutating", "cpp:const"] idempotent ObjectInfoSeq getObjectInfosByType(string type); + ["cpp:const"] idempotent ObjectInfoSeq getObjectInfosByType(string type); /// Get the object info of all the registered objects whose stringified identities match the given expression. /// @param expr The expression to match against the stringified identities of registered objects. The expression /// may contain a trailing wildcard (*) character. /// @return All the object infos with a stringified identity matching the given expression. - ["nonmutating", "cpp:const"] idempotent ObjectInfoSeq getAllObjectInfos(string expr); + ["cpp:const"] idempotent ObjectInfoSeq getAllObjectInfos(string expr); /// Ping an IceGrid node to see if it is active. /// @param name The node name. /// @return true if the node ping succeeded, false otherwise. /// @throws NodeNotExistException Raised if the node doesn't exist. - ["nonmutating", "cpp:const"] idempotent bool pingNode(string name) + ["cpp:const"] idempotent bool pingNode(string name) throws NodeNotExistException; /// Get the load averages of the node. @@ -474,7 +472,7 @@ module IceGrid /// @return The node load information. /// @throws NodeNotExistException Raised if the node doesn't exist. /// @throws NodeUnreachableException Raised if the node could not be reached. - ["nonmutating", "cpp:const"] idempotent LoadInfo getNodeLoad(string name) + ["cpp:const"] idempotent LoadInfo getNodeLoad(string name) throws NodeNotExistException, NodeUnreachableException; /// Get the node information for the node with the given name. @@ -482,7 +480,7 @@ module IceGrid /// @return The node information. /// @throws NodeNotExistException Raised if the node doesn't exist. /// @throws NodeUnreachableException Raised if the node could not be reached. - ["nonmutating", "cpp:const"] idempotent NodeInfo getNodeInfo(string name) + ["cpp:const"] idempotent NodeInfo getNodeInfo(string name) throws NodeNotExistException, NodeUnreachableException; /// Get a proxy to the IceGrid node's admin object. @@ -500,7 +498,7 @@ module IceGrid /// @return The number of processor sockets or 1 if the number of sockets can't determined. /// @throws NodeNotExistException Raised if the node doesn't exist. /// @throws NodeUnreachableException Raised if the node could not be reached. - ["nonmutating", "cpp:const"] idempotent int getNodeProcessorSocketCount(string name) + ["cpp:const"] idempotent int getNodeProcessorSocketCount(string name) throws NodeNotExistException, NodeUnreachableException; /// Shutdown an IceGrid node. @@ -515,12 +513,12 @@ module IceGrid /// @return The node hostname. /// @throws NodeNotExistException Raised if the node doesn't exist. /// @throws NodeUnreachableException Raised if the node could not be reached. - ["nonmutating", "cpp:const"] idempotent string getNodeHostname(string name) + ["cpp:const"] idempotent string getNodeHostname(string name) throws NodeNotExistException, NodeUnreachableException; /// Get all the IceGrid nodes currently registered. /// @return The node names. - ["nonmutating", "cpp:const"] idempotent Ice::StringSeq getAllNodeNames(); + ["cpp:const"] idempotent Ice::StringSeq getAllNodeNames(); /// Ping an IceGrid registry to see if it is active. /// @param name The registry name. @@ -762,7 +760,7 @@ module IceGrid /// Get the admin interface. The admin object returned by this operation can only be accessed by the session. /// @return The admin interface proxy. The returned proxy is never null. - ["nonmutating", "cpp:const"] idempotent Admin* getAdmin(); + ["cpp:const"] idempotent Admin* getAdmin(); /// Get a "template" proxy for admin callback objects. An Admin client uses this proxy to set the category of /// its callback objects, and the published endpoints of the object adapter hosting the admin callback objects. diff --git a/slice/IceGrid/Descriptor.ice b/slice/IceGrid/Descriptor.ice index 659103803e5..bc6cb7f812d 100644 --- a/slice/IceGrid/Descriptor.ice +++ b/slice/IceGrid/Descriptor.ice @@ -8,8 +8,6 @@ [["cpp:header-ext:h"]] [["cpp:include:IceGrid/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/IceGrid/Exception.ice b/slice/IceGrid/Exception.ice index 44f281aa3a7..f6e8c43cbce 100644 --- a/slice/IceGrid/Exception.ice +++ b/slice/IceGrid/Exception.ice @@ -8,8 +8,6 @@ [["cpp:header-ext:h"]] [["cpp:include:IceGrid/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/IceGrid/FileParser.ice b/slice/IceGrid/FileParser.ice index 165a1e97eed..5cef043c627 100644 --- a/slice/IceGrid/FileParser.ice +++ b/slice/IceGrid/FileParser.ice @@ -9,8 +9,6 @@ [["cpp:header-ext:h"]] [["cpp:include:IceGrid/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/IceGrid/Registry.ice b/slice/IceGrid/Registry.ice index d54bfd3cb34..45afbcc8de3 100644 --- a/slice/IceGrid/Registry.ice +++ b/slice/IceGrid/Registry.ice @@ -9,8 +9,6 @@ [["cpp:header-ext:h"]] [["cpp:include:IceGrid/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] @@ -45,13 +43,13 @@ module IceGrid /// Find a well-known object by identity. /// @param id The identity. /// @return The proxy or null if no such object has been found. - ["nonmutating", "cpp:const"] idempotent Object* findObjectById(Ice::Identity id); + ["cpp:const"] idempotent Object* findObjectById(Ice::Identity id); /// Find a well-known object by type. If there are several objects registered for the given type, the object is /// randomly selected. /// @param type The object type. /// @return The proxy or null, if no such object has been found. - ["nonmutating", "cpp:const"] idempotent Object* findObjectByType(string type); + ["cpp:const"] idempotent Object* findObjectByType(string type); /// Find a well-known object by type on the least-loaded node. If the registry does not know which node hosts /// the object (for example, because the object was registered with a direct proxy), the registry assumes the @@ -59,13 +57,13 @@ module IceGrid /// @param type The object type. /// @param sample The sampling interval. /// @return The proxy or null, if no such object has been found. - ["nonmutating", "cpp:const"] + ["cpp:const"] idempotent Object* findObjectByTypeOnLeastLoadedNode(string type, LoadSample sample); /// Find all the well-known objects with the given type. /// @param type The object type. /// @return The proxies or an empty sequence, if no such objects have been found. - ["nonmutating", "cpp:const"] idempotent Ice::ObjectProxySeq findAllObjectsByType(string type); + ["cpp:const"] idempotent Ice::ObjectProxySeq findAllObjectsByType(string type); /// Find all the object replicas associated with the given proxy. If the given proxy is not an indirect proxy /// from a replica group, an empty sequence is returned. @@ -117,12 +115,12 @@ module IceGrid /// @see Session#keepAlive /// @see AdminSession#keepAlive /// @return The timeout (in seconds). - ["nonmutating", "cpp:const"] idempotent int getSessionTimeout(); + ["cpp:const"] idempotent int getSessionTimeout(); /// Get the value of the ACM timeout. Clients supporting ACM connection heartbeats can enable them instead of /// explicitly sending keep alives requests. This method is only available since Ice 3.6. /// @return The timeout (in seconds). - ["nonmutating", "cpp:const"] idempotent int getACMTimeout(); + ["cpp:const"] idempotent int getACMTimeout(); } /// The IceGrid locator interface provides access to the {@link Query} and {@link Registry} object of the IceGrid diff --git a/slice/IceGrid/Session.ice b/slice/IceGrid/Session.ice index 76f4609fb16..3d9a698df8f 100644 --- a/slice/IceGrid/Session.ice +++ b/slice/IceGrid/Session.ice @@ -9,8 +9,6 @@ [["cpp:header-ext:h"]] [["cpp:include:IceGrid/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/IceGrid/UserAccountMapper.ice b/slice/IceGrid/UserAccountMapper.ice index f18bd55115a..27f68acb997 100644 --- a/slice/IceGrid/UserAccountMapper.ice +++ b/slice/IceGrid/UserAccountMapper.ice @@ -9,8 +9,6 @@ [["cpp:header-ext:h"]] [["cpp:include:IceGrid/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice b/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice index 3e6ec8fe670..d43b82a08c5 100644 --- a/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +++ b/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice @@ -7,8 +7,6 @@ [["cpp:doxygen:include:IceLocatorDiscovery/IceLocatorDiscovery.h"]] [["cpp:header-ext:h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/slice/IceStorm/IceStorm.ice b/slice/IceStorm/IceStorm.ice index 5164a7782c8..9752a7a7615 100644 --- a/slice/IceStorm/IceStorm.ice +++ b/slice/IceStorm/IceStorm.ice @@ -9,8 +9,6 @@ [["cpp:header-ext:h"]] [["cpp:include:IceStorm/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] @@ -90,19 +88,19 @@ interface Topic /// Get the name of this topic. /// @return The name of the topic. /// @see TopicManager#create - ["nonmutating", "cpp:const"] idempotent string getName(); + ["cpp:const"] idempotent string getName(); /// Get a proxy to a publisher object for this topic. To publish data to a topic, the publisher calls getPublisher /// and then creates a proxy with the publisher type from this proxy. If a replicated IceStorm /// deployment is used this call may return a replicated proxy. The returned proxy is never null. /// @return A proxy to publish data on this topic. - ["nonmutating", "cpp:const"] idempotent Object* getPublisher(); + ["cpp:const"] idempotent Object* getPublisher(); /// Get a non-replicated proxy to a publisher object for this topic. To publish data to a topic, the publisher /// calls getPublisher and then creates a proxy with the publisher type from this proxy. The returned proxy is /// never null. /// @return A proxy to publish data on this topic. - ["nonmutating", "cpp:const"] idempotent Object* getNonReplicatedPublisher(); + ["cpp:const"] idempotent Object* getNonReplicatedPublisher(); /// Subscribe with the given qos to this topic. A per-subscriber publisher object is returned. /// @param theQoS The quality of service parameters for this subscription. @@ -134,11 +132,11 @@ interface Topic /// Retrieve information on the current links. /// @return A sequence of LinkInfo objects. - ["nonmutating", "cpp:const"] idempotent LinkInfoSeq getLinkInfoSeq(); + ["cpp:const"] idempotent LinkInfoSeq getLinkInfoSeq(); /// Retrieve the list of subscribers for this topic. /// @return The sequence of Ice identities for the subscriber objects. - ["nonmutating", "cpp:const"] Ice::IdentitySeq getSubscribers(); + ["cpp:const"] Ice::IdentitySeq getSubscribers(); /// Destroy the topic. void destroy(); diff --git a/slice/IceStorm/Metrics.ice b/slice/IceStorm/Metrics.ice index df465f53d65..64d5c6be67c 100644 --- a/slice/IceStorm/Metrics.ice +++ b/slice/IceStorm/Metrics.ice @@ -9,8 +9,6 @@ [["cpp:header-ext:h"]] [["cpp:include:IceStorm/Config.h"]] -[["ice-prefix"]] - [["js:module:ice"]] [["js:cjs-module"]] diff --git a/swift/test/Ice/operations/Oneways.swift b/swift/test/Ice/operations/Oneways.swift index 3c2d4f2e79b..7a16e1b8b17 100644 --- a/swift/test/Ice/operations/Oneways.swift +++ b/swift/test/Ice/operations/Oneways.swift @@ -11,7 +11,6 @@ func oneways(_ helper: TestHelper, _ prx: MyClassPrx) throws { try p.ice_ping() try p.opVoid() try p.opIdempotent() - try p.opNonmutating() do { _ = try p.opByte(p1: 0xFF, p2: 0x0F) diff --git a/swift/test/Ice/operations/OnewaysAMI.swift b/swift/test/Ice/operations/OnewaysAMI.swift index 2435f3b5213..d63c2bc9a04 100644 --- a/swift/test/Ice/operations/OnewaysAMI.swift +++ b/swift/test/Ice/operations/OnewaysAMI.swift @@ -52,15 +52,6 @@ func onewaysAMI(_ helper: TestHelper, _ proxy: MyClassPrx) throws { group.wait() } - do { - let group = DispatchGroup() - group.enter() - _ = p.opNonmutatingAsync { _ in - group.leave() - } - group.wait() - } - do { try firstly { p.opByteAsync(p1: 0xFF, p2: 0x0F) diff --git a/swift/test/Ice/operations/Test.ice b/swift/test/Ice/operations/Test.ice index 31ece6d8473..6167f1eba03 100644 --- a/swift/test/Ice/operations/Test.ice +++ b/swift/test/Ice/operations/Test.ice @@ -235,8 +235,6 @@ interface MyClass idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/swift/test/Ice/operations/TestAMD.ice b/swift/test/Ice/operations/TestAMD.ice index 0143f9adf64..839c94f286b 100644 --- a/swift/test/Ice/operations/TestAMD.ice +++ b/swift/test/Ice/operations/TestAMD.ice @@ -232,8 +232,6 @@ dictionary MyEnumMyEnumSD; idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); - byte opByte1(byte opByte1); short opShort1(short opShort1); int opInt1(int opInt1); diff --git a/swift/test/Ice/operations/TestAMDI.swift b/swift/test/Ice/operations/TestAMDI.swift index 17cff750581..1912b42b0a6 100644 --- a/swift/test/Ice/operations/TestAMDI.swift +++ b/swift/test/Ice/operations/TestAMDI.swift @@ -456,17 +456,6 @@ class MyDerivedClassI: ObjectI, MyDerivedClass { } } - func opNonmutatingAsync(current: Current) -> Promise { - return Promise { seal in - do { - try _helper.test(current.mode == .Nonmutating) - seal.fulfill(()) - } catch { - seal.reject(error) - } - } - } - func opByte1Async(opByte1: UInt8, current _: Current) -> Promise { return Promise.value(opByte1) } diff --git a/swift/test/Ice/operations/TestI.swift b/swift/test/Ice/operations/TestI.swift index 93ccb5a143a..a4c1206f33b 100644 --- a/swift/test/Ice/operations/TestI.swift +++ b/swift/test/Ice/operations/TestI.swift @@ -425,10 +425,6 @@ class MyDerivedClassI: ObjectI, MyDerivedClass { try _helper.test(current.mode == .Idempotent) } - func opNonmutating(current: Ice.Current) throws { - try _helper.test(current.mode == .Nonmutating) - } - func opDerived(current _: Ice.Current) throws {} func opByte1(opByte1: UInt8, current _: Ice.Current) throws -> UInt8 { diff --git a/swift/test/Ice/operations/Twoways.swift b/swift/test/Ice/operations/Twoways.swift index c3b032df3a1..48fc8ab101e 100644 --- a/swift/test/Ice/operations/Twoways.swift +++ b/swift/test/Ice/operations/Twoways.swift @@ -1143,10 +1143,6 @@ func twoways(_ helper: TestHelper, _ p: MyClassPrx) throws { try p.opIdempotent() } - do { - try p.opNonmutating() - } - do { try test(p.opByte1(0xFF) == 0xFF) try test(p.opShort1(0x7FFF) == 0x7FFF) diff --git a/swift/test/Slice/escape/Clash.ice b/swift/test/Slice/escape/Clash.ice index 7b55fe7d90b..f62b94a580e 100644 --- a/swift/test/Slice/escape/Clash.ice +++ b/swift/test/Slice/escape/Clash.ice @@ -2,8 +2,6 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -[["underscore"]] - module Clash { diff --git a/swift/test/Slice/escape/Key.ice b/swift/test/Slice/escape/Key.ice index b74babcffb8..db40a526f52 100644 --- a/swift/test/Slice/escape/Key.ice +++ b/swift/test/Slice/escape/Key.ice @@ -2,7 +2,6 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -[["underscore"]] [["suppress-warning:deprecated"]] module and From 37519d185b169c50a0c9f5bd0cc4156cdc0ab9b0 Mon Sep 17 00:00:00 2001 From: Austin Henriksen Date: Thu, 4 Apr 2024 11:58:49 -0400 Subject: [PATCH 05/13] Add Custom Errors Hooks back to the Scanners (#2017) --- cpp/include/IceUtil/ScannerConfig.h | 4 + cpp/src/IceGrid/Scanner.cpp | 43 ++++++--- cpp/src/IceGrid/Scanner.l | 13 +++ cpp/src/IceStorm/Scanner.cpp | 70 ++++++++------ cpp/src/IceStorm/Scanner.l | 13 +++ cpp/src/Slice/Scanner.cpp | 138 +++++++++++++++------------- cpp/src/Slice/Scanner.l | 12 +++ 7 files changed, 187 insertions(+), 106 deletions(-) diff --git a/cpp/include/IceUtil/ScannerConfig.h b/cpp/include/IceUtil/ScannerConfig.h index aded7688d7f..04a00e132b0 100644 --- a/cpp/include/IceUtil/ScannerConfig.h +++ b/cpp/include/IceUtil/ScannerConfig.h @@ -8,7 +8,9 @@ #include "Config.h" // Required by generated Scanners. #ifdef _MSC_VER +// Suppress the scanner's inclusion of the non-ANSI header file 'unistd.h'. # define YY_NO_UNISTD_H + // Warning C4018: signed/unsigned mismatch # pragma warning(disable : 4018) // Warning C4244: conversion from `int` to `_Elem`, possible loss of data @@ -16,6 +18,8 @@ // warning C4267: conversion from 'size_t' to 'int', possible loss of data // The result of fread() is a size_t and gets inserted into an int # pragma warning(disable : 4267) +// Warning C4505: unreferenced function with internal linkage 'yy_fatal_error' +# pragma warning(disable : 4505) #endif #ifdef __clang__ diff --git a/cpp/src/IceGrid/Scanner.cpp b/cpp/src/IceGrid/Scanner.cpp index fb374a72cc8..89b050f4f16 100644 --- a/cpp/src/IceGrid/Scanner.cpp +++ b/cpp/src/IceGrid/Scanner.cpp @@ -426,6 +426,8 @@ char* yytext; #include "Ice/Ice.h" #include "Parser.h" +#include + using namespace std; using namespace Ice; using namespace IceGrid; @@ -436,6 +438,7 @@ namespace IceGrid StringTokenMap keywordMap; void initScanner(); + void yynoreturn fatalError(const char* msg); string parseDoubleQuotedString(); string parseSingleQuotedString(); } @@ -443,9 +446,10 @@ namespace IceGrid // Override some of the functions flex auto-generates with our own implementations. #define YY_USER_INIT initScanner(); #define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) +#define YY_FATAL_ERROR(msg) fatalError(msg); -#line 497 "src/IceGrid/Scanner.cpp" -#line 38 "src/IceGrid/Scanner.l" +#line 501 "src/IceGrid/Scanner.cpp" +#line 42 "src/IceGrid/Scanner.l" /* Instructs flex to not suppress any warnings when generating the scanner. */ /* By default flex will 'default match' any text it encounters that doesn't match any specified rules. This * option disables default-matching (it throws 'scanner jammed' instead) to make grammar holes more obvious. */ @@ -457,7 +461,7 @@ namespace IceGrid /* Directs flex to store matched text as 'char *' instead of char arrays, for improved performance. */ /* We always want the scanner to run in interactive mode. */ /* Disables the generation of functions we don't use to reduce clutter, and possibly improve performance. */ -#line 510 "src/IceGrid/Scanner.cpp" +#line 514 "src/IceGrid/Scanner.cpp" #define INITIAL 0 @@ -659,9 +663,9 @@ YY_DECL } { -#line 69 "src/IceGrid/Scanner.l" +#line 73 "src/IceGrid/Scanner.l" -#line 714 "src/IceGrid/Scanner.cpp" +#line 718 "src/IceGrid/Scanner.cpp" while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */ { @@ -719,7 +723,7 @@ YY_DECL case 1: YY_RULE_SETUP -#line 71 "src/IceGrid/Scanner.l" +#line 75 "src/IceGrid/Scanner.l" { // C++-style comment int c; @@ -731,7 +735,7 @@ YY_DECL YY_BREAK case 2: YY_RULE_SETUP -#line 81 "src/IceGrid/Scanner.l" +#line 85 "src/IceGrid/Scanner.l" { // C-style comment while (true) @@ -760,7 +764,7 @@ YY_DECL case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 106 "src/IceGrid/Scanner.l" +#line 110 "src/IceGrid/Scanner.l" { size_t len = strlen(yytext); for (size_t i = 0; i < len; ++i) @@ -775,14 +779,14 @@ YY_DECL case 4: /* rule 4 can match eol */ YY_RULE_SETUP -#line 117 "src/IceGrid/Scanner.l" +#line 121 "src/IceGrid/Scanner.l" { return ';'; } YY_BREAK case 5: YY_RULE_SETUP -#line 121 "src/IceGrid/Scanner.l" +#line 125 "src/IceGrid/Scanner.l" { // "..."-type strings string s = parseDoubleQuotedString(); @@ -793,7 +797,7 @@ YY_DECL YY_BREAK case 6: YY_RULE_SETUP -#line 129 "src/IceGrid/Scanner.l" +#line 133 "src/IceGrid/Scanner.l" { // '...'-type strings string s; @@ -821,7 +825,7 @@ YY_DECL YY_BREAK case 7: YY_RULE_SETUP -#line 154 "src/IceGrid/Scanner.l" +#line 158 "src/IceGrid/Scanner.l" { // Simple strings string s; @@ -860,10 +864,10 @@ YY_DECL YY_BREAK case 8: YY_RULE_SETUP -#line 190 "src/IceGrid/Scanner.l" +#line 194 "src/IceGrid/Scanner.l" YY_FATAL_ERROR("flex scanner jammed"); YY_BREAK -#line 918 "src/IceGrid/Scanner.cpp" +#line 922 "src/IceGrid/Scanner.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1711,7 +1715,7 @@ yyfree(void* ptr) #define YYTABLES_NAME "yytables" -#line 190 "src/IceGrid/Scanner.l" +#line 194 "src/IceGrid/Scanner.l" namespace IceGrid { @@ -1761,6 +1765,15 @@ namespace IceGrid keywordMap["disable"] = ICE_GRID_DISABLE; } + // This function is called whenever the scanner encounters an unrecoverable error. + void yynoreturn fatalError(const char* msg) + { + cerr << "fatal error: " << msg << endl + << "\tlast matched text: `" << yytext << "'" << endl + << "\tlast scanner state: `" << YY_START << "'" << endl; + exit(YY_EXIT_FAILURE); + } + string parseDoubleQuotedString() { string s; diff --git a/cpp/src/IceGrid/Scanner.l b/cpp/src/IceGrid/Scanner.l index 509244d01da..2e9899d3ea3 100644 --- a/cpp/src/IceGrid/Scanner.l +++ b/cpp/src/IceGrid/Scanner.l @@ -14,6 +14,8 @@ #include "Parser.h" #include "Grammar.h" +#include + using namespace std; using namespace Ice; using namespace IceGrid; @@ -24,6 +26,7 @@ namespace IceGrid StringTokenMap keywordMap; void initScanner(); + void yynoreturn fatalError(const char* msg); string parseDoubleQuotedString(); string parseSingleQuotedString(); } @@ -31,6 +34,7 @@ namespace IceGrid // Override some of the functions flex auto-generates with our own implementations. #define YY_USER_INIT initScanner(); #define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) +#define YY_FATAL_ERROR(msg) fatalError(msg); %} @@ -236,6 +240,15 @@ namespace IceGrid keywordMap["disable"] = ICE_GRID_DISABLE; } + // This function is called whenever the scanner encounters an unrecoverable error. + void yynoreturn fatalError(const char* msg) + { + cerr << "fatal error: " << msg << endl + << "\tlast matched text: `" << yytext << "'" << endl + << "\tlast scanner state: `" << YY_START << "'" << endl; + exit(YY_EXIT_FAILURE); + } + string parseDoubleQuotedString() { diff --git a/cpp/src/IceStorm/Scanner.cpp b/cpp/src/IceStorm/Scanner.cpp index 5191e4e1c32..3dba5be917b 100644 --- a/cpp/src/IceStorm/Scanner.cpp +++ b/cpp/src/IceStorm/Scanner.cpp @@ -65,6 +65,7 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; # else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -173,7 +174,7 @@ typedef struct yy_buffer_state* YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern int yyleng; +extern yy_size_t yyleng; extern FILE *yyin, *yyout; @@ -214,7 +215,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -280,8 +281,8 @@ static YY_BUFFER_STATE* yy_buffer_stack = NULL; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ static char* yy_c_buf_p = NULL; @@ -308,7 +309,7 @@ static void yy_init_buffer(YY_BUFFER_STATE b, FILE* file); YY_BUFFER_STATE yy_scan_buffer(char* base, yy_size_t size); YY_BUFFER_STATE yy_scan_string(const char* yy_str); -YY_BUFFER_STATE yy_scan_bytes(const char* bytes, int len); +YY_BUFFER_STATE yy_scan_bytes(const char* bytes, yy_size_t len); void* yyalloc(yy_size_t); void* yyrealloc(void*, yy_size_t); @@ -364,7 +365,7 @@ static void yynoreturn yy_fatal_error(const char* msg); */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (int)(yy_cp - yy_bp); \ + yyleng = (yy_size_t)(yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; @@ -425,6 +426,8 @@ char* yytext; #include "Ice/Ice.h" #include "Parser.h" +#include + using namespace std; using namespace Ice; using namespace IceStorm; @@ -435,14 +438,16 @@ namespace IceStorm StringTokenMap keywordMap; void initScanner(); + void yynoreturn fatalError(const char* msg); } // Override some of the functions flex auto-generates with our own implementations. #define YY_USER_INIT initScanner(); #define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) +#define YY_FATAL_ERROR(msg) fatalError(msg); -#line 494 "src/IceStorm/Scanner.cpp" -#line 36 "src/IceStorm/Scanner.l" +#line 499 "src/IceStorm/Scanner.cpp" +#line 40 "src/IceStorm/Scanner.l" /* Instructs flex to not suppress any warnings when generating the scanner. */ /* By default flex will 'default match' any text it encounters that doesn't match any specified rules. This * option disables default-matching (it throws 'scanner jammed' instead) to make grammar holes more obvious. */ @@ -454,7 +459,7 @@ namespace IceStorm /* Directs flex to store matched text as 'char *' instead of char arrays, for improved performance. */ /* We always want the scanner to run in interactive mode. */ /* Disables the generation of functions we don't use to reduce clutter, and possibly improve performance. */ -#line 507 "src/IceStorm/Scanner.cpp" +#line 512 "src/IceStorm/Scanner.cpp" #define INITIAL 0 @@ -546,7 +551,7 @@ static int input(void); if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive) \ { \ int c = '*'; \ - int n; \ + yy_size_t n; \ for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n) \ buf[n] = (char)c; \ if (c == '\n') \ @@ -656,9 +661,9 @@ YY_DECL } { -#line 67 "src/IceStorm/Scanner.l" +#line 71 "src/IceStorm/Scanner.l" -#line 711 "src/IceStorm/Scanner.cpp" +#line 716 "src/IceStorm/Scanner.cpp" while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */ { @@ -716,7 +721,7 @@ YY_DECL case 1: YY_RULE_SETUP -#line 69 "src/IceStorm/Scanner.l" +#line 73 "src/IceStorm/Scanner.l" { // C++-style comment int c; @@ -728,7 +733,7 @@ YY_DECL YY_BREAK case 2: YY_RULE_SETUP -#line 79 "src/IceStorm/Scanner.l" +#line 83 "src/IceStorm/Scanner.l" { // C-style comment while (true) @@ -757,7 +762,7 @@ YY_DECL case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 104 "src/IceStorm/Scanner.l" +#line 108 "src/IceStorm/Scanner.l" { size_t len = strlen(yytext); for (size_t i = 0; i < len; ++i) @@ -772,14 +777,14 @@ YY_DECL case 4: /* rule 4 can match eol */ YY_RULE_SETUP -#line 115 "src/IceStorm/Scanner.l" +#line 119 "src/IceStorm/Scanner.l" { return ';'; } YY_BREAK case 5: YY_RULE_SETUP -#line 119 "src/IceStorm/Scanner.l" +#line 123 "src/IceStorm/Scanner.l" { // "..."-type strings string s; @@ -826,7 +831,7 @@ YY_DECL YY_BREAK case 6: YY_RULE_SETUP -#line 163 "src/IceStorm/Scanner.l" +#line 167 "src/IceStorm/Scanner.l" { // '...'-type strings string s; @@ -854,7 +859,7 @@ YY_DECL YY_BREAK case 7: YY_RULE_SETUP -#line 188 "src/IceStorm/Scanner.l" +#line 192 "src/IceStorm/Scanner.l" { // Simple strings string s; @@ -884,10 +889,10 @@ YY_DECL YY_BREAK case 8: YY_RULE_SETUP -#line 215 "src/IceStorm/Scanner.l" +#line 219 "src/IceStorm/Scanner.l" YY_FATAL_ERROR("flex scanner jammed"); YY_BREAK -#line 942 "src/IceStorm/Scanner.cpp" +#line 947 "src/IceStorm/Scanner.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1072,7 +1077,7 @@ yy_get_next_buffer(void) else { - int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */ @@ -1084,7 +1089,7 @@ yy_get_next_buffer(void) if (b->yy_is_our_buffer) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if (new_size <= 0) b->yy_buf_size += b->yy_buf_size / 8; @@ -1137,7 +1142,7 @@ yy_get_next_buffer(void) if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char*)yyrealloc((void*)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t)new_size); if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) @@ -1229,7 +1234,7 @@ yyunput(int c, char* yy_bp) if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - int number_to_move = (yy_n_chars) + 2; + yy_size_t number_to_move = (yy_n_chars) + 2; char* dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; char* source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; @@ -1279,7 +1284,7 @@ input(void) else { /* need more input */ - int offset = (int)((yy_c_buf_p) - (yytext_ptr)); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch (yy_get_next_buffer()) @@ -1615,7 +1620,7 @@ yy_fatal_error(const char* msg) do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ + yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg); \ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ @@ -1735,7 +1740,7 @@ yyfree(void* ptr) #define YYTABLES_NAME "yytables" -#line 215 "src/IceStorm/Scanner.l" +#line 219 "src/IceStorm/Scanner.l" namespace IceStorm { @@ -1756,4 +1761,13 @@ namespace IceStorm keywordMap["replica"] = ICE_STORM_REPLICA; keywordMap["subscribers"] = ICE_STORM_SUBSCRIBERS; } + + // This function is called whenever the scanner encounters an unrecoverable error. + void yynoreturn fatalError(const char* msg) + { + cerr << "fatal error: " << msg << endl + << "\tlast matched text: `" << yytext << "'" << endl + << "\tlast scanner state: `" << YY_START << "'" << endl; + exit(YY_EXIT_FAILURE); + } } diff --git a/cpp/src/IceStorm/Scanner.l b/cpp/src/IceStorm/Scanner.l index 2e3390880b5..b26f573da0e 100644 --- a/cpp/src/IceStorm/Scanner.l +++ b/cpp/src/IceStorm/Scanner.l @@ -14,6 +14,8 @@ #include "Parser.h" #include "Grammar.h" +#include + using namespace std; using namespace Ice; using namespace IceStorm; @@ -24,11 +26,13 @@ namespace IceStorm StringTokenMap keywordMap; void initScanner(); + void yynoreturn fatalError(const char* msg); } // Override some of the functions flex auto-generates with our own implementations. #define YY_USER_INIT initScanner(); #define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) +#define YY_FATAL_ERROR(msg) fatalError(msg); %} @@ -232,4 +236,13 @@ namespace IceStorm keywordMap["replica"] = ICE_STORM_REPLICA; keywordMap["subscribers"] = ICE_STORM_SUBSCRIBERS; } + + // This function is called whenever the scanner encounters an unrecoverable error. + void yynoreturn fatalError(const char* msg) + { + cerr << "fatal error: " << msg << endl + << "\tlast matched text: `" << yytext << "'" << endl + << "\tlast scanner state: `" << YY_START << "'" << endl; + exit(YY_EXIT_FAILURE); + } } diff --git a/cpp/src/Slice/Scanner.cpp b/cpp/src/Slice/Scanner.cpp index 4861aec5980..b1185151f37 100644 --- a/cpp/src/Slice/Scanner.cpp +++ b/cpp/src/Slice/Scanner.cpp @@ -931,10 +931,10 @@ static char* yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 1; -static const flex_int32_t yy_rule_linenum[49] = {0, 120, 134, 135, 142, 143, 144, 151, 170, 183, 193, 200, 201, - 213, 214, 222, 233, 243, 251, 269, 292, 320, 325, 328, 334, 335, - 340, 346, 365, 370, 376, 377, 392, 397, 405, 410, 425, 435, 440, - 444, 449, 455, 461, 498, 508, 511, 518, 522, 536}; +static const flex_int32_t yy_rule_linenum[49] = {0, 123, 137, 138, 145, 146, 147, 154, 173, 186, 196, 203, 204, + 216, 217, 225, 236, 246, 254, 272, 295, 323, 328, 331, 337, 338, + 343, 349, 368, 373, 379, 380, 395, 400, 408, 413, 428, 438, 443, + 447, 452, 458, 464, 501, 511, 514, 521, 525, 539}; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -956,6 +956,7 @@ char* yytext; #include #include #include +#include using namespace std; using namespace Slice; @@ -986,14 +987,16 @@ namespace void initScanner(); void preAction(); + void yynoreturn fatalError(const char* msg); } // Override some of the functions flex auto-generates with our own implementations. #define YY_USER_INIT initScanner(); #define YY_USER_ACTION preAction(); +#define YY_FATAL_ERROR(msg) fatalError(msg); -#line 1179 "src/Slice/Scanner.cpp" -#line 58 "src/Slice/Scanner.l" +#line 1182 "src/Slice/Scanner.cpp" +#line 61 "src/Slice/Scanner.l" /* Changes the default prefix of 'yy' to 'slice_' for functions and variables in the generated code. */ /* Instructs flex to not suppress any warnings when generating the scanner. */ /* Instructs flex to generate a scanner that supports verbose outputting (debug mode). */ @@ -1014,7 +1017,7 @@ namespace /* The scanner also has a built in 'INITIAL' start-condition state, which is the state the scanner is initialized in. * We use it solely to check for and consume any BOMs at the start of files. See Bug 3140. */ -#line 1206 "src/Slice/Scanner.cpp" +#line 1209 "src/Slice/Scanner.cpp" #define INITIAL 0 #define C_COMMENT 1 @@ -1302,11 +1305,11 @@ YY_DECL { /* %% [7.0] user's declarations go here */ -#line 116 "src/Slice/Scanner.l" +#line 119 "src/Slice/Scanner.l" /* ========== Literals ========== */ /* Matches the start of a double-quoted string literal. */ -#line 1497 "src/Slice/Scanner.cpp" +#line 1500 "src/Slice/Scanner.cpp" while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */ { @@ -1388,7 +1391,7 @@ YY_DECL case 1: YY_RULE_SETUP -#line 120 "src/Slice/Scanner.l" +#line 123 "src/Slice/Scanner.l" { yy_push_state(STRING_LITERAL); startLocation(yylloc); @@ -1403,10 +1406,10 @@ YY_DECL /* Matches Escaped backslashes and any other valid string characters. Invalid characters are * new-lines, non-printable ASCII characters, and double-quotes. */ case 2: -#line 135 "src/Slice/Scanner.l" +#line 138 "src/Slice/Scanner.l" case 3: YY_RULE_SETUP -#line 135 "src/Slice/Scanner.l" +#line 138 "src/Slice/Scanner.l" { StringTokPtr str = dynamic_pointer_cast(*yylval); str->literal += yytext; @@ -1415,12 +1418,12 @@ YY_DECL YY_BREAK /* Matches an escaped double-quote, single-quote, or question mark. */ case 4: -#line 143 "src/Slice/Scanner.l" +#line 146 "src/Slice/Scanner.l" case 5: -#line 144 "src/Slice/Scanner.l" +#line 147 "src/Slice/Scanner.l" case 6: YY_RULE_SETUP -#line 144 "src/Slice/Scanner.l" +#line 147 "src/Slice/Scanner.l" { StringTokPtr str = dynamic_pointer_cast(*yylval); str->literal += yytext; @@ -1430,7 +1433,7 @@ YY_DECL /* Matches an ANSI-C escape code pattern. */ case 7: YY_RULE_SETUP -#line 151 "src/Slice/Scanner.l" +#line 154 "src/Slice/Scanner.l" { StringTokPtr str = dynamic_pointer_cast(*yylval); char ansiCode; @@ -1468,7 +1471,7 @@ YY_DECL /* Matches an escaped octal value. Octal literals are limited to a max of 3 digits. */ case 8: YY_RULE_SETUP -#line 170 "src/Slice/Scanner.l" +#line 173 "src/Slice/Scanner.l" { int64_t value = std::stoll((yytext + 1), nullptr, 8); if (value > 255) @@ -1484,7 +1487,7 @@ YY_DECL /* Matches an escaped hexadecimal value. Hexadecimal literals are limited to a max of 2 digits. */ case 9: YY_RULE_SETUP -#line 183 "src/Slice/Scanner.l" +#line 186 "src/Slice/Scanner.l" { int64_t value = std::stoll((yytext + 2), nullptr, 16); assert(value <= 255); @@ -1497,7 +1500,7 @@ YY_DECL /* Matches an empty hexadecimal escape value. */ case 10: YY_RULE_SETUP -#line 193 "src/Slice/Scanner.l" +#line 196 "src/Slice/Scanner.l" { currentUnit->error("no hex digit in hex escape sequence"); StringTokPtr str = dynamic_pointer_cast(*yylval); @@ -1506,10 +1509,10 @@ YY_DECL YY_BREAK /* Matches a 4-char or 8-char size universal character code. */ case 11: -#line 201 "src/Slice/Scanner.l" +#line 204 "src/Slice/Scanner.l" case 12: YY_RULE_SETUP -#line 201 "src/Slice/Scanner.l" +#line 204 "src/Slice/Scanner.l" { int64_t codePoint = std::stoll((yytext + 2), nullptr, 16); if (codePoint <= 0xdfff && codePoint >= 0xd800) @@ -1524,10 +1527,10 @@ YY_DECL YY_BREAK /* Matches a universal character code that isn't the correct size, or uses incorrect characters. */ case 13: -#line 214 "src/Slice/Scanner.l" +#line 217 "src/Slice/Scanner.l" case 14: YY_RULE_SETUP -#line 214 "src/Slice/Scanner.l" +#line 217 "src/Slice/Scanner.l" { currentUnit->error("unknown escape sequence in string literal: `" + string(yytext) + "'"); StringTokPtr str = dynamic_pointer_cast(*yylval); @@ -1539,7 +1542,7 @@ YY_DECL case 15: /* rule 15 can match eol */ YY_RULE_SETUP -#line 222 "src/Slice/Scanner.l" +#line 225 "src/Slice/Scanner.l" { yy_pop_state(); endLocation(yylloc); @@ -1553,7 +1556,7 @@ YY_DECL * because it only matches 2 characters (the lowest any match), and it's beneath the others. */ case 16: YY_RULE_SETUP -#line 233 "src/Slice/Scanner.l" +#line 236 "src/Slice/Scanner.l" { currentUnit->warning( All, @@ -1569,7 +1572,7 @@ YY_DECL * completeness. */ case 17: YY_RULE_SETUP -#line 243 "src/Slice/Scanner.l" +#line 246 "src/Slice/Scanner.l" { currentUnit->warning(All, "dangling backslash in string literal"); StringTokPtr str = dynamic_pointer_cast(*yylval); @@ -1581,7 +1584,7 @@ YY_DECL * the rules above this one. */ case 18: YY_RULE_SETUP -#line 251 "src/Slice/Scanner.l" +#line 254 "src/Slice/Scanner.l" { yy_pop_state(); endLocation(yylloc); @@ -1593,7 +1596,7 @@ YY_DECL YY_BREAK /* Matches EOF, but only while scanning a string literal. */ case YY_STATE_EOF(STRING_LITERAL): -#line 261 "src/Slice/Scanner.l" +#line 264 "src/Slice/Scanner.l" { yy_pop_state(); endLocation(yylloc); @@ -1604,7 +1607,7 @@ YY_DECL YY_BREAK case 19: YY_RULE_SETUP -#line 269 "src/Slice/Scanner.l" +#line 272 "src/Slice/Scanner.l" { setLocation(yylloc); @@ -1630,7 +1633,7 @@ YY_DECL YY_BREAK case 20: YY_RULE_SETUP -#line 292 "src/Slice/Scanner.l" +#line 295 "src/Slice/Scanner.l" { setLocation(yylloc); @@ -1661,7 +1664,7 @@ YY_DECL /* Matches and records a triple-slash style doc comment. */ case 21: YY_RULE_SETUP -#line 320 "src/Slice/Scanner.l" +#line 323 "src/Slice/Scanner.l" { currentUnit->addToComment(yytext + 3); } @@ -1669,14 +1672,14 @@ YY_DECL /* Matches and consumes a C++ style comment. */ case 22: YY_RULE_SETUP -#line 325 "src/Slice/Scanner.l" +#line 328 "src/Slice/Scanner.l" { } YY_BREAK /* Matches the start of a C style comment, and switches the scanner to the C_COMMENT state. */ case 23: YY_RULE_SETUP -#line 328 "src/Slice/Scanner.l" +#line 331 "src/Slice/Scanner.l" { yy_push_state(C_COMMENT); } @@ -1685,10 +1688,10 @@ YY_DECL * time to ensure Flex scans '* /' correctly. Flex prioritizes longer matches over shorter ones, so '* * /' will match before '*'. */ case 24: -#line 335 "src/Slice/Scanner.l" +#line 338 "src/Slice/Scanner.l" case 25: YY_RULE_SETUP -#line 335 "src/Slice/Scanner.l" +#line 338 "src/Slice/Scanner.l" { yymore(); } @@ -1698,7 +1701,7 @@ YY_DECL case 26: /* rule 26 can match eol */ YY_RULE_SETUP -#line 340 "src/Slice/Scanner.l" +#line 343 "src/Slice/Scanner.l" { nextLine(yyleng); yymore(); @@ -1707,7 +1710,7 @@ YY_DECL /* Matches the end of a C style comment, and reverts the scanner state to what it previously was. */ case 27: YY_RULE_SETUP -#line 346 "src/Slice/Scanner.l" +#line 349 "src/Slice/Scanner.l" { yy_pop_state(); @@ -1719,7 +1722,7 @@ YY_DECL /* Handles reaching EOF while scanning a C style comment by issuing a warning but continuing normally. */ case YY_STATE_EOF(C_COMMENT): -#line 355 "src/Slice/Scanner.l" +#line 358 "src/Slice/Scanner.l" { yy_pop_state(); @@ -1731,7 +1734,7 @@ YY_DECL /* Matches the empty preprocessor directive. */ case 28: YY_RULE_SETUP -#line 365 "src/Slice/Scanner.l" +#line 368 "src/Slice/Scanner.l" { yy_push_state(PREPROCESS); } @@ -1739,7 +1742,7 @@ YY_DECL /* Matches a line preprocessor directive, but missing a line number. */ case 29: YY_RULE_SETUP -#line 370 "src/Slice/Scanner.l" +#line 373 "src/Slice/Scanner.l" { yy_push_state(PREPROCESS); currentUnit->error("missing line number in line preprocessor directive"); @@ -1747,10 +1750,10 @@ YY_DECL YY_BREAK /* Matches a line preprocessor directive (optionally with a file specified afterwards). */ case 30: -#line 377 "src/Slice/Scanner.l" +#line 380 "src/Slice/Scanner.l" case 31: YY_RULE_SETUP -#line 377 "src/Slice/Scanner.l" +#line 380 "src/Slice/Scanner.l" { int includeAction = scanPosition(yytext); if (yylineno == 0 || @@ -1769,7 +1772,7 @@ YY_DECL * found while scanning a preprocessor directive. */ case 32: YY_RULE_SETUP -#line 392 "src/Slice/Scanner.l" +#line 395 "src/Slice/Scanner.l" { currentUnit->error( "encountered unexpected token while scanning preprocessor directive: `" + string(yytext) + @@ -1779,10 +1782,10 @@ YY_DECL /* Matches a new-line character or EOF. This signals the end of the preprocessor statement. */ case 33: /* rule 33 can match eol */ -#line 398 "src/Slice/Scanner.l" +#line 401 "src/Slice/Scanner.l" YY_RULE_SETUP case YY_STATE_EOF(PREPROCESS): -#line 398 "src/Slice/Scanner.l" +#line 401 "src/Slice/Scanner.l" { yy_pop_state(); nextLine(); @@ -1791,7 +1794,7 @@ YY_DECL /* ========== Metadata ========== */ case 34: YY_RULE_SETUP -#line 405 "src/Slice/Scanner.l" +#line 408 "src/Slice/Scanner.l" { yy_push_state(METADATA); return ICE_METADATA_OPEN; @@ -1799,7 +1802,7 @@ YY_DECL YY_BREAK case 35: YY_RULE_SETUP -#line 410 "src/Slice/Scanner.l" +#line 413 "src/Slice/Scanner.l" { yy_push_state(METADATA); @@ -1818,7 +1821,7 @@ YY_DECL /* Matches the start of a metadata string, then switches the scanner into STRING_LITERAL mode. */ case 36: YY_RULE_SETUP -#line 425 "src/Slice/Scanner.l" +#line 428 "src/Slice/Scanner.l" { yy_push_state(STRING_LITERAL); startLocation(yylloc); @@ -1831,7 +1834,7 @@ YY_DECL /* Matches commas between string literals in quoted metadata and forwards them to the parser. */ case 37: YY_RULE_SETUP -#line 435 "src/Slice/Scanner.l" +#line 438 "src/Slice/Scanner.l" { return yytext[0]; } @@ -1840,14 +1843,14 @@ YY_DECL case 38: /* rule 38 can match eol */ YY_RULE_SETUP -#line 440 "src/Slice/Scanner.l" +#line 443 "src/Slice/Scanner.l" { nextLine(yyleng); } YY_BREAK case 39: YY_RULE_SETUP -#line 444 "src/Slice/Scanner.l" +#line 447 "src/Slice/Scanner.l" { yy_pop_state(); return ICE_METADATA_CLOSE; @@ -1855,7 +1858,7 @@ YY_DECL YY_BREAK case 40: YY_RULE_SETUP -#line 449 "src/Slice/Scanner.l" +#line 452 "src/Slice/Scanner.l" { yy_pop_state(); return ICE_GLOBAL_METADATA_CLOSE; @@ -1865,7 +1868,7 @@ YY_DECL * error. */ case 41: YY_RULE_SETUP -#line 455 "src/Slice/Scanner.l" +#line 458 "src/Slice/Scanner.l" { currentUnit->error("invalid character between metadata"); } @@ -1874,7 +1877,7 @@ YY_DECL case 42: /* rule 42 can match eol */ YY_RULE_SETUP -#line 461 "src/Slice/Scanner.l" +#line 464 "src/Slice/Scanner.l" { StringTokPtr ident = make_shared(); ident->v = *yytext == '\\' ? yytext + 1 : yytext; @@ -1914,7 +1917,7 @@ YY_DECL YY_BREAK case 43: YY_RULE_SETUP -#line 498 "src/Slice/Scanner.l" +#line 501 "src/Slice/Scanner.l" { StringTokPtr ident = make_shared(); ident->v = *yytext == '\\' ? yytext + 1 : yytext; @@ -1926,7 +1929,7 @@ YY_DECL /* Matches and consumes any whitespace, except for newlines. */ case 44: YY_RULE_SETUP -#line 508 "src/Slice/Scanner.l" +#line 511 "src/Slice/Scanner.l" { } YY_BREAK @@ -1934,7 +1937,7 @@ YY_DECL case 45: /* rule 45 can match eol */ YY_RULE_SETUP -#line 511 "src/Slice/Scanner.l" +#line 514 "src/Slice/Scanner.l" { nextLine(yyleng); } @@ -1943,7 +1946,7 @@ YY_DECL /* Matches and consumes a BOM, but only when the scanner has just started scanning a new file. */ case 46: YY_RULE_SETUP -#line 518 "src/Slice/Scanner.l" +#line 521 "src/Slice/Scanner.l" { } YY_BREAK @@ -1953,7 +1956,7 @@ YY_DECL case 47: /* rule 47 can match eol */ YY_RULE_SETUP -#line 522 "src/Slice/Scanner.l" +#line 525 "src/Slice/Scanner.l" { stringstream s; s << "illegal input character: '\\"; @@ -1971,7 +1974,7 @@ YY_DECL * sub-scanner. */ case 48: YY_RULE_SETUP -#line 536 "src/Slice/Scanner.l" +#line 539 "src/Slice/Scanner.l" { setLocation(yylloc); return yytext[0]; @@ -1979,10 +1982,10 @@ YY_DECL YY_BREAK case 49: YY_RULE_SETUP -#line 541 "src/Slice/Scanner.l" +#line 544 "src/Slice/Scanner.l" YY_FATAL_ERROR("flex scanner jammed"); YY_BREAK -#line 2141 "src/Slice/Scanner.cpp" +#line 2144 "src/Slice/Scanner.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(PRE_SLICE): case YY_STATE_EOF(SLICE): @@ -2993,7 +2996,7 @@ yyfree(void* ptr) /* %ok-for-header */ -#line 541 "src/Slice/Scanner.l" +#line 544 "src/Slice/Scanner.l" namespace Slice { @@ -3144,4 +3147,13 @@ namespace BEGIN(PRE_SLICE); } } + + // This function is called whenever the scanner encounters an unrecoverable error. + void yynoreturn fatalError(const char* msg) + { + cerr << yyfilename << ":" << yylineno << ":" << yycolno << ": fatal error: " << msg << endl + << "\tlast matched text: `" << yytext << "'" << endl + << "\tlast scanner state: `" << YY_START << "'" << endl; + exit(YY_EXIT_FAILURE); + } } diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index 6db40ad64dc..45f58952d4d 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -14,6 +14,7 @@ #include "Grammar.h" #include +#include #include #include @@ -46,11 +47,13 @@ namespace void initScanner(); void preAction(); + void yynoreturn fatalError(const char* msg); } // Override some of the functions flex auto-generates with our own implementations. #define YY_USER_INIT initScanner(); #define YY_USER_ACTION preAction(); +#define YY_FATAL_ERROR(msg) fatalError(msg); %} @@ -686,4 +689,13 @@ namespace BEGIN(PRE_SLICE); } } + + // This function is called whenever the scanner encounters an unrecoverable error. + void yynoreturn fatalError(const char* msg) + { + cerr << yyfilename << ":" << yylineno << ":" << yycolno << ": fatal error: " << msg << endl + << "\tlast matched text: `" << yytext << "'" << endl + << "\tlast scanner state: `" << YY_START << "'" << endl; + exit(YY_EXIT_FAILURE); + } } From 5de7d99f7d1d180e15799e4698746585f5ba4d59 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 5 Apr 2024 10:03:53 +0200 Subject: [PATCH 06/13] Remove C# StreamWrappers (#2029) --- csharp/src/Ice/StreamWrapper.cs | 356 -------------------------------- 1 file changed, 356 deletions(-) delete mode 100644 csharp/src/Ice/StreamWrapper.cs diff --git a/csharp/src/Ice/StreamWrapper.cs b/csharp/src/Ice/StreamWrapper.cs deleted file mode 100644 index 66f3c01f4f9..00000000000 --- a/csharp/src/Ice/StreamWrapper.cs +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright (c) ZeroC, Inc. - -using System.Diagnostics; - -namespace IceInternal; - -// -// Classes to provide a System.IO.Stream interface on top of an Ice stream. -// We use this to serialize arbitrary .NET serializable classes into -// a Slice byte sequence. -// -// For input streams, this class is a wrapper around the InputStream -// class that passes all methods through. -// -// For output streams, we use a different strategy: -// Slice sequences are encoded on the wire as a count of elements, followed -// by the sequence contents. For arbitrary .NET classes, we do not know how -// big the sequence that is eventually written will be. To avoid excessive -// data copying, this class maintains a private _bytes array of 254 bytes and, -// initially, writes data into that array. If more than 254 bytes end up being -// written, we write a dummy sequence size of 255 (which occupies five bytes -// on the wire) into the stream and, once this class is disposed, patch -// that size to match the actual size. Otherwise, if the _bytes buffer contains -// fewer than 255 bytes when this class is disposed, we write the sequence size -// as a single byte, followed by the contents of the _bytes buffer. -// - -public class OutputStreamWrapper : Stream -{ - public OutputStreamWrapper(Ice.OutputStream s) - { - _s = s; - _spos = s.pos(); - _bytes = new byte[254]; - _pos = 0; - _length = 0; - } - - public override int Read(byte[] buffer, int offset, int count) - { - Debug.Assert(false); - return 0; - } - - public override int ReadByte() - { - Debug.Assert(false); - return 0; - } - - public override void Write(byte[] array, int offset, int count) - { - Debug.Assert(array != null && offset >= 0 && count >= 0 && offset + count <= array.Length); - try - { - if (_bytes != null) - { - // - // If we can fit the data into the first 254 bytes, write it to _bytes. - // - if (count <= _bytes.Length - _pos) - { - System.Buffer.BlockCopy(array, offset, _bytes, _pos, count); - _pos += count; - return; - } - - _s.writeSize(255); // Dummy size, until we know how big the stream - // really is and can patch the size. - if (_pos > 0) - { - // - // Write the current contents of _bytes. - // - _s.expand(_pos); - _s.getBuffer().b.put(_bytes, 0, _pos); - } - - _bytes = null; - } - - // - // Write data passed by caller. - // - _s.expand(count); - _s.getBuffer().b.put(array, offset, count); - _pos += count; - } - catch (System.Exception ex) - { - throw new IOException("could not write to stream", ex); - } - } - - public override void WriteByte(byte value) - { - try - { - if (_bytes != null) - { - // - // If we can fit the data into the first 254 bytes, write it to _bytes. - // - if (_pos < _bytes.Length) - { - _bytes[_pos++] = value; - return; - } - - _s.writeSize(255); // Dummy size, until we know how big the stream - // really is and can patch the size. - if (_pos > 0) - { - // - // Write the current contents of _bytes. - // - _s.expand(_pos); - _s.getBuffer().b.put(_bytes, 0, _pos); - } - - _bytes = null; - } - - // - // Write data passed by caller. - // - _s.expand(1); - _s.getBuffer().b.put(value); - _pos += 1; - } - catch (System.Exception ex) - { - throw new IOException("could not write to stream", ex); - } - } - - public override bool CanRead - { - get - { - return false; - } - } - - public override bool CanWrite - { - get - { - return true; - } - } - - public override bool CanSeek - { - get - { - return false; - } - } - - public override void Flush() - { - try - { - if (_bytes != null) - { - Debug.Assert(_pos <= _bytes.Length); - _s.pos(_spos); - _s.writeSize(_pos); - _s.expand(_pos); - _s.getBuffer().b.put(_bytes, 0, _pos); - } - else - { - int currentPos = _s.pos(); - _s.pos(_spos); - _s.writeSize(_pos); // Patch previously-written dummy value. - _s.pos(currentPos); - } - } - catch (System.Exception ex) - { - throw new IOException("could not flush stream", ex); - } - } - - public override long Length - { - get - { - return _length; - } - } - - public override long Position - { - get - { - return _pos; - } - - set - { - Seek(value, SeekOrigin.Begin); - } - } - - public override long Seek(long offset, SeekOrigin origin) - { - Debug.Assert(false); - return 0; - } - - public override void SetLength(long value) - { - Debug.Assert(value >= 0); - _length = value; - } - - private Ice.OutputStream _s; - private int _spos; - private byte[] _bytes; - private int _pos; - private long _length; -} - -public class InputStreamWrapper : Stream -{ - public InputStreamWrapper(int size, Ice.InputStream s) - { - _s = s; - _pos = 0; - _length = size; - } - - public override int Read(byte[] buffer, int offset, int count) - { - Debug.Assert(buffer != null && offset >= 0 && count >= 0 && offset + count <= buffer.Length); - try - { - _s.getBuffer().b.get(buffer, offset, count); - } - catch (System.Exception ex) - { - throw new IOException("could not read from stream", ex); - } - return count; - } - - public override int ReadByte() - { - try - { - return _s.getBuffer().b.get(); - } - catch (System.Exception ex) - { - throw new IOException("could not read from stream", ex); - } - } - - public override void Write(byte[] array, int offset, int count) - { - Debug.Assert(false); - } - - public override void WriteByte(byte value) - { - Debug.Assert(false); - } - - public override bool CanRead - { - get - { - return true; - } - } - - public override bool CanWrite - { - get - { - return false; - } - } - - public override bool CanSeek - { - get - { - return true; - } - } - - public override void Flush() - { - } - - public override long Length - { - get - { - return _length; - } - } - - public override long Position - { - get - { - return _pos; - } - - set - { - Seek(value, SeekOrigin.Begin); - } - } - - public override long Seek(long offset, SeekOrigin origin) - { - // Deliberately no size check here--positioning beyond the limit of the stream is legal. - switch (origin) - { - case SeekOrigin.Begin: - { - _pos = (int)offset; - break; - } - case SeekOrigin.Current: - { - _pos += (int)offset; - break; - } - case SeekOrigin.End: - { - _pos = (int)_length + (int)offset; - break; - } - default: - { - Debug.Assert(false); - break; - } - } - _s.pos(_pos); - return _pos; - } - - public override void SetLength(long value) => Debug.Assert(false); - - private Ice.InputStream _s; - private int _pos; - private long _length; -} From 8162d408539eaa8c16347a0615aef266f60f8e03 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 5 Apr 2024 10:04:14 +0200 Subject: [PATCH 07/13] Fix CA1052 analyzer warning (#2027) --- csharp/msbuild/CodeAnalysis.Base.globalconfig | 3 --- csharp/src/Ice/BZip2.cs | 2 +- csharp/src/Ice/Compare.cs | 2 +- csharp/src/Ice/Exception.cs | 2 +- csharp/src/IceBoxNet/Server.cs | 2 +- csharp/src/IceDiscovery/PluginI.cs | 2 +- csharp/src/IceLocatorDiscovery/PluginI.cs | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/csharp/msbuild/CodeAnalysis.Base.globalconfig b/csharp/msbuild/CodeAnalysis.Base.globalconfig index 34d24ff5d38..a36b8ddd395 100644 --- a/csharp/msbuild/CodeAnalysis.Base.globalconfig +++ b/csharp/msbuild/CodeAnalysis.Base.globalconfig @@ -279,9 +279,6 @@ dotnet_diagnostic.CA1027.severity = none # CA1036: Override methods on comparable types dotnet_diagnostic.CA1036.severity = none -# CA1052: Static holder types should be Static or NotInheritable -dotnet_diagnostic.CA1052.severity = none - # CA1064: Exceptions should be public dotnet_diagnostic.CA1064.severity = none diff --git a/csharp/src/Ice/BZip2.cs b/csharp/src/Ice/BZip2.cs index 3ed1380f0d9..c947315774b 100644 --- a/csharp/src/Ice/BZip2.cs +++ b/csharp/src/Ice/BZip2.cs @@ -102,7 +102,7 @@ internal delegate int DecompressBuffer(byte[] dest, int sourceLen, int small, int verbosity); -public class BZip2 +public static class BZip2 { static BZip2() { diff --git a/csharp/src/Ice/Compare.cs b/csharp/src/Ice/Compare.cs index 155afcf6018..4599e9e4716 100644 --- a/csharp/src/Ice/Compare.cs +++ b/csharp/src/Ice/Compare.cs @@ -2,7 +2,7 @@ namespace Ice; -public class CollectionComparer +public static class CollectionComparer { // // Try to compare two collections efficiently, by doing a reference diff --git a/csharp/src/Ice/Exception.cs b/csharp/src/Ice/Exception.cs index 51299b94a30..506727372f9 100644 --- a/csharp/src/Ice/Exception.cs +++ b/csharp/src/Ice/Exception.cs @@ -5,7 +5,7 @@ namespace IceInternal { - public class Ex + public static class Ex { public static void throwUOE(Type expectedType, Ice.Value v) { diff --git a/csharp/src/IceBoxNet/Server.cs b/csharp/src/IceBoxNet/Server.cs index 76378102dcb..c0bd2b53780 100644 --- a/csharp/src/IceBoxNet/Server.cs +++ b/csharp/src/IceBoxNet/Server.cs @@ -2,7 +2,7 @@ namespace IceBox; -public class Server +public static class Server { private static void usage() { diff --git a/csharp/src/IceDiscovery/PluginI.cs b/csharp/src/IceDiscovery/PluginI.cs index 41b3c2a8a85..a35c3c7fbac 100644 --- a/csharp/src/IceDiscovery/PluginI.cs +++ b/csharp/src/IceDiscovery/PluginI.cs @@ -145,7 +145,7 @@ public void destroy() private Ice.LocatorPrx _defaultLocator; } -public class Util +public static class Util { public static void registerIceDiscovery(bool loadOnInitialize) diff --git a/csharp/src/IceLocatorDiscovery/PluginI.cs b/csharp/src/IceLocatorDiscovery/PluginI.cs index d211fdef2b5..ab439e9ddd3 100644 --- a/csharp/src/IceLocatorDiscovery/PluginI.cs +++ b/csharp/src/IceLocatorDiscovery/PluginI.cs @@ -760,7 +760,7 @@ private List private Ice.LocatorPrx _defaultLocator; } -public class Util +public static class Util { public static void registerIceLocatorDiscovery(bool loadOnInitialize) From 0a459cf5ed3c9eec075d716faf325718feb538b3 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 5 Apr 2024 10:04:38 +0200 Subject: [PATCH 08/13] SSL transport cleanup (#2031) --- csharp/src/Ice/IceSSL/AcceptorI.cs | 42 ++----- csharp/src/Ice/IceSSL/ConnectionInfo.cs | 5 +- csharp/src/Ice/IceSSL/ConnectorI.cs | 31 ++--- csharp/src/Ice/IceSSL/EndpointI.cs | 155 +++++++----------------- csharp/src/Ice/IceSSL/Instance.cs | 58 +++------ csharp/src/Ice/IceSSL/TransceiverI.cs | 102 ++++++---------- csharp/src/Ice/IceSSL/TrustManager.cs | 63 ++++------ 7 files changed, 137 insertions(+), 319 deletions(-) diff --git a/csharp/src/Ice/IceSSL/AcceptorI.cs b/csharp/src/Ice/IceSSL/AcceptorI.cs index 603eddf58da..44ba11b5884 100644 --- a/csharp/src/Ice/IceSSL/AcceptorI.cs +++ b/csharp/src/Ice/IceSSL/AcceptorI.cs @@ -1,15 +1,13 @@ // Copyright (c) ZeroC, Inc. using System.Net.Security; +using System.Security.Cryptography.X509Certificates; namespace IceSSL; internal class AcceptorI : IceInternal.Acceptor { - public void close() - { - _delegate.close(); - } + public void close() => _delegate.close(); public IceInternal.EndpointI listen() { @@ -17,40 +15,24 @@ public IceInternal.EndpointI listen() return _endpoint; } - public bool startAccept(IceInternal.AsyncCallback callback, object state) - { - return _delegate.startAccept(callback, state); - } + public bool startAccept(IceInternal.AsyncCallback callback, object state) => + _delegate.startAccept(callback, state); - public void finishAccept() - { - _delegate.finishAccept(); - } + public void finishAccept() => _delegate.finishAccept(); - public IceInternal.Transceiver accept() - { - return new TransceiverI( + public IceInternal.Transceiver accept() => + new TransceiverI( _instance, _delegate.accept(), _adapterName, incoming: true, serverAuthenticationOptions: _serverAuthenticationOptions); - } - public string protocol() - { - return _delegate.protocol(); - } + public string protocol() => _delegate.protocol(); - public override string ToString() - { - return _delegate.ToString(); - } + public override string ToString() => _delegate.ToString(); - public string toDetailedString() - { - return _delegate.toDetailedString(); - } + public string toDetailedString() => _delegate.toDetailedString(); internal AcceptorI( EndpointI endpoint, @@ -65,10 +47,8 @@ internal AcceptorI( _adapterName = adapterName; _serverAuthenticationOptions = authenticationOptions; - // // .NET requires that a certificate be supplied. - // - var certs = instance.certs(); + X509Certificate2Collection certs = instance.certs(); if ((certs is null || certs.Count == 0) && _serverAuthenticationOptions is null) { throw new Ice.SecurityException("IceSSL: certificate required for server endpoint"); diff --git a/csharp/src/Ice/IceSSL/ConnectionInfo.cs b/csharp/src/Ice/IceSSL/ConnectionInfo.cs index 5aec70b3f8f..a351db9adf3 100644 --- a/csharp/src/Ice/IceSSL/ConnectionInfo.cs +++ b/csharp/src/Ice/IceSSL/ConnectionInfo.cs @@ -11,10 +11,7 @@ public class ConnectionInfo : Ice.ConnectionInfo public X509Certificate2[] certs; public bool verified; - public ConnectionInfo() - { - cipher = ""; - } + public ConnectionInfo() => cipher = ""; public ConnectionInfo( Ice.ConnectionInfo underlying, diff --git a/csharp/src/Ice/IceSSL/ConnectorI.cs b/csharp/src/Ice/IceSSL/ConnectorI.cs index 21753c6ba80..805e028a778 100644 --- a/csharp/src/Ice/IceSSL/ConnectorI.cs +++ b/csharp/src/Ice/IceSSL/ConnectorI.cs @@ -4,24 +4,17 @@ namespace IceSSL; internal sealed class ConnectorI : IceInternal.Connector { - public IceInternal.Transceiver connect() - { - return new TransceiverI( + public IceInternal.Transceiver connect() => + new TransceiverI( _instance, _delegate.connect(), _host, incoming: false, serverAuthenticationOptions: null); - } - public short type() - { - return _delegate.type(); - } + public short type() => _delegate.type(); - // // Only for use by EndpointI. - // internal ConnectorI(Instance instance, IceInternal.Connector del, string host) { _instance = instance; @@ -41,21 +34,15 @@ public override bool Equals(object obj) return true; } - ConnectorI p = (ConnectorI)obj; + var p = (ConnectorI)obj; return _delegate.Equals(p._delegate); } - public override string ToString() - { - return _delegate.ToString(); - } + public override string ToString() => _delegate.ToString(); - public override int GetHashCode() - { - return _delegate.GetHashCode(); - } + public override int GetHashCode() => _delegate.GetHashCode(); - private Instance _instance; - private IceInternal.Connector _delegate; - private string _host; + private readonly IceInternal.Connector _delegate; + private readonly string _host; + private readonly Instance _instance; } diff --git a/csharp/src/Ice/IceSSL/EndpointI.cs b/csharp/src/Ice/IceSSL/EndpointI.cs index c445dc7579d..8875205a1f4 100644 --- a/csharp/src/Ice/IceSSL/EndpointI.cs +++ b/csharp/src/Ice/IceSSL/EndpointI.cs @@ -12,59 +12,35 @@ internal EndpointI(Instance instance, IceInternal.EndpointI del) _delegate = del; } - public override void streamWriteImpl(Ice.OutputStream os) - { - _delegate.streamWriteImpl(os); - } + public override void streamWriteImpl(Ice.OutputStream os) => _delegate.streamWriteImpl(os); private sealed class InfoI : EndpointInfo { - public InfoI(EndpointI e) - { - _endpoint = e; - } + public InfoI(EndpointI e) => _endpoint = e; - override public short type() - { - return _endpoint.type(); - } + public override short type() => _endpoint.type(); - override public bool datagram() - { - return _endpoint.datagram(); - } + public override bool datagram() => _endpoint.datagram(); - override public bool secure() - { - return _endpoint.secure(); - } + public override bool secure() => _endpoint.secure(); - private EndpointI _endpoint; + private readonly EndpointI _endpoint; } public override Ice.EndpointInfo getInfo() { - InfoI info = new InfoI(this); + var info = new InfoI(this); info.underlying = _delegate.getInfo(); info.compress = info.underlying.compress; info.timeout = info.underlying.timeout; return info; } - public override short type() - { - return _delegate.type(); - } + public override short type() => _delegate.type(); - public override string protocol() - { - return _delegate.protocol(); - } + public override string protocol() => _delegate.protocol(); - public override int timeout() - { - return _delegate.timeout(); - } + public override int timeout() => _delegate.timeout(); public override IceInternal.EndpointI timeout(int timeout) { @@ -78,10 +54,7 @@ public override IceInternal.EndpointI timeout(int timeout) } } - public override string connectionId() - { - return _delegate.connectionId(); - } + public override string connectionId() => _delegate.connectionId(); public override IceInternal.EndpointI connectionId(string connectionId) { @@ -95,10 +68,7 @@ public override IceInternal.EndpointI connectionId(string connectionId) } } - public override bool compress() - { - return _delegate.compress(); - } + public override bool compress() => _delegate.compress(); public override IceInternal.EndpointI compress(bool compress) { @@ -112,20 +82,11 @@ public override IceInternal.EndpointI compress(bool compress) } } - public override bool datagram() - { - return _delegate.datagram(); - } + public override bool datagram() => _delegate.datagram(); - public override bool secure() - { - return _delegate.secure(); - } + public override bool secure() => _delegate.secure(); - public override IceInternal.Transceiver transceiver() - { - return null; - } + public override IceInternal.Transceiver transceiver() => null; private sealed class EndpointI_connectorsI : IceInternal.EndpointI_connectors { @@ -138,7 +99,7 @@ public EndpointI_connectorsI(Instance instance, string host, IceInternal.Endpoin public void connectors(List connectors) { - List l = new List(); + var l = new List(); foreach (IceInternal.Connector c in connectors) { l.Add(new ConnectorI(_instance, c, _host)); @@ -146,14 +107,11 @@ public void connectors(List connectors) _callback.connectors(l); } - public void exception(Ice.LocalException ex) - { - _callback.exception(ex); - } + public void exception(Ice.LocalException ex) => _callback.exception(ex); - private Instance _instance; - private string _host; - private IceInternal.EndpointI_connectors _callback; + private readonly Instance _instance; + private readonly string _host; + private readonly IceInternal.EndpointI_connectors _callback; } public override void connectors_async(Ice.EndpointSelectionType selType, @@ -162,24 +120,24 @@ public override void connectors_async(Ice.EndpointSelectionType selType, string host = ""; for (Ice.EndpointInfo p = _delegate.getInfo(); p != null; p = p.underlying) { - if (p is Ice.IPEndpointInfo) + if (p is Ice.IPEndpointInfo info) { - host = ((Ice.IPEndpointInfo)p).host; + host = info.host; break; } } _delegate.connectors_async(selType, new EndpointI_connectorsI(_instance, host, callback)); } - public override IceInternal.Acceptor acceptor(string adapterName, SslServerAuthenticationOptions authenticationOptions) - { - return new AcceptorI( + public override IceInternal.Acceptor acceptor( + string adapterName, + SslServerAuthenticationOptions authenticationOptions) => + new AcceptorI( this, _instance, _delegate.acceptor(adapterName, null), adapterName, authenticationOptions); - } public EndpointI endpoint(IceInternal.EndpointI del) { @@ -195,7 +153,7 @@ public EndpointI endpoint(IceInternal.EndpointI del) public override List expandIfWildcard() { - List l = new List(); + var l = new List(); foreach (IceInternal.EndpointI e in _delegate.expandIfWildcard()) { l.Add(e == _delegate ? this : new EndpointI(_instance, e)); @@ -205,7 +163,7 @@ public EndpointI endpoint(IceInternal.EndpointI del) public override List expandHost(out IceInternal.EndpointI publish) { - List l = new List(); + var l = new List(); foreach (IceInternal.EndpointI e in _delegate.expandHost(out publish)) { l.Add(e == _delegate ? this : new EndpointI(_instance, e)); @@ -219,30 +177,27 @@ public EndpointI endpoint(IceInternal.EndpointI del) public override bool equivalent(IceInternal.EndpointI endpoint) { - if (!(endpoint is EndpointI)) + if (endpoint is not EndpointI) { return false; } - EndpointI endpointI = (EndpointI)endpoint; + var endpointI = (EndpointI)endpoint; return _delegate.equivalent(endpointI._delegate); } - public override string options() - { - return _delegate.options(); - } + public override string options() => _delegate.options(); // // Compare endpoints for sorting purposes // public override int CompareTo(IceInternal.EndpointI obj) { - if (!(obj is EndpointI)) + if (obj is not EndpointI) { return type() < obj.type() ? -1 : 1; } - EndpointI p = (EndpointI)obj; + var p = (EndpointI)obj; if (this == p) { return 0; @@ -251,44 +206,28 @@ public override int CompareTo(IceInternal.EndpointI obj) return _delegate.CompareTo(p._delegate); } - public override int GetHashCode() - { - return _delegate.GetHashCode(); - } + public override int GetHashCode() => _delegate.GetHashCode(); - protected override bool checkOption(string option, string argument, string endpoint) - { - return false; - } + protected override bool checkOption(string option, string argument, string endpoint) => false; - private Instance _instance; - private IceInternal.EndpointI _delegate; + private readonly Instance _instance; + private readonly IceInternal.EndpointI _delegate; } internal sealed class EndpointFactoryI : IceInternal.EndpointFactoryWithUnderlying { - public EndpointFactoryI(Instance instance, short type) : base(instance, type) - { - _instance = instance; - } + public EndpointFactoryI(Instance instance, short type) : base(instance, type) => _instance = instance; - override public IceInternal.EndpointFactory - cloneWithUnderlying(IceInternal.ProtocolInstance inst, short underlying) - { - return new EndpointFactoryI(new Instance(_instance.engine(), inst.type(), inst.protocol()), underlying); - } + public override IceInternal.EndpointFactory + cloneWithUnderlying(IceInternal.ProtocolInstance instance, short underlying) => + new EndpointFactoryI(new Instance(_instance.engine(), instance.type(), instance.protocol()), underlying); - override protected IceInternal.EndpointI - createWithUnderlying(IceInternal.EndpointI underlying, List args, bool oaEndpoint) - { - return new EndpointI(_instance, underlying); - } + protected override IceInternal.EndpointI + createWithUnderlying(IceInternal.EndpointI underlying, List args, bool oaEndpoint) => + new EndpointI(_instance, underlying); - override protected IceInternal.EndpointI - readWithUnderlying(IceInternal.EndpointI underlying, Ice.InputStream s) - { - return new EndpointI(_instance, underlying); - } + protected override IceInternal.EndpointI + readWithUnderlying(IceInternal.EndpointI underlying, Ice.InputStream s) => new EndpointI(_instance, underlying); - private Instance _instance; + private readonly Instance _instance; } diff --git a/csharp/src/Ice/IceSSL/Instance.cs b/csharp/src/Ice/IceSSL/Instance.cs index d1db7570974..a4413cad6aa 100644 --- a/csharp/src/Ice/IceSSL/Instance.cs +++ b/csharp/src/Ice/IceSSL/Instance.cs @@ -1,5 +1,6 @@ // Copyright (c) ZeroC, Inc. +using System.Net.Security; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; @@ -8,60 +9,29 @@ namespace IceSSL; internal class Instance : IceInternal.ProtocolInstance { internal Instance(SSLEngine engine, short type, string protocol) : - base(engine.communicator(), type, protocol, true) - { - _engine = engine; - } + base(engine.communicator(), type, protocol, true) => _engine = engine; - internal SSLEngine engine() - { - return _engine; - } + internal SSLEngine engine() => _engine; - internal int securityTraceLevel() - { - return _engine.securityTraceLevel(); - } + internal int securityTraceLevel() => _engine.securityTraceLevel(); - internal string securityTraceCategory() - { - return _engine.securityTraceCategory(); - } + internal string securityTraceCategory() => _engine.securityTraceCategory(); - internal bool initialized() - { - return _engine.initialized(); - } + internal bool initialized() => _engine.initialized(); - internal X509Certificate2Collection certs() - { - return _engine.certs(); - } + internal X509Certificate2Collection certs() => _engine.certs(); - internal SslProtocols protocols() - { - return _engine.protocols(); - } + internal SslProtocols protocols() => _engine.protocols(); - internal int checkCRL() - { - return _engine.checkCRL(); - } + internal int checkCRL() => _engine.checkCRL(); - internal void traceStream(System.Net.Security.SslStream stream, string connInfo) - { - _engine.traceStream(stream, connInfo); - } + internal void traceStream(SslStream stream, string connInfo) => _engine.traceStream(stream, connInfo); - internal void verifyPeer(string address, ConnectionInfo info, string desc) - { - _engine.verifyPeer(address, info, desc); - } + internal void verifyPeer(string address, ConnectionInfo info, string description) => + _engine.verifyPeer(address, info, description); - internal Ice.InitializationData initializationData() - { - return IceInternal.Util.getInstance(_engine.communicator()).initializationData(); - } + internal Ice.InitializationData initializationData() => + IceInternal.Util.getInstance(_engine.communicator()).initializationData(); private SSLEngine _engine; } diff --git a/csharp/src/Ice/IceSSL/TransceiverI.cs b/csharp/src/Ice/IceSSL/TransceiverI.cs index fced07aec18..73f24862009 100644 --- a/csharp/src/Ice/IceSSL/TransceiverI.cs +++ b/csharp/src/Ice/IceSSL/TransceiverI.cs @@ -10,10 +10,7 @@ namespace IceSSL; internal sealed class TransceiverI : IceInternal.Transceiver { - public Socket fd() - { - return _delegate.fd(); - } + public Socket fd() => _delegate.fd(); public int initialize(IceInternal.Buffer readBuffer, IceInternal.Buffer writeBuffer, ref bool hasMoreData) { @@ -83,10 +80,7 @@ public int initialize(IceInternal.Buffer readBuffer, IceInternal.Buffer writeBuf return IceInternal.SocketOperation.None; } - public int closing(bool initiator, Ice.LocalException ex) - { - return _delegate.closing(initiator, ex); - } + public int closing(bool initiator, Ice.LocalException ex) => _delegate.closing(initiator, ex); public void close() { @@ -105,26 +99,15 @@ public IceInternal.EndpointI bind() return null; } - public void destroy() - { - _delegate.destroy(); - } + public void destroy() => _delegate.destroy(); - public int write(IceInternal.Buffer buf) - { - // + public int write(IceInternal.Buffer buf) => // Force caller to use async write. - // - return buf.b.hasRemaining() ? IceInternal.SocketOperation.Write : IceInternal.SocketOperation.None; - } + buf.b.hasRemaining() ? IceInternal.SocketOperation.Write : IceInternal.SocketOperation.None; - public int read(IceInternal.Buffer buf, ref bool hasMoreData) - { - // + public int read(IceInternal.Buffer buf, ref bool hasMoreData) => // Force caller to use async read. - // - return buf.b.hasRemaining() ? IceInternal.SocketOperation.Read : IceInternal.SocketOperation.None; - } + buf.b.hasRemaining() ? IceInternal.SocketOperation.Read : IceInternal.SocketOperation.None; public bool startRead(IceInternal.Buffer buf, IceInternal.AsyncCallback callback, object state) { @@ -237,10 +220,7 @@ public bool startWrite(IceInternal.Buffer buf, IceInternal.AsyncCallback cb, obj return startAuthenticate(cb, state); } - // - // We limit the packet size for beingWrite to ensure connection timeouts are based - // on a fixed packet size. - // + // We limit the packet size for beingWrite to ensure connection timeouts are based on a fixed packet size. int packetSize = getSendPacketSize(buf.b.remaining()); try { @@ -329,10 +309,7 @@ public void finishWrite(IceInternal.Buffer buf) } } - public string protocol() - { - return _delegate.protocol(); - } + public string protocol() => _delegate.protocol(); public Ice.ConnectionInfo getInfo() { @@ -346,10 +323,7 @@ public Ice.ConnectionInfo getInfo() return info; } - public void checkSendSize(IceInternal.Buffer buf) - { - _delegate.checkSendSize(buf); - } + public void checkSendSize(IceInternal.Buffer buf) => _delegate.checkSendSize(buf); public void setBufferSize(int rcvSize, int sndSize) { @@ -361,10 +335,7 @@ public override string ToString() return _delegate.ToString(); } - public string toDetailedString() - { - return _delegate.toDetailedString(); - } + public string toDetailedString() => _delegate.toDetailedString(); // // Only for use by ConnectorI, AcceptorI. @@ -587,7 +558,7 @@ private X509Certificate selectCertificate(object sender, string targetHost, X509 private bool validationCallback(object sender, X509Certificate certificate, X509Chain chainEngine, SslPolicyErrors policyErrors) { - using X509Chain chain = new X509Chain(_instance.engine().useMachineContext()); + using var chain = new X509Chain(_instance.engine().useMachineContext()); try { if (_instance.checkCRL() == 0) @@ -711,10 +682,8 @@ private bool validationCallback(object sender, X509Certificate certificate, X509 { if (status.Status == X509ChainStatusFlags.UntrustedRoot && _instance.engine().caCerts() != null) { - // - // Untrusted root is OK when using our custom chain engine if - // the CA certificate is present in the chain policy extra store. - // + // Untrusted root is OK when using our custom chain engine if the CA certificate is present in + // the chain policy extra store. X509ChainElement e = chain.ChainElements[chain.ChainElements.Count - 1]; if (!chain.ChainPolicy.ExtraStore.Contains(e.Certificate)) { @@ -747,10 +716,8 @@ private bool validationCallback(object sender, X509Certificate certificate, X509 } else if (status.Status == X509ChainStatusFlags.RevocationStatusUnknown) { - // - // If a certificate's revocation status cannot be determined, the strictest - // policy is to reject the connection. - // + // If a certificate's revocation status cannot be determined, the strictest policy is to reject + // the connection. if (_instance.checkCRL() > 1) { message += "\ncertificate revocation status unknown"; @@ -792,21 +759,24 @@ private bool validationCallback(object sender, X509Certificate certificate, X509 { if (message.Length > 0) { - _instance.logger().trace(_instance.securityTraceCategory(), - "SSL certificate validation failed:" + message); + _instance.logger().trace( + _instance.securityTraceCategory(), + $"SSL certificate validation failed:{message}"); } else { - _instance.logger().trace(_instance.securityTraceCategory(), - "SSL certificate validation failed"); + _instance.logger().trace( + _instance.securityTraceCategory(), + "SSL certificate validation failed"); } } return false; } else if (message.Length > 0 && _instance.securityTraceLevel() >= 1) { - _instance.logger().trace(_instance.securityTraceCategory(), - "SSL certificate validation status:" + message); + _instance.logger().trace( + _instance.securityTraceCategory(), + $"SSL certificate validation status:{message}"); } return true; } @@ -830,23 +800,19 @@ private bool validationCallback(object sender, X509Certificate certificate, X509 } } } - private int getSendPacketSize(int length) - { - return _maxSendPacketSize > 0 ? Math.Min(length, _maxSendPacketSize) : length; - } + private int getSendPacketSize(int length) => + _maxSendPacketSize > 0 ? Math.Min(length, _maxSendPacketSize) : length; - public int getRecvPacketSize(int length) - { - return _maxRecvPacketSize > 0 ? Math.Min(length, _maxRecvPacketSize) : length; - } + public int getRecvPacketSize(int length) => + _maxRecvPacketSize > 0 ? Math.Min(length, _maxRecvPacketSize) : length; - private Instance _instance; - private IceInternal.Transceiver _delegate; - private string _host = ""; - private string _adapterName = ""; + private readonly Instance _instance; + private readonly IceInternal.Transceiver _delegate; + private readonly string _host = ""; + private readonly string _adapterName = ""; private bool _incoming; private SslStream _sslStream; - private int _verifyPeer; + private readonly int _verifyPeer; private bool _isConnected; private bool _authenticated; private Task _writeResult; diff --git a/csharp/src/Ice/IceSSL/TrustManager.cs b/csharp/src/Ice/IceSSL/TrustManager.cs index 5531908878e..3f39e5896a1 100644 --- a/csharp/src/Ice/IceSSL/TrustManager.cs +++ b/csharp/src/Ice/IceSSL/TrustManager.cs @@ -47,7 +47,7 @@ internal TrustManager(Ice.Communicator communicator) } } - internal bool verify(ConnectionInfo info, string desc) + internal bool verify(ConnectionInfo info, string description) { var reject = new List>>(); var accept = new List>>(); @@ -64,8 +64,7 @@ internal bool verify(ConnectionInfo info, string desc) } if (info.adapterName.Length > 0) { - List> p; - if (_rejectServer.TryGetValue(info.adapterName, out p)) + if (_rejectServer.TryGetValue(info.adapterName, out List> p)) { reject.Add(p); } @@ -91,8 +90,7 @@ internal bool verify(ConnectionInfo info, string desc) } if (info.adapterName.Length > 0) { - List> p; - if (_acceptServer.TryGetValue(info.adapterName, out p)) + if (_acceptServer.TryGetValue(info.adapterName, out List> p)) { accept.Add(p); } @@ -106,17 +104,13 @@ internal bool verify(ConnectionInfo info, string desc) } } - // // If there is nothing to match against, then we accept the cert. - // if (reject.Count == 0 && accept.Count == 0) { return true; } - // // If there is no certificate then we match false. - // if (info.certs != null && info.certs.Length > 0) { X500DistinguishedName subjectDN = info.certs[0].SubjectName; @@ -124,30 +118,25 @@ internal bool verify(ConnectionInfo info, string desc) Debug.Assert(subjectName != null); try { - // // Decompose the subject DN into the RDNs. - // if (_traceLevel > 0) { if (info.incoming) { _communicator.getLogger().trace("Security", "trust manager evaluating client:\n" + - "subject = " + subjectName + "\n" + "adapter = " + info.adapterName + "\n" + desc); + "subject = " + subjectName + "\n" + "adapter = " + info.adapterName + "\n" + description); } else { _communicator.getLogger().trace("Security", "trust manager evaluating server:\n" + - "subject = " + subjectName + "\n" + desc); + "subject = " + subjectName + "\n" + description); } } List dn = RFC2253.parseStrict(subjectName); - // - // Unescape the DN. Note that this isn't done in - // the parser in order to keep the various RFC2253 + // Unescape the DN. Note that this isn't done in the parser in order to keep the various RFC2253 // implementations as close as possible. - // for (int i = 0; i < dn.Count; ++i) { RFC2253.RDNPair p = dn[i]; @@ -155,14 +144,12 @@ internal bool verify(ConnectionInfo info, string desc) dn[i] = p; } - // // Fail if we match anything in the reject set. - // foreach (List> matchSet in reject) { if (_traceLevel > 0) { - StringBuilder s = new StringBuilder("trust manager rejecting PDNs:\n"); + var s = new StringBuilder("trust manager rejecting PDNs:\n"); stringify(matchSet, s); _communicator.getLogger().trace("Security", s.ToString()); } @@ -179,7 +166,7 @@ internal bool verify(ConnectionInfo info, string desc) { if (_traceLevel > 0) { - StringBuilder s = new StringBuilder("trust manager accepting PDNs:\n"); + var s = new StringBuilder("trust manager accepting PDNs:\n"); stringify(matchSet, s); _communicator.getLogger().trace("Security", s.ToString()); } @@ -192,12 +179,10 @@ internal bool verify(ConnectionInfo info, string desc) catch (RFC2253.ParseException e) { _communicator.getLogger().warning( - "IceSSL: unable to parse certificate DN `" + subjectName + "'\nreason: " + e.reason); + $"IceSSL: unable to parse certificate DN `{subjectName}'\nreason: {e.reason}"); } - // // At this point we accept the connection if there are no explicit accept rules. - // return accept.Count == 0; } @@ -243,12 +228,8 @@ private bool matchRDNs(List match, List subjec // Note that unlike the C++ & Java implementation this returns unescaped data. private static void parse(string value, List> reject, List> accept) { - // - // As with the Java implementation, the DN that comes from - // the X500DistinguishedName does not necessarily match - // the user's input form. Therefore we need to normalize the - // data to match the C# forms. - // + // As with the Java implementation, the DN that comes from the X500DistinguishedName does not necessarily match + // the user's input form. Therefore we need to normalize the data to match the C# forms. List l = RFC2253.parse(value); for (int i = 0; i < l.Count; ++i) { @@ -305,18 +286,16 @@ private static void stringify(List> matchSet, StringBuilde } } - private Ice.Communicator _communicator; - private int _traceLevel; + private readonly Ice.Communicator _communicator; + private readonly int _traceLevel; - private List> _rejectAll = new List>(); - private List> _rejectClient = new List>(); - private List> _rejectAllServer = new List>(); - private Dictionary>> _rejectServer = - new Dictionary>>(); + private readonly List> _rejectAll = []; + private readonly List> _rejectClient = []; + private readonly List> _rejectAllServer = []; + private readonly Dictionary>> _rejectServer = []; - private List> _acceptAll = new List>(); - private List> _acceptClient = new List>(); - private List> _acceptAllServer = new List>(); - private Dictionary>> _acceptServer = - new Dictionary>>(); + private readonly List> _acceptAll = []; + private readonly List> _acceptClient = []; + private readonly List> _acceptAllServer = []; + private readonly Dictionary>> _acceptServer = []; } From ec6b6cb9e8017247c86ce76597a7c38bdacd4214 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 5 Apr 2024 10:08:03 +0200 Subject: [PATCH 09/13] Fix CA1064 exceptions should be public (#2028) --- csharp/msbuild/CodeAnalysis.Base.globalconfig | 3 --- csharp/src/Ice/HttpParser.cs | 19 ++----------------- csharp/src/Ice/IceSSL/RFC2253.cs | 8 ++------ 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/csharp/msbuild/CodeAnalysis.Base.globalconfig b/csharp/msbuild/CodeAnalysis.Base.globalconfig index a36b8ddd395..c3a452f1e21 100644 --- a/csharp/msbuild/CodeAnalysis.Base.globalconfig +++ b/csharp/msbuild/CodeAnalysis.Base.globalconfig @@ -279,9 +279,6 @@ dotnet_diagnostic.CA1027.severity = none # CA1036: Override methods on comparable types dotnet_diagnostic.CA1036.severity = none -# CA1064: Exceptions should be public -dotnet_diagnostic.CA1064.severity = none - # CA1066: Implement IEquatable when overriding Equals dotnet_diagnostic.CA1066.severity = none diff --git a/csharp/src/Ice/HttpParser.cs b/csharp/src/Ice/HttpParser.cs index ea9ba11ec8f..51d19c3f939 100644 --- a/csharp/src/Ice/HttpParser.cs +++ b/csharp/src/Ice/HttpParser.cs @@ -5,27 +5,12 @@ namespace IceInternal; -internal sealed class WebSocketException : Exception +public sealed class WebSocketException : Exception { - internal WebSocketException() : - base("", null) - { - } - - internal WebSocketException(string message) : + public WebSocketException(string message) : base(message, null) { } - - internal WebSocketException(string message, System.Exception cause) : - base(message, cause) - { - } - - internal WebSocketException(System.Exception cause) : - base("", cause) - { - } } internal sealed class HttpParser diff --git a/csharp/src/Ice/IceSSL/RFC2253.cs b/csharp/src/Ice/IceSSL/RFC2253.cs index e4a445a0e75..1d40c16e24f 100644 --- a/csharp/src/Ice/IceSSL/RFC2253.cs +++ b/csharp/src/Ice/IceSSL/RFC2253.cs @@ -10,13 +10,9 @@ namespace IceSSL; internal class RFC2253 { - internal class ParseException : Exception + public class ParseException : Exception { - internal ParseException() - { - } - - internal ParseException(string reason) + public ParseException(string reason) { this.reason = reason; } From 7ae2a198de132d23ba5451fc0d84833ea6ddf63d Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 5 Apr 2024 10:25:43 +0200 Subject: [PATCH 10/13] Swift test fixes --- .../test/IceSSL/configuration/AllTests.swift | 98 ------------------- 1 file changed, 98 deletions(-) diff --git a/swift/test/IceSSL/configuration/AllTests.swift b/swift/test/IceSSL/configuration/AllTests.swift index 6e68cbb51b3..d31881c506f 100644 --- a/swift/test/IceSSL/configuration/AllTests.swift +++ b/swift/test/IceSSL/configuration/AllTests.swift @@ -688,104 +688,6 @@ public func allTests(_ helper: TestHelper, _ defaultDir: String) throws -> SSLSe comm.destroy() output.writeLine("ok") - output.write("testing protocols... ") - // - // In macOS we don't support IceSSL.Protocols as secure transport doesn't allow to set the enabled protocols - // instead we use IceSSL.ProtocolVersionMax IceSSL.ProtocolVersionMin to set the maximun and minimum - // enabled protocol versions. See the test bellow. - // - - // - // This should fail because the client and server have no protocol - // in common. - // - properties = createClientProps(defaultProperties) - properties.setProperty(key: "IceSSL.Ciphers", value: "(DH_anon*)") - properties.setProperty(key: "IceSSL.VerifyPeer", value: "0") - properties.setProperty(key: "IceSSL.ProtocolVersionMax", value: "tls1") - properties.setProperty(key: "IceSSL.ProtocolVersionMin", value: "tls1") - - comm = try helper.initialize(properties) - fact = try checkedCast(prx: comm.stringToProxy(factoryRef)!, type: SSLServerFactoryPrx.self)! - d = createServerProps(defaultProperties) - d["IceSSL.Ciphers"] = "(DH_anon*)" - d["IceSSL.VerifyPeer"] = "0" - d["IceSSL.ProtocolVersionMax"] = "tls1_2" - d["IceSSL.ProtocolVersionMin"] = "tls1_2" - server = try fact.createServer(d)! - do { - try server.ice_ping() - try test(false) - } catch is ProtocolException { - // Expected on some platforms. - } catch is ConnectionLostException { - // Expected on some platforms. - } - try fact.destroyServer(server) - comm.destroy() - - // - // This should succeed. - // - comm = try helper.initialize(properties) - fact = try checkedCast(prx: comm.stringToProxy(factoryRef)!, type: SSLServerFactoryPrx.self)! - d = createServerProps(defaultProperties) - d["IceSSL.Ciphers"] = "(DH_anon*)" - d["IceSSL.VerifyPeer"] = "0" - d["IceSSL.ProtocolVersionMax"] = "tls1" - d["IceSSL.ProtocolVersionMin"] = "ssl3" - server = try fact.createServer(d)! - try server.ice_ping() - try fact.destroyServer(server) - comm.destroy() - - // - // This should fail because the client only accept SSLv3 and the server - // use the default protocol set that disables SSLv3 - // - properties = createClientProps( - defaultProperties: defaultProperties, cert: "c_rsa_ca1", ca: "cacert1") - properties.setProperty(key: "IceSSL.VerifyPeer", value: "0") - properties.setProperty(key: "IceSSL.ProtocolVersionMin", value: "ssl3") - properties.setProperty(key: "IceSSL.ProtocolVersionMax", value: "ssl3") - - comm = try helper.initialize(properties) - - fact = try checkedCast(prx: comm.stringToProxy(factoryRef)!, type: SSLServerFactoryPrx.self)! - d = createServerProps(defaultProperties: defaultProperties, cert: "s_rsa_ca1", ca: "cacert1") - d["IceSSL.VerifyPeer"] = "0" - server = try fact.createServer(d)! - do { - try server.ice_ping() - try test(false) - } catch is ProtocolException { - // Expected on some platforms. - } catch is ConnectionLostException { - // Expected on some platforms. - } - try fact.destroyServer(server) - comm.destroy() - - // - // This should succeed because both have SSLv3 enabled - // - properties = createClientProps( - defaultProperties: defaultProperties, cert: "c_rsa_ca1", ca: "cacert1") - properties.setProperty(key: "IceSSL.VerifyPeer", value: "0") - properties.setProperty(key: "IceSSL.ProtocolVersionMin", value: "ssl3") - properties.setProperty(key: "IceSSL.ProtocolVersionMax", value: "ssl3") - comm = try helper.initialize(properties) - - fact = try checkedCast(prx: comm.stringToProxy(factoryRef)!, type: SSLServerFactoryPrx.self)! - d = createServerProps(defaultProperties: defaultProperties, cert: "s_rsa_ca1", ca: "cacert1") - d["IceSSL.VerifyPeer"] = "0" - d["IceSSL.ProtocolVersionMin"] = "ssl3" - server = try fact.createServer(d)! - try server.ice_ping() - try fact.destroyServer(server) - comm.destroy() - output.writeLine("ok") - output.write("testing expired certificates... ") properties = createClientProps( defaultProperties: defaultProperties, cert: "c_rsa_ca1", ca: "cacert1") From 2b3114b0e647ddf5cc6174a11055e726567bfbfb Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 5 Apr 2024 10:47:42 +0200 Subject: [PATCH 11/13] Remove unused method --- csharp/src/Ice/IceSSL/SSLEngine.cs | 68 ------------------------------ 1 file changed, 68 deletions(-) diff --git a/csharp/src/Ice/IceSSL/SSLEngine.cs b/csharp/src/Ice/IceSSL/SSLEngine.cs index f674203a758..a5ab1d9de83 100644 --- a/csharp/src/Ice/IceSSL/SSLEngine.cs +++ b/csharp/src/Ice/IceSSL/SSLEngine.cs @@ -351,74 +351,6 @@ private bool checkPath(ref string path) return false; } - private static SslProtocols parseProtocols(string[] arr) - { -#pragma warning disable CS0618 // Type or member is obsolete - SslProtocols result = SslProtocols.Default; -#pragma warning restore CS0618 // Type or member is obsolete - - if (arr.Length > 0) - { - result = 0; - for (int i = 0; i < arr.Length; ++i) - { - string protocol = null; - string s = arr[i].ToUpperInvariant(); - switch (s) - { - case "SSL3": - case "SSLV3": - { - protocol = "Ssl3"; - break; - } - case "TLS": - case "TLS1": - case "TLS1_0": - case "TLSV1": - case "TLSV1_0": - { - protocol = "Tls"; - break; - } - case "TLS1_1": - case "TLSV1_1": - { - protocol = "Tls11"; - break; - } - case "TLS1_2": - case "TLSV1_2": - { - protocol = "Tls12"; - break; - } - case "TLS1_3": - case "TLSV1_3": - { - protocol = "Tls13"; - break; - } - default: - { - break; - } - } - - try - { - SslProtocols value = (SslProtocols)Enum.Parse(typeof(SslProtocols), protocol); - result |= value; - } - catch (Exception) - { - throw new Ice.InitializationException($"IceSSL: unrecognized protocol `{s}'"); - } - } - } - return result; - } - private static X509Certificate2Collection findCertificates(string prop, StoreLocation storeLocation, string name, string value) { From d530a40fbd257ff7ef45bcd06776fe510c50e224 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 5 Apr 2024 11:16:11 +0200 Subject: [PATCH 12/13] Cleanup --- csharp/src/Ice/IceSSL/ConnectorI.cs | 2 +- csharp/src/Ice/IceSSL/Instance.cs | 7 +- csharp/src/Ice/IceSSL/RFC2253.cs | 34 ++--- csharp/src/Ice/IceSSL/SSLEngine.cs | 206 ++++++++++---------------- csharp/src/Ice/IceSSL/TransceiverI.cs | 51 +++---- csharp/src/Ice/IceSSL/TrustManager.cs | 6 +- 6 files changed, 117 insertions(+), 189 deletions(-) diff --git a/csharp/src/Ice/IceSSL/ConnectorI.cs b/csharp/src/Ice/IceSSL/ConnectorI.cs index 805e028a778..d0fff7a676a 100644 --- a/csharp/src/Ice/IceSSL/ConnectorI.cs +++ b/csharp/src/Ice/IceSSL/ConnectorI.cs @@ -24,7 +24,7 @@ internal ConnectorI(Instance instance, IceInternal.Connector del, string host) public override bool Equals(object obj) { - if (!(obj is ConnectorI)) + if (obj is not ConnectorI) { return false; } diff --git a/csharp/src/Ice/IceSSL/Instance.cs b/csharp/src/Ice/IceSSL/Instance.cs index 7b80cf37947..fcfbe29e808 100644 --- a/csharp/src/Ice/IceSSL/Instance.cs +++ b/csharp/src/Ice/IceSSL/Instance.cs @@ -1,7 +1,6 @@ // Copyright (c) ZeroC, Inc. using System.Net.Security; -using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; namespace IceSSL; @@ -25,11 +24,11 @@ internal Instance(SSLEngine engine, short type, string protocol) : internal void traceStream(SslStream stream, string connInfo) => _engine.traceStream(stream, connInfo); - internal void verifyPeer(string address, ConnectionInfo info, string description) => - _engine.verifyPeer(address, info, description); + internal void verifyPeer(ConnectionInfo info, string description) => + _engine.verifyPeer(info, description); internal Ice.InitializationData initializationData() => IceInternal.Util.getInstance(_engine.communicator()).initializationData(); - private SSLEngine _engine; + private readonly SSLEngine _engine; } diff --git a/csharp/src/Ice/IceSSL/RFC2253.cs b/csharp/src/Ice/IceSSL/RFC2253.cs index 1d40c16e24f..39c41725160 100644 --- a/csharp/src/Ice/IceSSL/RFC2253.cs +++ b/csharp/src/Ice/IceSSL/RFC2253.cs @@ -12,18 +12,12 @@ internal class RFC2253 { public class ParseException : Exception { - public ParseException(string reason) - { - this.reason = reason; - } + public ParseException(string reason) => this.reason = reason; internal string - ice_id() - { - return "::RFC2253::ParseException"; - } + ice_id() => "::RFC2253::ParseException"; - internal string reason; + internal readonly string reason; } internal struct RDNPair @@ -34,14 +28,14 @@ internal struct RDNPair internal class RDNEntry { - internal List rdn = new(); + internal List rdn = []; internal bool negate; } internal static List parse(string data) { - List results = new(); - RDNEntry current = new RDNEntry(); + List results = []; + var current = new RDNEntry(); int pos = 0; while (pos < data.Length) { @@ -82,7 +76,7 @@ internal static List parse(string data) internal static List parseStrict(string data) { - List results = new List(); + List results = []; int pos = 0; while (pos < data.Length) { @@ -109,20 +103,20 @@ public static string unescape(string data) if (data[0] == '"') { - if (data[data.Length - 1] != '"') + if (data[^1] != '"') { throw new ParseException("unescape: missing \""); } // // Return the string without quotes. // - return data.Substring(1, data.Length - 2); + return data[1..^1]; } // // Unescape the entire string. // - StringBuilder result = new StringBuilder(); + var result = new StringBuilder(); if (data[0] == '#') { int pos = 1; @@ -217,7 +211,7 @@ private static RDNPair parseNameComponent(string data, ref int pos) private static RDNPair parseAttributeTypeAndValue(string data, ref int pos) { - RDNPair p = new RDNPair(); + var p = new RDNPair(); p.key = parseAttributeType(data, ref pos); eatWhite(data, ref pos); if (pos >= data.Length) @@ -335,7 +329,7 @@ private static string parseAttributeValue(string data, ref int pos) // RFC 2253 // # hexstring // - StringBuilder result = new StringBuilder(); + var result = new StringBuilder(); if (data[pos] == '#') { result.Append(data[pos]); @@ -483,6 +477,6 @@ private static void eatWhite(string data, ref int pos) } } - private static string special = ",=+<>#;"; - private static string hexvalid = "0123456789abcdefABCDEF"; + private const string special = ",=+<>#;"; + private const string hexvalid = "0123456789abcdefABCDEF"; } diff --git a/csharp/src/Ice/IceSSL/SSLEngine.cs b/csharp/src/Ice/IceSSL/SSLEngine.cs index a5ab1d9de83..6e5907f8237 100644 --- a/csharp/src/Ice/IceSSL/SSLEngine.cs +++ b/csharp/src/Ice/IceSSL/SSLEngine.cs @@ -1,10 +1,11 @@ // Copyright (c) ZeroC, Inc. using System.Diagnostics; +using System.Net.Security; using System.Security; -using System.Security.Authentication; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; +using System.Text; namespace IceSSL; @@ -30,10 +31,7 @@ internal void initialize() const string prefix = "IceSSL."; Ice.Properties properties = communicator().getProperties(); - // - // Check for a default directory. We look in this directory for - // files mentioned in the configuration. - // + // Check for a default directory. We look in this directory for files mentioned in the configuration. _defaultDir = properties.getProperty(prefix + "DefaultDir"); string certStoreLocation = properties.getPropertyWithDefault(prefix + "CertStoreLocation", "CurrentUser"); @@ -54,22 +52,14 @@ internal void initialize() } _useMachineContext = certStoreLocation == "LocalMachine"; - // - // CheckCertName determines whether we compare the name in a peer's - // certificate against its hostname. - // + // CheckCertName determines whether we compare the name in a peer's certificate against its hostname. _checkCertName = properties.getPropertyAsIntWithDefault(prefix + "CheckCertName", 0) > 0; - // - // VerifyDepthMax establishes the maximum length of a peer's certificate - // chain, including the peer's certificate. A value of 0 means there is - // no maximum. - // + // VerifyDepthMax establishes the maximum length of a peer's certificate chain, including the peer's + // certificate. A value of 0 means there is no maximum. _verifyDepthMax = properties.getPropertyAsIntWithDefault(prefix + "VerifyDepthMax", 3); - // // CheckCRL determines whether the certificate revocation list is checked, and how strictly. - // _checkCRL = properties.getPropertyAsIntWithDefault(prefix + "CheckCRL", 0); Debug.Assert(_certs == null); @@ -147,54 +137,52 @@ internal void initialize() try { - using (FileStream fs = File.OpenRead(certAuthFile)) - { - byte[] data = new byte[fs.Length]; - fs.Read(data, 0, data.Length); + using FileStream fs = File.OpenRead(certAuthFile); + byte[] data = new byte[fs.Length]; + fs.Read(data, 0, data.Length); - string strbuf = ""; - try - { - strbuf = System.Text.Encoding.UTF8.GetString(data); - } - catch (Exception) - { - // Ignore - } + string strbuf = ""; + try + { + strbuf = Encoding.UTF8.GetString(data); + } + catch (Exception) + { + // Ignore + } - if (strbuf.Length == data.Length) + if (strbuf.Length == data.Length) + { + int size, startpos, endpos = 0; + bool first = true; + while (true) { - int size, startpos, endpos = 0; - bool first = true; - while (true) + startpos = strbuf.IndexOf("-----BEGIN CERTIFICATE-----", endpos); + if (startpos != -1) { - startpos = strbuf.IndexOf("-----BEGIN CERTIFICATE-----", endpos); - if (startpos != -1) - { - endpos = strbuf.IndexOf("-----END CERTIFICATE-----", startpos); - size = endpos - startpos + "-----END CERTIFICATE-----".Length; - } - else if (first) - { - startpos = 0; - endpos = strbuf.Length; - size = strbuf.Length; - } - else - { - break; - } - - byte[] cert = new byte[size]; - Buffer.BlockCopy(data, startpos, cert, 0, size); - _caCerts.Import(cert); - first = false; + endpos = strbuf.IndexOf("-----END CERTIFICATE-----", startpos); + size = endpos - startpos + "-----END CERTIFICATE-----".Length; } + else if (first) + { + startpos = 0; + endpos = strbuf.Length; + size = strbuf.Length; + } + else + { + break; + } + + byte[] cert = new byte[size]; + Buffer.BlockCopy(data, startpos, cert, 0, size); + _caCerts.Import(cert); + first = false; } - else - { - _caCerts.Import(data); - } + } + else + { + _caCerts.Import(data); } } catch (Exception ex) @@ -207,54 +195,27 @@ internal void initialize() _initialized = true; } - internal bool useMachineContext() - { - return _useMachineContext; - } + internal bool useMachineContext() => _useMachineContext; - internal X509Certificate2Collection caCerts() - { - return _caCerts; - } + internal X509Certificate2Collection caCerts() => _caCerts; - internal bool getCheckCertName() - { - return _checkCertName; - } + internal bool getCheckCertName() => _checkCertName; - internal Ice.Communicator communicator() - { - return _communicator; - } + internal Ice.Communicator communicator() => _communicator; - internal int securityTraceLevel() - { - return _securityTraceLevel; - } + internal int securityTraceLevel() => _securityTraceLevel; - internal string securityTraceCategory() - { - return _securityTraceCategory; - } + internal string securityTraceCategory() => _securityTraceCategory; - internal bool initialized() - { - return _initialized; - } + internal bool initialized() => _initialized; - internal X509Certificate2Collection certs() - { - return _certs; - } + internal X509Certificate2Collection certs() => _certs; - internal int checkCRL() - { - return _checkCRL; - } + internal int checkCRL() => _checkCRL; - internal void traceStream(System.Net.Security.SslStream stream, string connInfo) + internal void traceStream(SslStream stream, string connInfo) { - System.Text.StringBuilder s = new System.Text.StringBuilder(); + var s = new StringBuilder(); s.Append("SSL connection summary"); if (connInfo.Length > 0) { @@ -272,13 +233,13 @@ internal void traceStream(System.Net.Security.SslStream stream, string connInfo) _logger.trace(_securityTraceCategory, s.ToString()); } - internal void verifyPeer(string address, IceSSL.ConnectionInfo info, string desc) + internal void verifyPeer(ConnectionInfo info, string description) { if (_verifyDepthMax > 0 && info.certs != null && info.certs.Length > _verifyDepthMax) { string msg = (info.incoming ? "incoming" : "outgoing") + " connection rejected:\n" + "length of peer's certificate chain (" + info.certs.Length + ") exceeds maximum of " + - _verifyDepthMax + "\n" + desc; + _verifyDepthMax + "\n" + description; if (_securityTraceLevel >= 1) { _logger.trace(_securityTraceCategory, msg); @@ -286,10 +247,10 @@ internal void verifyPeer(string address, IceSSL.ConnectionInfo info, string desc throw new Ice.SecurityException(msg); } - if (!_trustManager.verify(info, desc)) + if (!_trustManager.verify(info, description)) { string msg = (info.incoming ? "incoming" : "outgoing") + " connection rejected by trust manager\n" + - desc; + description; if (_securityTraceLevel >= 1) { _logger.trace(_securityTraceCategory, msg); @@ -301,33 +262,24 @@ internal void verifyPeer(string address, IceSSL.ConnectionInfo info, string desc private static bool isAbsolutePath(string path) { - // // Skip whitespace - // path = path.Trim(); if (IceInternal.AssemblyUtil.isWindows) { - // // We need at least 3 non-whitespace characters to have an absolute path - // if (path.Length < 3) { return false; } - // // Check for X:\ path ('\' may have been converted to '/') - // if ((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) { return path[1] == ':' && (path[2] == '\\' || path[2] == '/'); } } - - // // Check for UNC path - // return (path[0] == '\\' && path[1] == '\\') || path[0] == '/'; } @@ -347,17 +299,17 @@ private bool checkPath(ref string path) return true; } } - return false; } - private static X509Certificate2Collection findCertificates(string prop, StoreLocation storeLocation, - string name, string value) + private static X509Certificate2Collection findCertificates( + string prop, + StoreLocation storeLocation, + string name, + string value) { - // // Open the X509 certificate store. - // - X509Store store = null; + X509Store store; try { try @@ -375,7 +327,6 @@ private static X509Certificate2Collection findCertificates(string prop, StoreLoc throw new Ice.InitializationException($"IceSSL: failure while opening store specified by {prop}", ex); } - // // Start with all of the certificates in the collection and filter as necessary. // // - If the value is "*", return all certificates. @@ -390,7 +341,6 @@ private static X509Certificate2Collection findCertificates(string prop, StoreLoc // Thumbprint // // A value must be enclosed in single or double quotes if it contains whitespace. - // X509Certificate2Collection result = [.. store.Certificates]; try { @@ -404,10 +354,8 @@ private static X509Certificate2Collection findCertificates(string prop, StoreLoc int pos; while ((pos = value.IndexOf(':', start)) != -1) { - // // Parse the X509FindType. - // - string field = value.Substring(start, pos - start).Trim().ToUpperInvariant(); + string field = value[start..pos].Trim().ToUpperInvariant(); X509FindType findType; if (field == "SUBJECT") { @@ -442,9 +390,7 @@ private static X509Certificate2Collection findCertificates(string prop, StoreLoc throw new Ice.InitializationException($"IceSSL: unknown key in `{value}'"); } - // // Parse the argument. - // start = pos + 1; while (start < value.Length && (value[start] == ' ' || value[start] == '\t')) { @@ -474,7 +420,7 @@ private static X509Certificate2Collection findCertificates(string prop, StoreLoc throw new Ice.InitializationException($"IceSSL: unmatched quote in `{value}'"); } ++start; - arg = value.Substring(start, end - start); + arg = value[start..end]; start = end + 1; } else @@ -483,30 +429,28 @@ private static X509Certificate2Collection findCertificates(string prop, StoreLoc int end = value.IndexOfAny(ws, start); if (end == -1) { - arg = value.Substring(start); + arg = value[start..]; start = value.Length; } else { - arg = value.Substring(start, end - start); + arg = value[start..end]; start = end + 1; } } - // // Execute the query. // // TODO: allow user to specify a value for validOnly? - // bool validOnly = false; if (findType == X509FindType.FindBySubjectDistinguishedName || - findType == X509FindType.FindByIssuerDistinguishedName) + findType == X509FindType.FindByIssuerDistinguishedName) { - X500DistinguishedNameFlags[] flags = { + X500DistinguishedNameFlags[] flags = [ X500DistinguishedNameFlags.None, X500DistinguishedNameFlags.Reversed, - }; - X500DistinguishedName dn = new X500DistinguishedName(arg); + ]; + var dn = new X500DistinguishedName(arg); X509Certificate2Collection r = result; for (int i = 0; i < flags.Length; ++i) { diff --git a/csharp/src/Ice/IceSSL/TransceiverI.cs b/csharp/src/Ice/IceSSL/TransceiverI.cs index c1bbdf5d1ae..e4eeb062d67 100644 --- a/csharp/src/Ice/IceSSL/TransceiverI.cs +++ b/csharp/src/Ice/IceSSL/TransceiverI.cs @@ -71,7 +71,7 @@ public int initialize(IceInternal.Buffer readBuffer, IceInternal.Buffer writeBuf _authenticated = true; _cipher = _sslStream.CipherAlgorithm.ToString(); - _instance.verifyPeer(_host, (ConnectionInfo)getInfo(), ToString()); + _instance.verifyPeer((ConnectionInfo)getInfo(), ToString()); if (_instance.securityTraceLevel() >= 1) { @@ -325,15 +325,9 @@ public Ice.ConnectionInfo getInfo() public void checkSendSize(IceInternal.Buffer buf) => _delegate.checkSendSize(buf); - public void setBufferSize(int rcvSize, int sndSize) - { - _delegate.setBufferSize(rcvSize, sndSize); - } + public void setBufferSize(int rcvSize, int sndSize) => _delegate.setBufferSize(rcvSize, sndSize); - public override string ToString() - { - return _delegate.ToString(); - } + public override string ToString() => _delegate.ToString(); public string toDetailedString() => _delegate.toDetailedString(); @@ -473,7 +467,7 @@ private bool startAuthenticate(IceInternal.AsyncCallback callback, object state) } catch (AuthenticationException ex) { - Ice.SecurityException e = new Ice.SecurityException(ex); + var e = new Ice.SecurityException(ex); e.reason = ex.Message; throw e; } @@ -515,7 +509,7 @@ private void finishAuthenticate() } catch (AuthenticationException ex) { - Ice.SecurityException e = new Ice.SecurityException(ex); + var e = new Ice.SecurityException(ex); e.reason = ex.Message; throw e; } @@ -525,8 +519,12 @@ private void finishAuthenticate() } } - private X509Certificate selectCertificate(object sender, string targetHost, X509CertificateCollection certs, - X509Certificate remoteCertificate, string[] acceptableIssuers) + private X509Certificate selectCertificate( + object sender, + string targetHost, + X509CertificateCollection certs, + X509Certificate remoteCertificate, + string[] acceptableIssuers) { if (certs == null || certs.Count == 0) { @@ -537,9 +535,7 @@ private X509Certificate selectCertificate(object sender, string targetHost, X509 return certs[0]; } - // // Use the first certificate that match the acceptable issuers. - // if (acceptableIssuers != null && acceptableIssuers.Length > 0) { foreach (X509Certificate certificate in certs) @@ -553,8 +549,11 @@ private X509Certificate selectCertificate(object sender, string targetHost, X509 return certs[0]; } - private bool validationCallback(object sender, X509Certificate certificate, X509Chain chainEngine, - SslPolicyErrors policyErrors) + private bool validationCallback( + object sender, + X509Certificate certificate, + X509Chain chainEngine, + SslPolicyErrors policyErrors) { using var chain = new X509Chain(_instance.engine().useMachineContext()); try @@ -567,9 +566,7 @@ private bool validationCallback(object sender, X509Certificate certificate, X509 X509Certificate2Collection caCerts = _instance.engine().caCerts(); if (caCerts != null) { - // // We need to set this flag to be able to use a certificate authority from the extra store. - // chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority; foreach (X509Certificate2 cert in caCerts) { @@ -588,7 +585,7 @@ private bool validationCallback(object sender, X509Certificate certificate, X509 } else if (_instance.engine().caCerts() != null) { - X509ChainElement e = chain.ChainElements[chain.ChainElements.Count - 1]; + X509ChainElement e = chain.ChainElements[^1]; if (!chain.ChainPolicy.ExtraStore.Contains(e.Certificate)) { if (_verifyPeer > 0) @@ -617,13 +614,9 @@ private bool validationCallback(object sender, X509Certificate certificate, X509 if ((errors & (int)SslPolicyErrors.RemoteCertificateNotAvailable) > 0) { - // - // The RemoteCertificateNotAvailable case does not appear to be possible - // for an outgoing connection. Since .NET requires an authenticated - // connection, the remote peer closes the socket if it does not have a - // certificate to provide. - // - + // The RemoteCertificateNotAvailable case does not appear to be possible for an outgoing connection. + // Since .NET requires an authenticated connection, the remote peer closes the socket if it does not + // have a certificate to provide. if (_incoming) { if (_verifyPeer > 1) @@ -682,7 +675,7 @@ private bool validationCallback(object sender, X509Certificate certificate, X509 { // Untrusted root is OK when using our custom chain engine if the CA certificate is present in // the chain policy extra store. - X509ChainElement e = chain.ChainElements[chain.ChainElements.Count - 1]; + X509ChainElement e = chain.ChainElements[^1]; if (!chain.ChainPolicy.ExtraStore.Contains(e.Certificate)) { if (_verifyPeer > 0) @@ -808,7 +801,7 @@ public int getRecvPacketSize(int length) => private readonly IceInternal.Transceiver _delegate; private readonly string _host = ""; private readonly string _adapterName = ""; - private bool _incoming; + private readonly bool _incoming; private SslStream _sslStream; private readonly int _verifyPeer; private bool _isConnected; diff --git a/csharp/src/Ice/IceSSL/TrustManager.cs b/csharp/src/Ice/IceSSL/TrustManager.cs index 3f39e5896a1..0ddd64f7de2 100644 --- a/csharp/src/Ice/IceSSL/TrustManager.cs +++ b/csharp/src/Ice/IceSSL/TrustManager.cs @@ -28,8 +28,8 @@ internal TrustManager(Ice.Communicator communicator) { key = entry.Key; string name = key.Substring("IceSSL.TrustOnly.Server.".Length); - List> reject = new List>(); - List> accept = new List>(); + var reject = new List>(); + var accept = new List>(); parse(entry.Value, reject, accept); if (reject.Count > 0) { @@ -159,9 +159,7 @@ internal bool verify(ConnectionInfo info, string description) } } - // // Succeed if we match anything in the accept set. - // foreach (List> matchSet in accept) { if (_traceLevel > 0) From f972201c186bd4ea6133ee28c0b509239830bca4 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 5 Apr 2024 11:32:49 +0200 Subject: [PATCH 13/13] Cleanup --- csharp/src/Ice/IceSSL/EndpointI.cs | 7 ++--- csharp/src/Ice/IceSSL/RFC2253.cs | 41 +++++++-------------------- csharp/src/Ice/IceSSL/TransceiverI.cs | 13 ++------- 3 files changed, 16 insertions(+), 45 deletions(-) diff --git a/csharp/src/Ice/IceSSL/EndpointI.cs b/csharp/src/Ice/IceSSL/EndpointI.cs index 8875205a1f4..b18be5ee259 100644 --- a/csharp/src/Ice/IceSSL/EndpointI.cs +++ b/csharp/src/Ice/IceSSL/EndpointI.cs @@ -114,8 +114,9 @@ public void connectors(List connectors) private readonly IceInternal.EndpointI_connectors _callback; } - public override void connectors_async(Ice.EndpointSelectionType selType, - IceInternal.EndpointI_connectors callback) + public override void connectors_async( + Ice.EndpointSelectionType selType, + IceInternal.EndpointI_connectors callback) { string host = ""; for (Ice.EndpointInfo p = _delegate.getInfo(); p != null; p = p.underlying) @@ -187,9 +188,7 @@ public override bool equivalent(IceInternal.EndpointI endpoint) public override string options() => _delegate.options(); - // // Compare endpoints for sorting purposes - // public override int CompareTo(IceInternal.EndpointI obj) { if (obj is not EndpointI) diff --git a/csharp/src/Ice/IceSSL/RFC2253.cs b/csharp/src/Ice/IceSSL/RFC2253.cs index 39c41725160..2766e5a6475 100644 --- a/csharp/src/Ice/IceSSL/RFC2253.cs +++ b/csharp/src/Ice/IceSSL/RFC2253.cs @@ -14,8 +14,7 @@ public class ParseException : Exception { public ParseException(string reason) => this.reason = reason; - internal string - ice_id() => "::RFC2253::ParseException"; + internal string ice_id() => "::RFC2253::ParseException"; internal readonly string reason; } @@ -107,15 +106,11 @@ public static string unescape(string data) { throw new ParseException("unescape: missing \""); } - // // Return the string without quotes. - // return data[1..^1]; } - // // Unescape the entire string. - // var result = new StringBuilder(); if (data[0] == '#') { @@ -237,7 +232,6 @@ private static string parseAttributeType(string data, ref int pos) string result = ""; - // // RFC 1779. // ::= 1*( ) | "OID." | "oid." // ::= | "." @@ -247,14 +241,12 @@ private static string parseAttributeType(string data, ref int pos) // oid = 1*DIGIT *("." 1*DIGIT) // // In section 4 of RFC 2253 the document says: - // Implementations MUST allow an oid in the attribute type to be - // prefixed by one of the character strings "oid." or "OID.". + // Implementations MUST allow an oid in the attribute type to be prefixed by one of the character strings + // "oid." or "OID.". // - // Here we must also check for "oid." and "OID." before parsing - // according to the ALPHA KEYCHAR* rule. + // Here we must also check for "oid." and "OID." before parsing according to the ALPHA KEYCHAR* rule. // // First the OID case. - // if (char.IsDigit(data[pos]) || (data.Length - pos >= 4 && (data.Substring(pos, 4) == "oid." || data.Substring(pos, 4) == "OID."))) @@ -292,11 +284,8 @@ private static string parseAttributeType(string data, ref int pos) } else if (char.IsUpper(data[pos]) || char.IsLower(data[pos])) { - // - // The grammar is wrong in this case. It should be ALPHA - // KEYCHAR* otherwise it will not accept "O" as a valid - // attribute type. - // + // The grammar is wrong in this case. It should be ALPHA KEYCHAR* otherwise it will not accept "O" as a + // valid attribute type. result += data[pos]; ++pos; // 1* KEYCHAR @@ -325,10 +314,8 @@ private static string parseAttributeValue(string data, ref int pos) return ""; } - // // RFC 2253 // # hexstring - // var result = new StringBuilder(); if (data[pos] == '#') { @@ -344,11 +331,10 @@ private static string parseAttributeValue(string data, ref int pos) result.Append(h); } } - // + // RFC 2253 // QUOTATION *( quotechar | pair ) QUOTATION ; only from v2 // quotechar = - // else if (data[pos] == '"') { result.Append(data[pos]); @@ -406,10 +392,8 @@ private static string parseAttributeValue(string data, ref int pos) return result.ToString(); } - // // RFC2253: // pair = "\" ( special | "\" | QUOTATION | hexpair ) - // private static string parsePair(string data, ref int pos) { string result = ""; @@ -433,10 +417,8 @@ private static string parsePair(string data, ref int pos) return parseHexPair(data, ref pos, false); } - // // RFC 2253 // hexpair = hexchar hexchar - // private static string parseHexPair(string data, ref int pos, bool allowEmpty) { string result = ""; @@ -461,14 +443,11 @@ private static string parseHexPair(string data, ref int pos, bool allowEmpty) return result; } - // // RFC 2253: // - // Implementations MUST allow for space (' ' ASCII 32) characters to be - // present between name-component and ',', between attributeTypeAndValue - // and '+', between attributeType and '=', and between '=' and - // attributeValue. These space characters are ignored when parsing. - // + // Implementations MUST allow for space (' ' ASCII 32) characters to be present between name-component and ',', + // between attributeTypeAndValue and '+', between attributeType and '=', and between '=' and attributeValue. + // These space characters are ignored when parsing. private static void eatWhite(string data, ref int pos) { while (pos < data.Length && data[pos] == ' ') diff --git a/csharp/src/Ice/IceSSL/TransceiverI.cs b/csharp/src/Ice/IceSSL/TransceiverI.cs index e4eeb062d67..25271ca1733 100644 --- a/csharp/src/Ice/IceSSL/TransceiverI.cs +++ b/csharp/src/Ice/IceSSL/TransceiverI.cs @@ -26,13 +26,9 @@ public int initialize(IceInternal.Buffer readBuffer, IceInternal.Buffer writeBuf IceInternal.Network.setBlock(fd(), true); // SSL requires a blocking socket - // - // For timeouts to work properly, we need to receive/send - // the data in several chunks. Otherwise, we would only be - // notified when all the data is received/written. The - // connection timeout could easily be triggered when + // For timeouts to work properly, we need to receive/send the data in several chunks. Otherwise, we would only + // be notified when all the data is received/written. The connection timeout could easily be triggered when // receiving/sending large messages. - // _maxSendPacketSize = Math.Max(512, IceInternal.Network.getSendBufferSize(fd())); _maxRecvPacketSize = Math.Max(512, IceInternal.Network.getRecvBufferSize(fd())); @@ -499,10 +495,7 @@ private void finishAuthenticate() { if (IceInternal.Network.connectionLost(ex)) { - // - // This situation occurs when connectToSelf is called; the "remote" end - // closes the socket immediately. - // + // This situation occurs when connectToSelf is called; the "remote" end closes the socket immediately. throw new Ice.ConnectionLostException(); } throw new Ice.SocketException(ex);