From dbf1f8f6f3b13fae25456da45f078837a136ee8a Mon Sep 17 00:00:00 2001 From: Rodrigo Vidal Date: Sat, 14 Feb 2015 17:03:39 -0200 Subject: [PATCH 1/3] small fixes in ChildrenContainerBase.cs --- .../Internal/ChildrenContainerBase.cs | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/core/Akka/Actor/ChildrenContainer/Internal/ChildrenContainerBase.cs b/src/core/Akka/Actor/ChildrenContainer/Internal/ChildrenContainerBase.cs index 7656b40fcf9..3be5d992702 100644 --- a/src/core/Akka/Actor/ChildrenContainer/Internal/ChildrenContainerBase.cs +++ b/src/core/Akka/Actor/ChildrenContainer/Internal/ChildrenContainerBase.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Linq; using System.Text; using Akka.Util.Internal.Collections; @@ -23,41 +22,37 @@ protected ChildrenContainerBase(IImmutableMap children) public abstract ChildrenContainer ShallDie(ActorRef actor); public abstract ChildrenContainer Unreserve(string name); - public IReadOnlyList Children + public IReadOnlyList Children { get { - var children = (from stat in InternalChildren.AllValuesMinToMax - let childRestartStats = stat as ChildRestartStats - where childRestartStats != null - select childRestartStats.Child).ToList(); - return children; + return (from stat in InternalChildren.AllValuesMinToMax + let childRestartStats = stat as ChildRestartStats + where childRestartStats != null + select childRestartStats.Child).ToList(); } } - public IReadOnlyList Stats + public IReadOnlyList Stats { get { - var children = (from stat in InternalChildren.AllValuesMinToMax - let childRestartStat = stat as ChildRestartStats - where childRestartStat != null - select childRestartStat).ToList(); - return children; + return (from stat in InternalChildren.AllValuesMinToMax + let childRestartStats = stat as ChildRestartStats + where childRestartStats != null + select childRestartStats).ToList(); } } protected IImmutableMap InternalChildren { get { return _children; } } - - public bool TryGetByName(string name, out ChildStats stats) + public bool TryGetByName(string name, out ChildStats stats) { if (InternalChildren.TryGet(name, out stats)) return true; stats = null; return false; } - public bool TryGetByRef(ActorRef actor, out ChildRestartStats childRestartStats) { ChildStats stats; From c12327fe35401bb50a1fb034005741ce16d48bcb Mon Sep 17 00:00:00 2001 From: Rodrigo Vidal Date: Sun, 15 Feb 2015 16:24:29 -0200 Subject: [PATCH 2/3] remove unused references --- src/core/Akka/Actor/ActorRefProvider.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/Akka/Actor/ActorRefProvider.cs b/src/core/Akka/Actor/ActorRefProvider.cs index 475f1c91ed6..26fc443018f 100644 --- a/src/core/Akka/Actor/ActorRefProvider.cs +++ b/src/core/Akka/Actor/ActorRefProvider.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Akka.Actor.Internals; using Akka.Dispatch; @@ -44,7 +43,6 @@ public interface ActorRefProvider /// Gets the settings. Settings Settings { get; } - /// /// Initialization of an ActorRefProvider happens in two steps: first /// construction of the object with settings, eventStream, etc. From 3d2a008850c1c438ed6d74eadb07cd89e7f5392c Mon Sep 17 00:00:00 2001 From: Rodrigo Vidal Date: Sun, 15 Feb 2015 17:30:11 -0200 Subject: [PATCH 3/3] actorbase minor changes --- src/core/Akka/Actor/ActorBase.SupervisorStrategy.cs | 2 +- src/core/Akka/Actor/ActorBase.cs | 6 ++---- src/core/Akka/Actor/ActorRefProvider.cs | 1 - src/core/Akka/Actor/Internals/InternalSupportsTestFSMRef.cs | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/core/Akka/Actor/ActorBase.SupervisorStrategy.cs b/src/core/Akka/Actor/ActorBase.SupervisorStrategy.cs index eac8bf6516f..561292fb73d 100644 --- a/src/core/Akka/Actor/ActorBase.SupervisorStrategy.cs +++ b/src/core/Akka/Actor/ActorBase.SupervisorStrategy.cs @@ -2,7 +2,7 @@ { public abstract partial class ActorBase { - private SupervisorStrategy _supervisorStrategy = null; + private SupervisorStrategy _supervisorStrategy; /// /// Gets or sets a . diff --git a/src/core/Akka/Actor/ActorBase.cs b/src/core/Akka/Actor/ActorBase.cs index b03af12ddfd..99394c85377 100644 --- a/src/core/Akka/Actor/ActorBase.cs +++ b/src/core/Akka/Actor/ActorBase.cs @@ -1,6 +1,5 @@ using System; using Akka.Actor.Internal; -using Akka.Dispatch.SysMsg; using Akka.Event; namespace Akka.Actor @@ -106,7 +105,7 @@ protected ActorRef Sender /// Gets the self ActorRef /// /// Self ActorRef - protected ActorRef Self { get { return HasBeenCleared? _clearedSelf : Context.Self; } } + protected ActorRef Self { get { return HasBeenCleared ? _clearedSelf : Context.Self; } } /// /// Gets the context. @@ -163,7 +162,7 @@ internal protected virtual bool AroundReceive(Receive receive, object message) /// /// EmptyReceive is a Receive-delegate that matches no messages at all, ever. /// - protected static Receive EmptyReceive { get { return _=> false; } } + protected static Receive EmptyReceive { get { return _ => false; } } /// /// Is called when a message isn't handled by the current behavior of the actor @@ -182,7 +181,6 @@ protected virtual void Unhandled(object message) Context.System.EventStream.Publish(new UnhandledMessage(message, Sender, Self)); } - /// /// Changes the Actor's behavior to become the new handler. /// This method acts upon the behavior stack as follows: diff --git a/src/core/Akka/Actor/ActorRefProvider.cs b/src/core/Akka/Actor/ActorRefProvider.cs index 26fc443018f..b305069cd95 100644 --- a/src/core/Akka/Actor/ActorRefProvider.cs +++ b/src/core/Akka/Actor/ActorRefProvider.cs @@ -69,7 +69,6 @@ public interface ActorRefProvider /// A path returned by . Do NOT pass in any other path! void UnregisterTempActor(ActorPath path); - /// /// Actor factory with create-only semantics: will create an actor as /// described by with the given and (may be different diff --git a/src/core/Akka/Actor/Internals/InternalSupportsTestFSMRef.cs b/src/core/Akka/Actor/Internals/InternalSupportsTestFSMRef.cs index acb6d0d4fd0..6ce7e188a65 100644 --- a/src/core/Akka/Actor/Internals/InternalSupportsTestFSMRef.cs +++ b/src/core/Akka/Actor/Internals/InternalSupportsTestFSMRef.cs @@ -27,7 +27,7 @@ public interface InternalSupportsTestFSMRef /// public class InternalActivateFsmLogging { - private static readonly InternalActivateFsmLogging _instance=new InternalActivateFsmLogging(); + private static readonly InternalActivateFsmLogging _instance = new InternalActivateFsmLogging(); private InternalActivateFsmLogging(){} ///