diff --git a/src/Castle.Windsor/Core/Internal/ReflectionUtil.cs b/src/Castle.Windsor/Core/Internal/ReflectionUtil.cs index ae13fea3de..1372e7922a 100644 --- a/src/Castle.Windsor/Core/Internal/ReflectionUtil.cs +++ b/src/Castle.Windsor/Core/Internal/ReflectionUtil.cs @@ -159,7 +159,7 @@ public static Type[] GetAvailableTypes(this Assembly assembly, bool includeNonEx } catch (ReflectionTypeLoadException e) { - return e.Types.FindAll(t => t != null); + return e.Types.Where(t => t != null).ToArray(); // NOTE: perhaps we should not ignore the exceptions here, and log them? } } diff --git a/src/Castle.Windsor/Windsor/Diagnostics/PotentiallyMisconfiguredComponentsDiagnostic.cs b/src/Castle.Windsor/Windsor/Diagnostics/PotentiallyMisconfiguredComponentsDiagnostic.cs index 2688f2f4ef..5305785bd9 100644 --- a/src/Castle.Windsor/Windsor/Diagnostics/PotentiallyMisconfiguredComponentsDiagnostic.cs +++ b/src/Castle.Windsor/Windsor/Diagnostics/PotentiallyMisconfiguredComponentsDiagnostic.cs @@ -14,7 +14,8 @@ namespace Castle.Windsor.Diagnostics { - using Castle.Core.Internal; + using System.Linq; + using Castle.MicroKernel; public class PotentiallyMisconfiguredComponentsDiagnostic : IPotentiallyMisconfiguredComponentsDiagnostic @@ -29,7 +30,7 @@ public PotentiallyMisconfiguredComponentsDiagnostic(IKernel kernel) public IHandler[] Inspect() { var allHandlers = kernel.GetAssignableHandlers(typeof(object)); - var waitingHandlers = allHandlers.FindAll(IsWaitingForDependencies); + var waitingHandlers = allHandlers.Where(IsWaitingForDependencies).ToArray(); return waitingHandlers; } diff --git a/src/Castle.Windsor/Windsor/Diagnostics/UsingContainerAsServiceLocatorDiagnostic.cs b/src/Castle.Windsor/Windsor/Diagnostics/UsingContainerAsServiceLocatorDiagnostic.cs index b510f435ef..720731e546 100644 --- a/src/Castle.Windsor/Windsor/Diagnostics/UsingContainerAsServiceLocatorDiagnostic.cs +++ b/src/Castle.Windsor/Windsor/Diagnostics/UsingContainerAsServiceLocatorDiagnostic.cs @@ -51,8 +51,10 @@ public UsingContainerAsServiceLocatorDiagnostic(IKernel kernel) public IHandler[] Inspect() { var allHandlers = kernel.GetAssignableHandlers(typeof(object)); - var handlersWithContainerDependency = allHandlers.FindAll(HasDependencyOnTheContainer); - return handlersWithContainerDependency.FindAll(h => ExceptionsToTheRule.Any(e => e(h)) == false); + var handlersWithContainerDependency = allHandlers.Where(HasDependencyOnTheContainer); + return handlersWithContainerDependency + .Where(h => ExceptionsToTheRule.Any(e => e(h)) == false) + .ToArray(); } private bool HasDependencyOnTheContainer(IHandler handler)