Support .NET Core 3 (#190)

* fix dynamic code generation issues
* fix NmsQuickStart
This commit is contained in:
Marko Lahma
2019-09-26 17:52:11 +03:00
committed by GitHub
parent 7580540918
commit f78411ac14
30 changed files with 95 additions and 269 deletions

View File

@@ -1,5 +1,5 @@
version: 1.0.{build}
image: Visual Studio 2017
image: Visual Studio 2019
services:
- mssql2017
- msmq

View File

@@ -7,7 +7,6 @@
<ProjectReference Include="..\Spring.NmsQuickStart.Common\Spring.NmsQuickStart.Common.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Apache.NMS.ActiveMQ" Version="1.7.2" />
<PackageReference Include="Common.Logging" Version="$(CommonLoggingVersion)" />
</ItemGroup>
<ItemGroup>

View File

@@ -3,6 +3,7 @@
<TargetFramework>net452</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Apache.NMS" Version="1.8.0" />
<PackageReference Include="Apache.NMS.ActiveMQ" Version="1.7.2" />
</ItemGroup>
<ItemGroup>

View File

@@ -8,7 +8,6 @@
<ProjectReference Include="..\Spring.NmsQuickStart.Common\Spring.NmsQuickStart.Common.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Apache.NMS.ActiveMQ" Version="1.7.2" />
<PackageReference Include="Common.Logging" Version="$(CommonLoggingVersion)" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,3 +1,5 @@
#region License
/*
* Copyright © 2002-2011 the original author or authors.
*
@@ -14,8 +16,9 @@
* limitations under the License.
*/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization;
@@ -368,13 +371,18 @@ namespace Spring.Aop.Framework
/// <see cref="System.Type"/>s to their delegates.
/// </value>
/// <seealso cref="Spring.Aop.Framework.IAdvised.InterfaceMap"/>
public virtual IDictionary InterfaceMap
public virtual IDictionary<Type, object> InterfaceMap
{
get
{
lock (this.SyncRoot)
lock (SyncRoot)
{
return new Hashtable(this.interfaceMap);
var dictionary = new Dictionary<Type, object>(interfaceMap.Count);
foreach (var entry in interfaceMap)
{
dictionary[entry.Key] = entry.Value;
}
return dictionary;
}
}
}

View File

@@ -18,10 +18,7 @@
#endregion
#region Imports
using System;
using System.Collections;
using System.Collections.Generic;
using Common.Logging;
@@ -31,8 +28,6 @@ using Spring.Objects.Factory.Config;
using System.Linq;
#endregion
namespace Spring.Aop.Framework.AutoProxy
{
/// <summary>

View File

@@ -1,7 +1,7 @@
#region License
/*
* Copyright <EFBFBD> 2002-2011 the original author or authors.
* Copyright © 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,18 +18,14 @@
#endregion
#region Imports
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.Serialization;
using Spring.Proxy;
#endregion
namespace Spring.Aop.Framework.DynamicProxy
{
/// <summary>
@@ -39,8 +35,6 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <author>Bruno Baia</author>
public abstract class AbstractAopProxyMethodBuilder : AbstractProxyMethodBuilder
{
#region Fields
/// <summary>
/// The <see cref="IAopProxyTypeGenerator"/> implementation to use.
/// </summary>
@@ -50,13 +44,13 @@ namespace Spring.Aop.Framework.DynamicProxy
/// The dictionary to cache the list of target
/// <see cref="System.Reflection.MethodInfo"/>s.
/// </summary>
protected IDictionary targetMethods;
protected IDictionary<string, MethodInfo> targetMethods;
/// <summary>
/// The dictionary to cache the list of target
/// <see cref="System.Reflection.MethodInfo"/>s defined on the proxy.
/// </summary>
protected IDictionary onProxyTargetMethods;
protected IDictionary<string, MethodInfo> onProxyTargetMethods;
// variables
@@ -112,15 +106,11 @@ namespace Spring.Aop.Framework.DynamicProxy
// private fields
private static IDictionary ldindOpCodes;
#endregion
#region Constructor(s) / Destructor
private static Dictionary<Type, OpCode> ldindOpCodes;
static AbstractAopProxyMethodBuilder()
{
ldindOpCodes = new Hashtable();
ldindOpCodes = new Dictionary<Type, OpCode>();
ldindOpCodes[typeof(sbyte)] = OpCodes.Ldind_I1;
ldindOpCodes[typeof(short)] = OpCodes.Ldind_I2;
ldindOpCodes[typeof(int)] = OpCodes.Ldind_I4;
@@ -152,8 +142,8 @@ namespace Spring.Aop.Framework.DynamicProxy
/// </param>
protected AbstractAopProxyMethodBuilder(
TypeBuilder typeBuilder, IAopProxyTypeGenerator aopProxyGenerator,
bool explicitImplementation, IDictionary targetMethods)
: this(typeBuilder, aopProxyGenerator, explicitImplementation, targetMethods, new Hashtable())
bool explicitImplementation, IDictionary<string, MethodInfo> targetMethods)
: this(typeBuilder, aopProxyGenerator, explicitImplementation, targetMethods, new Dictionary<string, MethodInfo>())
{
}
@@ -178,7 +168,7 @@ namespace Spring.Aop.Framework.DynamicProxy
/// </param>
protected AbstractAopProxyMethodBuilder(
TypeBuilder typeBuilder, IAopProxyTypeGenerator aopProxyGenerator,
bool explicitImplementation, IDictionary targetMethods, IDictionary onProxyTargetMethods)
bool explicitImplementation, IDictionary<string, MethodInfo> targetMethods, IDictionary<string, MethodInfo> onProxyTargetMethods)
: base(typeBuilder, aopProxyGenerator, explicitImplementation)
{
this.aopProxyGenerator = aopProxyGenerator;
@@ -186,10 +176,6 @@ namespace Spring.Aop.Framework.DynamicProxy
this.onProxyTargetMethods = onProxyTargetMethods;
}
#endregion
#region Protected Members
/// <summary>
/// Generates the proxy method.
/// </summary>
@@ -235,7 +221,7 @@ namespace Spring.Aop.Framework.DynamicProxy
targetMethods.Add(methodId, method);
targetMethodCacheField = typeBuilder.DefineField(methodId, typeof(MethodInfo),
FieldAttributes.Private | FieldAttributes.Static | FieldAttributes.InitOnly);
FieldAttributes.Private | FieldAttributes.Static);
MakeGenericMethod(il, method, targetMethodCacheField, genericTargetMethod);
}
@@ -362,7 +348,7 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <param name="method">The method to proxy.</param>
protected virtual void DeclareLocals(ILGenerator il, MethodInfo method)
{
interceptors = il.DeclareLocal(typeof(IList));
interceptors = il.DeclareLocal(typeof(System.Collections.IList));
targetType = il.DeclareLocal(typeof(Type));
arguments = il.DeclareLocal(typeof(Object[]));
@@ -604,10 +590,6 @@ namespace Spring.Aop.Framework.DynamicProxy
il.Emit(OpCodes.Ldloc, returnValue);
}
}
#endregion
#region Reflection.Emit utility methods
/// <summary>
/// Emits MSIL instructions to load a value of the specified <paramref name="type"/>
@@ -675,12 +657,8 @@ namespace Spring.Aop.Framework.DynamicProxy
il.Emit(OpCodes.Unbox_Any, type);
}
}
#endregion
}
#region References helper class definition
internal struct References
{
// fields
@@ -723,7 +701,7 @@ namespace Spring.Aop.Framework.DynamicProxy
typeof(AopContext).GetMethod("PopProxy", BindingFlags.Static | BindingFlags.Public, null, Type.EmptyTypes, null);
public static readonly MethodInfo InvokeMethod =
typeof(AdvisedProxy).GetMethod("Invoke", BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof(Object), typeof(Object), typeof(Type), typeof(MethodInfo), typeof(MethodInfo), typeof(Object[]), typeof(IList) }, null);
typeof(AdvisedProxy).GetMethod("Invoke", BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof(Object), typeof(Object), typeof(Type), typeof(MethodInfo), typeof(MethodInfo), typeof(Object[]), typeof(System.Collections.IList) }, null);
public static readonly MethodInfo GetInterceptorsMethod =
typeof(AdvisedProxy).GetMethod("GetInterceptors", BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof(Type), typeof(MethodInfo) }, null);
@@ -757,8 +735,6 @@ namespace Spring.Aop.Framework.DynamicProxy
typeof(IAdvised).GetProperty("ExposeProxy", typeof(Boolean)).GetGetMethod();
public static readonly MethodInfo CountProperty =
typeof(ICollection).GetProperty("Count", typeof(Int32)).GetGetMethod();
typeof(System.Collections.ICollection).GetProperty("Count", typeof(Int32)).GetGetMethod();
}
#endregion
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright <EFBFBD> 2002-2011 the original author or authors.
* Copyright © 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -247,7 +247,7 @@ namespace Spring.Aop.Framework.DynamicProxy
get { return m_advised.Interfaces; }
}
IDictionary IAdvised.InterfaceMap
IDictionary<Type, object> IAdvised.InterfaceMap
{
get { return m_advised.InterfaceMap; }
}

View File

@@ -1,7 +1,7 @@
#region License
/*
* Copyright <EFBFBD> 2002-2011 the original author or authors.
* Copyright © 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,16 +18,12 @@
#endregion
#region Imports
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using Spring.Util;
#endregion
namespace Spring.Aop.Framework.DynamicProxy
{
/// <summary>
@@ -37,8 +33,6 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <author>Bruno Baia</author>
public class BaseAopProxyMethodBuilder : AbstractAopProxyMethodBuilder
{
#region Constructor(s) / Destructor
/// <summary>
/// Creates a new instance of the method builder.
/// </summary>
@@ -56,15 +50,11 @@ namespace Spring.Aop.Framework.DynamicProxy
/// </param>
public BaseAopProxyMethodBuilder(
TypeBuilder typeBuilder, IAopProxyTypeGenerator aopProxyGenerator,
IDictionary targetMethods, IDictionary onProxyTargetMethods)
IDictionary<string, MethodInfo> targetMethods, IDictionary<string, MethodInfo> onProxyTargetMethods)
: base(typeBuilder, aopProxyGenerator, false, targetMethods, onProxyTargetMethods)
{
}
#endregion
#region Protected Methods
/// <summary>
/// Create static field that will cache target method when defined on the proxy.
/// </summary>
@@ -101,7 +91,7 @@ namespace Spring.Aop.Framework.DynamicProxy
onProxyTargetMethods.Add(methodId, method);
onProxyTargetMethodCacheField = typeBuilder.DefineField(
methodId, typeof(MethodInfo), FieldAttributes.Private | FieldAttributes.Static | FieldAttributes.InitOnly);
methodId, typeof(MethodInfo), FieldAttributes.Private | FieldAttributes.Static);
MakeGenericMethod(il, method, onProxyTargetMethodCacheField, genericOnProxyTargetMethod);
}
@@ -120,7 +110,5 @@ namespace Spring.Aop.Framework.DynamicProxy
{
CallDirectBaseMethod(il, method);
}
#endregion
}
}

View File

@@ -18,18 +18,14 @@
#endregion
#region Imports
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.Serialization;
using Spring.Util;
#endregion
namespace Spring.Aop.Framework.DynamicProxy
{
/// <summary>
@@ -39,16 +35,10 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <author>Bruno Baia</author>
public class CompositionAopProxyTypeBuilder : AbstractAopProxyTypeBuilder
{
#region Fields
private const string PROXY_TYPE_NAME = "CompositionAopProxy";
private const string PROXY_TYPE_NAME = "CompositionAopProxy";
private readonly IAdvised advised;
#endregion
#region Constructor (s) / Destructor
/// <summary>
/// Creates a new instance of the
/// <see cref="CompositionAopProxyTypeBuilder"/> class.
@@ -65,17 +55,13 @@ namespace Spring.Aop.Framework.DynamicProxy
ProxyTargetAttributes = advised.ProxyTargetAttributes;
}
#endregion
#region IProxyTypeBuilder Members
/// <summary>
/// Creates the proxy type.
/// </summary>
/// <returns>The generated proxy type.</returns>
public override Type BuildProxyType()
{
IDictionary targetMethods = new Hashtable();
Dictionary<string, MethodInfo> targetMethods = new Dictionary<string, MethodInfo>();
TypeBuilder typeBuilder = CreateTypeBuilder(Name, BaseType);
@@ -93,11 +79,11 @@ namespace Spring.Aop.Framework.DynamicProxy
ImplementConstructors(typeBuilder);
// implement interfaces
IDictionary interfaceMap = advised.InterfaceMap;
IDictionary<Type, object> interfaceMap = advised.InterfaceMap;
foreach (Type intf in Interfaces)
{
object target = interfaceMap[intf];
if (target == null)
interfaceMap.TryGetValue(intf, out var target);
if (target is null)
{
// implement interface
ImplementInterface(typeBuilder,
@@ -112,24 +98,19 @@ namespace Spring.Aop.Framework.DynamicProxy
intf, TargetType);
}
}
Type proxyType;
proxyType = typeBuilder.CreateTypeInfo();
Type proxyType = typeBuilder.CreateTypeInfo();
// set target method references
foreach (DictionaryEntry entry in targetMethods)
foreach (KeyValuePair<string, MethodInfo> entry in targetMethods)
{
FieldInfo field = proxyType.GetField((string) entry.Key, BindingFlags.NonPublic | BindingFlags.Static);
FieldInfo field = proxyType.GetField(entry.Key, BindingFlags.NonPublic | BindingFlags.Static);
field.SetValue(proxyType, entry.Value);
}
return proxyType;
}
#endregion
#region IAopProxyTypeGenerator Members
/// <summary>
/// Generates the IL instructions that pushes
/// the current <see cref="Spring.Aop.Framework.DynamicProxy.AdvisedProxy"/>
@@ -141,10 +122,6 @@ namespace Spring.Aop.Framework.DynamicProxy
il.Emit(OpCodes.Ldarg_0);
}
#endregion
#region Protected Methods
/// <summary>
/// Implements serialization constructor.
/// </summary>
@@ -189,10 +166,6 @@ namespace Spring.Aop.Framework.DynamicProxy
il.Emit(OpCodes.Ret);
}
#endregion
#region Public Methods
/// <summary>
/// Determines if the specified <paramref name="type"/>
/// is one of those generated by this builder.
@@ -206,7 +179,5 @@ namespace Spring.Aop.Framework.DynamicProxy
{
return type.FullName.StartsWith(PROXY_TYPE_NAME);
}
#endregion
}
}
}

View File

@@ -1,7 +1,7 @@
#region License
/*
* Copyright <EFBFBD> 2002-2011 the original author or authors.
* Copyright © 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,10 +18,8 @@
#endregion
#region Imports
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.Serialization;
@@ -29,8 +27,6 @@ using System.Runtime.Serialization;
using Spring.Util;
using Spring.Proxy;
#endregion
namespace Spring.Aop.Framework.DynamicProxy
{
/// <summary>
@@ -39,8 +35,6 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <author>Bruno Baia</author>
public class DecoratorAopProxyTypeBuilder : AbstractAopProxyTypeBuilder
{
#region Fields
private const string PROXY_TYPE_NAME = "DecoratorAopProxy";
private IAdvised advised;
@@ -49,10 +43,6 @@ namespace Spring.Aop.Framework.DynamicProxy
/// AdvisedProxy instance calls should be delegated to.
/// </summary>
protected FieldBuilder advisedProxyField;
#endregion
#region Constructor (s) / Destructor
/// <summary>
/// Creates a new instance of the
@@ -82,17 +72,13 @@ namespace Spring.Aop.Framework.DynamicProxy
ProxyTargetAttributes = advised.ProxyTargetAttributes;
}
#endregion
#region IProxyTypeBuilder Members
/// <summary>
/// Creates the proxy type.
/// </summary>
/// <returns>The generated proxy class.</returns>
public override Type BuildProxyType()
{
IDictionary targetMethods = new Hashtable();
var targetMethods = new Dictionary<string, MethodInfo>();
TypeBuilder typeBuilder = CreateTypeBuilder(Name, BaseType);
@@ -115,11 +101,11 @@ namespace Spring.Aop.Framework.DynamicProxy
ImplementConstructors(typeBuilder);
// implement interfaces
IDictionary interfaceMap = advised.InterfaceMap;
var interfaceMap = advised.InterfaceMap;
foreach (Type intf in Interfaces)
{
object target = interfaceMap[intf];
if (target == null)
interfaceMap.TryGetValue(intf, out var target);
if (target is null)
{
// implement interface (proxy only final methods)
ImplementInterface(typeBuilder,
@@ -148,23 +134,18 @@ namespace Spring.Aop.Framework.DynamicProxy
// implement IAopProxy interface
ImplementIAopProxy(typeBuilder);
Type proxyType;
proxyType = typeBuilder.CreateTypeInfo();
Type proxyType = typeBuilder.CreateTypeInfo();
// set target method references
foreach (DictionaryEntry entry in targetMethods)
foreach (var entry in targetMethods)
{
FieldInfo field = proxyType.GetField((string)entry.Key, BindingFlags.NonPublic | BindingFlags.Static);
FieldInfo field = proxyType.GetField(entry.Key, BindingFlags.NonPublic | BindingFlags.Static);
field.SetValue(proxyType, entry.Value);
}
return proxyType;
}
#endregion
#region IAopProxyTypeGenerator Members
/// <summary>
/// Generates the IL instructions that pushes
/// the current <see cref="Spring.Aop.Framework.DynamicProxy.AdvisedProxy"/>
@@ -177,10 +158,6 @@ namespace Spring.Aop.Framework.DynamicProxy
il.Emit(OpCodes.Ldfld, advisedProxyField);
}
#endregion
#region Protected Methods
/// <summary>
/// Declares field that holds the <see cref="Spring.Aop.Framework.DynamicProxy.AdvisedProxy"/>
/// instance used by the proxy.
@@ -293,10 +270,6 @@ namespace Spring.Aop.Framework.DynamicProxy
typeBuilder.DefineMethodOverride(mb, getProxyMethod);
}
#endregion
#region Public Methods
/// <summary>
/// Determines if the specified <paramref name="type"/>
/// is one of those generated by this builder.
@@ -310,7 +283,5 @@ namespace Spring.Aop.Framework.DynamicProxy
{
return type.FullName.StartsWith(PROXY_TYPE_NAME);
}
#endregion
}
}

View File

@@ -1,7 +1,7 @@
#region License
/*
* Copyright <EFBFBD> 2002-2011 the original author or authors.
* Copyright © 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,10 +18,8 @@
#endregion
#region Imports
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Reflection;
using System.Reflection.Emit;
@@ -29,8 +27,6 @@ using System.Reflection.Emit;
using Spring.Proxy;
using Spring.Util;
#endregion
namespace Spring.Aop.Framework.DynamicProxy
{
/// <summary>
@@ -39,8 +35,6 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <author>Bruno Baia</author>
public class InheritanceAopProxyTypeBuilder : AbstractAopProxyTypeBuilder
{
#region Fields
private const string PROXY_TYPE_NAME = "InheritanceAopProxy";
private IAdvised advised;
@@ -49,11 +43,7 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <summary>
/// AdvisedProxy instance calls should be delegated to.
/// </summary>
protected FieldBuilder advisedProxyField;
#endregion
#region Properties
protected FieldBuilder advisedProxyField;
/// <summary>
/// Gets or sets a value indicating whether inherited members should be proxied.
@@ -68,10 +58,6 @@ namespace Spring.Aop.Framework.DynamicProxy
set { proxyDeclaredMembersOnly = value; }
}
#endregion
#region Constructor (s) / Destructor
/// <summary>
/// Creates a new instance of the
/// <see cref="CompositionAopProxyTypeBuilder"/> class.
@@ -100,18 +86,14 @@ namespace Spring.Aop.Framework.DynamicProxy
ProxyTargetAttributes = advised.ProxyTargetAttributes;
}
#endregion
#region IProxyTypeBuilder Members
/// <summary>
/// Creates the proxy type.
/// </summary>
/// <returns>The generated proxy class.</returns>
public override Type BuildProxyType()
{
IDictionary targetMethods = new Hashtable();
IDictionary proxyMethods = new Hashtable();
var targetMethods = new Dictionary<string, MethodInfo>();
var proxyMethods = new Dictionary<string, MethodInfo>();
TypeBuilder typeBuilder = CreateTypeBuilder(Name, BaseType);
@@ -134,7 +116,7 @@ namespace Spring.Aop.Framework.DynamicProxy
ImplementConstructors(typeBuilder);
// implement interfaces
IDictionary interfaceMap = advised.InterfaceMap;
var interfaceMap = advised.InterfaceMap;
foreach (Type intf in Interfaces)
{
object target = interfaceMap[intf];
@@ -171,27 +153,23 @@ namespace Spring.Aop.Framework.DynamicProxy
proxyType = typeBuilder.CreateTypeInfo();
// set target method references
foreach (DictionaryEntry entry in targetMethods)
foreach (var entry in targetMethods)
{
FieldInfo field = proxyType.GetField((string)entry.Key, BindingFlags.NonPublic | BindingFlags.Static);
FieldInfo field = proxyType.GetField(entry.Key, BindingFlags.NonPublic | BindingFlags.Static);
field.SetValue(proxyType, entry.Value);
}
// set proxy method references
foreach (DictionaryEntry entry in proxyMethods)
foreach (var entry in proxyMethods)
{
FieldInfo field = proxyType.GetField((string)entry.Key, BindingFlags.NonPublic | BindingFlags.Static);
MethodInfo proxyMethod = proxyType.GetMethod("proxy_" + (string)entry.Key, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
FieldInfo field = proxyType.GetField(entry.Key, BindingFlags.NonPublic | BindingFlags.Static);
MethodInfo proxyMethod = proxyType.GetMethod("proxy_" + entry.Key, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
field.SetValue(proxyType, proxyMethod);
}
return proxyType;
}
#endregion
#region IAopProxyTypeGenerator Members
/// <summary>
/// Generates the IL instructions that pushes
/// the target instance on which calls should be delegated to.
@@ -214,10 +192,6 @@ namespace Spring.Aop.Framework.DynamicProxy
il.Emit(OpCodes.Ldfld, advisedProxyField);
}
#endregion
#region Protected Methods
/// <summary>
/// Declares field that holds the <see cref="Spring.Aop.Framework.DynamicProxy.AdvisedProxy"/>
/// instance used by the proxy.
@@ -346,10 +320,6 @@ namespace Spring.Aop.Framework.DynamicProxy
typeBuilder.DefineMethodOverride(mb, getProxyMethod);
}
#endregion
#region Public Methods
/// <summary>
/// Determines if the specified <paramref name="type"/>
/// is one of those generated by this builder.
@@ -363,7 +333,5 @@ namespace Spring.Aop.Framework.DynamicProxy
{
return type.FullName.StartsWith(PROXY_TYPE_NAME);
}
#endregion
}
}

View File

@@ -1,7 +1,7 @@
#region License
/*
* Copyright <EFBFBD> 2002-2011 the original author or authors.
* Copyright © 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,14 +18,10 @@
#endregion
#region Imports
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
#endregion
namespace Spring.Aop.Framework.DynamicProxy
{
/// <summary>
@@ -36,17 +32,11 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <author>Bruno Baia</author>
public class IntroductionProxyMethodBuilder : AbstractAopProxyMethodBuilder
{
#region Fields
/// <summary>
/// The index of the introduction to delegate call to.
/// </summary>
protected int index;
#endregion
#region Constructor(s) / Destructor
/// <summary>
/// Creates a new instance of the method builder.
/// </summary>
@@ -60,16 +50,12 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <param name="index">index of the introduction to delegate call to</param>
public IntroductionProxyMethodBuilder(
TypeBuilder typeBuilder, IAopProxyTypeGenerator aopProxyGenerator,
IDictionary targetMethods, int index)
IDictionary<string, MethodInfo> targetMethods, int index)
: base(typeBuilder, aopProxyGenerator, true, targetMethods)
{
this.index = index;
}
#endregion
#region Protected Methods
/// <summary>
/// Generates the IL instructions that pushes
/// the introduction type on stack.
@@ -107,7 +93,5 @@ namespace Spring.Aop.Framework.DynamicProxy
{
CallDirectTargetMethod(il, interfaceMethod);
}
#endregion
}
}

View File

@@ -1,7 +1,7 @@
#region License
/*
* Copyright <EFBFBD> 2002-2011 the original author or authors.
* Copyright © 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,14 +18,10 @@
#endregion
#region Imports
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
#endregion
namespace Spring.Aop.Framework.DynamicProxy
{
/// <summary>
@@ -36,17 +32,11 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <author>Bruno Baia</author>
public class TargetAopProxyMethodBuilder : AbstractAopProxyMethodBuilder
{
#region Fields
/// <summary>
/// The local variable to store the target instance.
/// </summary>
protected LocalBuilder target;
#endregion
#region Constructor(s) / Destructor
/// <summary>
/// Creates a new instance of the method builder.
/// </summary>
@@ -63,15 +53,11 @@ namespace Spring.Aop.Framework.DynamicProxy
/// <see cref="System.Reflection.MethodInfo"/>s.
/// </param>
public TargetAopProxyMethodBuilder(TypeBuilder typeBuilder,
IAopProxyTypeGenerator aopProxyGenerator, bool explicitImplementation, IDictionary targetMethods)
IAopProxyTypeGenerator aopProxyGenerator, bool explicitImplementation, IDictionary<string, MethodInfo> targetMethods)
: base(typeBuilder, aopProxyGenerator, explicitImplementation, targetMethods)
{
}
#endregion
#region Protected Methods
/// <summary>
/// Creates local variable declarations.
/// </summary>
@@ -137,7 +123,5 @@ namespace Spring.Aop.Framework.DynamicProxy
else
CallDirectTargetMethod(il, method);
}
#endregion
}
}

View File

@@ -1,7 +1,7 @@
#region License
/*
* Copyright <EFBFBD> 2002-2011 the original author or authors.
* Copyright © 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,18 +18,13 @@
#endregion
#region Imports
using System;
using System.Collections;
using System.Collections.Generic;
using AopAlliance.Aop;
using Spring.Proxy;
#endregion
namespace Spring.Aop.Framework
{
/// <summary>
@@ -148,7 +143,7 @@ namespace Spring.Aop.Framework
/// The mapping of the proxied interface
/// <see cref="System.Type"/>s to their delegates.
/// </value>
IDictionary InterfaceMap { get; }
IDictionary<Type, object> InterfaceMap { get; }
/// <summary>
/// Is this configuration frozen?

View File

@@ -163,7 +163,7 @@ namespace Spring.Context.Attributes
// declare interceptor field
interceptorField = typeBuilder.DefineField("__Interceptor", typeof(IConfigurationClassInterceptor),
FieldAttributes.Private | FieldAttributes.Static | FieldAttributes.InitOnly);
FieldAttributes.Private | FieldAttributes.Static);
// create constructors
ImplementConstructors(typeBuilder);
@@ -235,7 +235,7 @@ namespace Spring.Context.Attributes
string methodId = "_m" + Guid.NewGuid().ToString("N");
targetMethods.Add(methodId, method);
FieldBuilder targetMethodCacheField = typeBuilder.DefineField(methodId, typeof(MethodInfo),
FieldAttributes.Private | FieldAttributes.Static | FieldAttributes.InitOnly);
FieldAttributes.Private | FieldAttributes.Static);
// Call IConfigurationClassInterceptor.TryGetObject method
il.Emit(OpCodes.Ldnull);

View File

@@ -1,7 +1,7 @@
#region License
/*
* Copyright <EFBFBD> 2002-2011 the original author or authors.
* Copyright © 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;$(TargetFullFrameworkVersion)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Aop\Spring.Aop.csproj" />
@@ -16,7 +16,7 @@
<ItemGroup Condition=" '$(TargetFramework)' == '$(TargetFullFrameworkVersion)' ">
<Reference Include="System.Web" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
<Compile Remove="Aop\Framework\AutoProxy\AbstractAutoProxyCreatorTests.cs" />
<Compile Remove="Aop\Framework\Adapter\ThrowsAdviceInterceptorTests.cs" />
<Compile Remove="Aop\Framework\AutoProxy\AbstractAutoProxyCreatorTests.cs" />

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net472;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
<RootNamespace>Spring.Benchmark</RootNamespace>
</PropertyGroup>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;$(TargetFullFrameworkVersion)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Aop\Spring.Aop.csproj" />
@@ -30,7 +30,7 @@
<Reference Include="System.Web.Services" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
<Compile Remove="Context\Attributes\FailAssemblyObjectDefinitionScannerTests.cs" />
<Compile Remove="Context\Support\ApplicationContextAwareProcessorTests.cs" />
<Compile Remove="Expressions\ExpressionEvaluatorTests.cs" />
@@ -40,6 +40,7 @@
<Compile Remove="SecurityTemplate.cs" />
<Compile Remove="Threading\CallContextStorageTests.cs" />
<Compile Remove="Util\ObjectUtilsTests.cs" />
<PackageReference Include="System.Resources.Extensions" Version="4.6.0" />
</ItemGroup>
<ItemGroup>
<Content Include="App.config">

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;$(TargetFullFrameworkVersion)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Aop\Spring.Aop.csproj" />
@@ -21,8 +21,8 @@
<Reference Include="System.Data.OracleClient" />
<Reference Include="System.Transactions" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" Condition=" '$(TargetFramework)' == 'netcoreapp2.1' " />
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" Condition=" '$(TargetFramework)' == 'netcoreapp3.0' " />
<Compile Remove="Data\SQLiteTests.cs" />
<Compile Remove="Data\OracleAdoTemplateTests.cs" />
</ItemGroup>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Aop\Spring.Aop.csproj" />
@@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftTestSDKVersion)" />
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" Condition=" '$(TargetFramework)' == 'netcoreapp2.1' " />
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" Condition=" '$(TargetFramework)' == 'netcoreapp3.0' " />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == '$(TargetFullFrameworkVersion)' ">
<Reference Include="System.Transactions" />

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Spring.Data.Tests\Spring.Data.Tests.csproj" />

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;$(TargetFullFrameworkVersion)</TargetFrameworks>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
</PropertyGroup>
<ItemGroup>
@@ -22,8 +22,8 @@
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" Condition=" '$(TargetFramework)' == 'netcoreapp2.1' " />
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" Condition=" '$(TargetFramework)' == 'netcoreapp3.0' " />
<Compile Remove="Data\Core\ServiceDomainTransactionManagerTests.cs" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,14 +0,0 @@
<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Apache.NMS" publicKeyToken="82756FEEE3957618" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.3.0.1959" newVersion="1.3.0.1959"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;net452</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.csproj" />

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;net452</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.csproj" />

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;$(TargetFullFrameworkVersion)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.csproj" />

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;$(TargetFullFrameworkVersion)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.csproj" />

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;$(TargetFullFrameworkVersion)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.csproj" />