Skip to content

Commit 299e08a

Browse files
committed
Make some minor stylistic adjustments
Removed a typo and a superfluous comment, changed to property use from backing field in one occasion and adapted the exception message in a switch statement.
1 parent 0c22259 commit 299e08a

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

Rubberduck.CodeAnalysis/QuickFixes/RemoveEmptyIfBlockQuickFix.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public override void Fix(IInspectionResult result, IRewriteSession rewriteSessio
3232
UpdateContext(elseIfBlockContext, rewriter);
3333
break;
3434
default:
35-
throw new NotSupportedException(nameof(result.Context));
35+
throw new NotSupportedException(result.Context.GetType().ToString());
3636
}
3737
}
3838

Rubberduck.Parsing/Rewriter/RewriteSessionBase.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,12 @@ public bool TryRewrite()
4747
return false;
4848
}
4949

50-
lock (_invalidationLockObject)
50+
//This is thread-safe because, once invalidated, there is no way back.
51+
if (IsInvalidated)
5152
{
52-
if (_isInvalidated)
53-
{
54-
Logger.Warn("Tried to execute Rewrite on a RewriteSession that was already invalidated.");
55-
return false;
56-
}
57-
}
53+
Logger.Warn("Tried to execute Rewrite on a RewriteSession that was already invalidated.");
54+
return false;
55+
}
5856

5957
if (!_rewritingAllowed(this))
6058
{

Rubberduck.Refactorings/ExtractInterface/ExtractInterfaceRefactoring.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void Refactor(Declaration target)
9494

9595
private void AddInterface()
9696
{
97-
//We need to suspend here since addin the interface and rewriting will both trigger a reparse.
97+
//We need to suspend here since adding the interface and rewriting will both trigger a reparse.
9898
var suspendResult = _model.State.OnSuspendParser(this, new[] {ParserState.Ready}, AddInterfaceInternal);
9999
if (suspendResult != SuspensionResult.Completed)
100100
{
@@ -122,7 +122,6 @@ private void AddInterfaceInternal()
122122

123123
AddInterfaceMembersToClass(rewriter);
124124

125-
//We have to reparse here already, because
126125
rewriteSession.TryRewrite();
127126
}
128127

0 commit comments

Comments
 (0)