mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Remove WorkflowJobSourceAdapter reference (#10326)
This commit is contained in:
@@ -81,51 +81,43 @@ namespace System.Management.Automation
|
||||
Dbg.Assert(jobSourceAdapterType != null, "JobSourceAdapterType should never be called with null value.");
|
||||
object instance = null;
|
||||
|
||||
if (jobSourceAdapterType.FullName != null && jobSourceAdapterType.FullName.EndsWith("WorkflowJobSourceAdapter", StringComparison.OrdinalIgnoreCase))
|
||||
ConstructorInfo constructor = jobSourceAdapterType.GetConstructor(Type.EmptyTypes);
|
||||
if (!constructor.IsPublic)
|
||||
{
|
||||
MethodInfo method = jobSourceAdapterType.GetMethod("GetInstance");
|
||||
instance = method.Invoke(null, null);
|
||||
string message = string.Format(CultureInfo.CurrentCulture,
|
||||
RemotingErrorIdStrings.JobManagerRegistrationConstructorError,
|
||||
jobSourceAdapterType.FullName);
|
||||
throw new InvalidOperationException(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConstructorInfo constructor = jobSourceAdapterType.GetConstructor(Type.EmptyTypes);
|
||||
if (!constructor.IsPublic)
|
||||
{
|
||||
string message = string.Format(CultureInfo.CurrentCulture,
|
||||
RemotingErrorIdStrings.JobManagerRegistrationConstructorError,
|
||||
jobSourceAdapterType.FullName);
|
||||
throw new InvalidOperationException(message);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
instance = constructor.Invoke(null);
|
||||
}
|
||||
catch (MemberAccessException exception)
|
||||
{
|
||||
_tracer.TraceException(exception);
|
||||
throw;
|
||||
}
|
||||
catch (TargetInvocationException exception)
|
||||
{
|
||||
_tracer.TraceException(exception);
|
||||
throw;
|
||||
}
|
||||
catch (TargetParameterCountException exception)
|
||||
{
|
||||
_tracer.TraceException(exception);
|
||||
throw;
|
||||
}
|
||||
catch (NotSupportedException exception)
|
||||
{
|
||||
_tracer.TraceException(exception);
|
||||
throw;
|
||||
}
|
||||
catch (SecurityException exception)
|
||||
{
|
||||
_tracer.TraceException(exception);
|
||||
throw;
|
||||
}
|
||||
try
|
||||
{
|
||||
instance = constructor.Invoke(null);
|
||||
}
|
||||
catch (MemberAccessException exception)
|
||||
{
|
||||
_tracer.TraceException(exception);
|
||||
throw;
|
||||
}
|
||||
catch (TargetInvocationException exception)
|
||||
{
|
||||
_tracer.TraceException(exception);
|
||||
throw;
|
||||
}
|
||||
catch (TargetParameterCountException exception)
|
||||
{
|
||||
_tracer.TraceException(exception);
|
||||
throw;
|
||||
}
|
||||
catch (NotSupportedException exception)
|
||||
{
|
||||
_tracer.TraceException(exception);
|
||||
throw;
|
||||
}
|
||||
catch (SecurityException exception)
|
||||
{
|
||||
_tracer.TraceException(exception);
|
||||
throw;
|
||||
}
|
||||
|
||||
if (instance != null)
|
||||
|
||||
Reference in New Issue
Block a user