Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[WIP] fix static analized high priority issues #2391

Merged
merged 1 commit into from
Dec 1, 2016

Conversation

maxim-s
Copy link
Contributor

@maxim-s maxim-s commented Dec 1, 2016

@@ -434,7 +434,7 @@ public override int GetHashCode()
{
int hashCode = (_node != null ? _node.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (_target != null ? _target.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (_direction != null ? _direction.GetHashCode() : 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum can't be null

@@ -120,7 +120,7 @@ public void Enter(string name)
/// </summary>
public void Enter(TimeSpan timeout, ImmutableList<string> names)
{
_system.Log.Debug("entering barriers {0}", names.Aggregate((a,b) => a = ", " + b));
_system.Log.Debug("entering barriers {0}", names.Aggregate((a, b) => "(" + a + "," + b + ")"));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'a' is always rewritten in method, and more clear debug message

@@ -730,7 +730,6 @@ protected void Accepting()
_endpoints.MarkAsQuarantined(gotuid.RemoteAddress, gotuid.Uid,
Deadline.Now + _settings.QuarantineDuration);
_eventPublisher.NotifyListeners(new QuarantinedEvent(gotuid.RemoteAddress, gotuid.Uid));
Context.Stop(pass.Endpoint);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if policy is WasGated Context.Stop(pass.Endpoint) will cause null reference exception
https://github.com/akka/akka/blob/master/akka-remote/src/main/scala/akka/remote/Remoting.scala#L704

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE catch.

@@ -59,31 +59,29 @@ private void FaultRecreate(Exception cause)
if (System.Settings.DebugLifecycle)
Publish(new Debug(_self.Path.ToString(), failedActor.GetType(), "Restarting"));

if (failedActor != null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failedActor is _actor, _actor already checked on null

@@ -40,18 +40,9 @@ public static Task<T> Ask<T>(this ICanTell self, object message, TimeSpan? timeo
if (provider == null)
throw new ArgumentException("Unable to resolve the target Provider", nameof(self));

ResolveReplyTo();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same as do nothing

@Danthar
Copy link
Member

Danthar commented Dec 1, 2016

Neat. Nice work @maxim-s

@Horusiath Horusiath merged commit ca0c275 into akkadotnet:dev Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants