diff --git a/.circleci/config.yml b/.circleci/config.yml index c1ed98c6f..eb4f54b29 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,6 @@ jobs: - run: dotnet restore NEsperAll.sln - run: msbuild NEsper.proj - store_artifacts: - path: build/NEsper-8.5.6.zip + path: build/NEsper-8.5.7.zip - store_artifacts: path: build/packages diff --git a/Directory.Build.props b/Directory.Build.props index e85761f59..cf3682458 100755 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -18,7 +18,7 @@ - 8.5.6 + 8.5.7 @@ -46,6 +46,11 @@ $(DefineConstants);NETCORE; + + true + $(DefineConstants);NETCORE;NET5;NET6;NET7; + + true $(DefineConstants);NETCORE;NET5;NET6; diff --git a/NEsper.Documentation/NEsper.Documentation.shfbproj b/NEsper.Documentation/NEsper.Documentation.shfbproj index 4078d42fe..12645dc7e 100755 --- a/NEsper.Documentation/NEsper.Documentation.shfbproj +++ b/NEsper.Documentation/NEsper.Documentation.shfbproj @@ -16,7 +16,7 @@ NEsper.Documentation .NET Framework 4.6.2 - ..\build\NEsper-8.5.6\docs\ + ..\build\NEsper-8.5.7\docs\ NEsper en-US diff --git a/NEsper.nuspec b/NEsper.nuspec index 5314efaa0..865744013 100755 --- a/NEsper.nuspec +++ b/NEsper.nuspec @@ -2,7 +2,7 @@ NEsper - 8.5.6 + 8.5.7 EsperTech EsperTech en-us @@ -27,7 +27,7 @@ - + diff --git a/NEsper.proj b/NEsper.proj index 66d55c739..2ec4e6ff6 100755 --- a/NEsper.proj +++ b/NEsper.proj @@ -8,7 +8,7 @@ $(MSBuildProjectDirectory) $(CCNetLabel) - 8.5.6 + 8.5.7 $(MSBuildProjectDirectory)\build diff --git a/buildspec.yml b/buildspec.yml index 38100b64d..1a6b9fe24 100755 --- a/buildspec.yml +++ b/buildspec.yml @@ -4,7 +4,7 @@ env: variables: MASTER_PROJECT: .\NEsper.proj PACKAGE_DIRECTORY: .\packages - VERSION: 8.5.6 + VERSION: 8.5.7 phases: build: diff --git a/src/NEsper.Common/common/client/artifact/ArtifactRepositoryAssemblyLoadContext.cs b/src/NEsper.Common/common/client/artifact/ArtifactRepositoryAssemblyLoadContext.cs index fbbfd3883..83c535002 100755 --- a/src/NEsper.Common/common/client/artifact/ArtifactRepositoryAssemblyLoadContext.cs +++ b/src/NEsper.Common/common/client/artifact/ArtifactRepositoryAssemblyLoadContext.cs @@ -10,20 +10,20 @@ using com.espertech.esper.compat.function; using com.espertech.esper.compat.logging; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Reflection; using System.Runtime.Loader; #endif namespace com.espertech.esper.common.client.artifact { -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER public class ArtifactRepositoryAssemblyLoadContext : BaseArtifactRepository, IDisposable { private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private AssemblyLoadContext _assemblyLoadContext; - private TypeResolver _typeResolver; + private readonly TypeResolver _typeResolver; /// /// Returns the assembly load context @@ -34,10 +34,14 @@ public class ArtifactRepositoryAssemblyLoadContext : BaseArtifactRepository, IDi /// Constructor. /// /// - public ArtifactRepositoryAssemblyLoadContext(TypeResolver parentTypeResolver) + /// + public ArtifactRepositoryAssemblyLoadContext( + TypeResolver parentTypeResolver, + AssemblyResolver assemblyResolver) { _assemblyLoadContext = CreateAssemblyLoadContext( this, + assemblyResolver, "default-artifact-repository-assembly-load-context", true); _typeResolver = new ArtifactTypeResolver(this, parentTypeResolver); @@ -48,12 +52,15 @@ public ArtifactRepositoryAssemblyLoadContext(TypeResolver parentTypeResolver) /// /// /// + /// public ArtifactRepositoryAssemblyLoadContext( string deploymentId, - TypeResolver parentTypeResolver) + TypeResolver parentTypeResolver, + AssemblyResolver assemblyResolver) { _assemblyLoadContext = CreateAssemblyLoadContext( this, + assemblyResolver, "artifact-repository-assembly-load-context-" + deploymentId, true); _typeResolver = new ArtifactTypeResolver(this, parentTypeResolver); @@ -93,6 +100,7 @@ protected override Supplier MaterializeAssemblySupplier(byte[] image) public static AssemblyLoadContext CreateAssemblyLoadContext( IArtifactRepository repository, + AssemblyResolver assemblyResolver, string contextName, bool isCollectable) { @@ -105,6 +113,10 @@ public static AssemblyLoadContext CreateAssemblyLoadContext( var assemblyBaseName = assemblyName.Name; var artifact = repositoryInstance.Resolve(assemblyBaseName); var assembly = artifact?.Assembly; + if (assembly == null) { + assembly = assemblyResolver?.Invoke(assemblyName); + } + return assembly; } diff --git a/src/NEsper.Common/common/client/artifact/ArtifactRepositoryExtensions.cs b/src/NEsper.Common/common/client/artifact/ArtifactRepositoryExtensions.cs index a2917689f..a844aebdd 100755 --- a/src/NEsper.Common/common/client/artifact/ArtifactRepositoryExtensions.cs +++ b/src/NEsper.Common/common/client/artifact/ArtifactRepositoryExtensions.cs @@ -4,7 +4,7 @@ using com.espertech.esper.compat; using com.espertech.esper.compat.collections; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; #endif @@ -32,10 +32,10 @@ public static IArtifactRepositoryManager GetDefaultArtifactRepositoryManager(ICo var baseTypeResolver = container.Has() ? container.Resolve() : TypeResolverDefault.INSTANCE; - return new DefaultArtifactRepositoryManager(baseTypeResolver); + var assemblyResolver = container.Has() + ? container.Resolve() + : null; + return new DefaultArtifactRepositoryManager(baseTypeResolver, assemblyResolver); } - -#if NETCORE -#endif } } \ No newline at end of file diff --git a/src/NEsper.Common/common/client/artifact/BaseArtifactRepository.cs b/src/NEsper.Common/common/client/artifact/BaseArtifactRepository.cs index d7cf1be36..f56051d12 100755 --- a/src/NEsper.Common/common/client/artifact/BaseArtifactRepository.cs +++ b/src/NEsper.Common/common/client/artifact/BaseArtifactRepository.cs @@ -10,7 +10,7 @@ using Microsoft.CodeAnalysis; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; #endif diff --git a/src/NEsper.Common/common/client/artifact/DefaultArtifactRepositoryManager.cs b/src/NEsper.Common/common/client/artifact/DefaultArtifactRepositoryManager.cs index a24529f56..bcd1b9fcb 100755 --- a/src/NEsper.Common/common/client/artifact/DefaultArtifactRepositoryManager.cs +++ b/src/NEsper.Common/common/client/artifact/DefaultArtifactRepositoryManager.cs @@ -5,13 +5,11 @@ using com.espertech.esper.compat; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; #endif -using com.espertech.esper.compat.collections; using com.espertech.esper.compat.logging; -using com.espertech.esper.container; namespace com.espertech.esper.common.client.artifact { @@ -21,14 +19,23 @@ public class DefaultArtifactRepositoryManager : IArtifactRepositoryManager, IDis private readonly IDictionary _repositoryTable; private readonly TypeResolver _parentTypeResolver; + private readonly AssemblyResolver _assemblyResolver; +#if NETCOREAPP3_0_OR_GREATER + public DefaultArtifactRepositoryManager( + TypeResolver parentTypeResolver, + AssemblyResolver assemblyResolver) +#else public DefaultArtifactRepositoryManager(TypeResolver parentTypeResolver) +#endif { _parentTypeResolver = parentTypeResolver; + _assemblyResolver = assemblyResolver; _repositoryTable = new Dictionary(); - -#if NETCORE - DefaultRepository = new ArtifactRepositoryAssemblyLoadContext(_parentTypeResolver); + +#if NETCOREAPP3_0_OR_GREATER + DefaultRepository = new ArtifactRepositoryAssemblyLoadContext( + _parentTypeResolver, _assemblyResolver); #else DefaultRepository = new ArtifactRepositoryAppDomain(AppDomain.CurrentDomain); #endif @@ -66,8 +73,11 @@ public IArtifactRepository GetArtifactRepository(string deploymentId, bool creat { lock (_repositoryTable) { if (!_repositoryTable.TryGetValue(deploymentId, out var artifactRepository) && createIfMissing) { -#if NETCORE - artifactRepository = new ArtifactRepositoryAssemblyLoadContext(deploymentId, _parentTypeResolver); +#if NETCOREAPP3_0_OR_GREATER + artifactRepository = new ArtifactRepositoryAssemblyLoadContext( + deploymentId, + _parentTypeResolver, + _assemblyResolver); #else artifactRepository = new ArtifactRepositoryAppDomain(AppDomain.CurrentDomain); #endif diff --git a/src/NEsper.Common/common/client/artifact/MetadataReferenceProvider.cs b/src/NEsper.Common/common/client/artifact/MetadataReferenceProvider.cs new file mode 100755 index 000000000..8d1584087 --- /dev/null +++ b/src/NEsper.Common/common/client/artifact/MetadataReferenceProvider.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +using com.espertech.esper.common.@internal.util; +using com.espertech.esper.compat; +using com.espertech.esper.compat.collections; + +#if NETCOREAPP3_0_OR_GREATER +using System.Runtime.Loader; +#endif + +using com.espertech.esper.container; + +using Microsoft.CodeAnalysis; + +namespace com.espertech.esper.common.client.artifact +{ + public delegate IEnumerable MetadataReferenceProvider(); +} \ No newline at end of file diff --git a/src/NEsper.Common/common/client/artifact/MetadataReferenceProviderExtensions.cs b/src/NEsper.Common/common/client/artifact/MetadataReferenceProviderExtensions.cs new file mode 100755 index 000000000..3e664def3 --- /dev/null +++ b/src/NEsper.Common/common/client/artifact/MetadataReferenceProviderExtensions.cs @@ -0,0 +1,32 @@ +using System; + +using com.espertech.esper.common.@internal.util; +using com.espertech.esper.compat; +using com.espertech.esper.compat.collections; + +#if NETCOREAPP3_0_OR_GREATER +using System.Runtime.Loader; +#endif + +using com.espertech.esper.container; + +using Microsoft.CodeAnalysis; + +namespace com.espertech.esper.common.client.artifact +{ + public static class MetadataReferenceProviderExtensions + { + public static MetadataReferenceProvider MetadataReferenceProvider(this IContainer container) + { + container.CheckContainer(); + + lock (container) { + if (container.DoesNotHave()) { + container.Register(Array.Empty, Lifespan.Singleton); + } + } + + return container.Resolve(); + } + } +} \ No newline at end of file diff --git a/src/NEsper.Common/common/client/artifact/MetadataReferenceResolver.cs b/src/NEsper.Common/common/client/artifact/MetadataReferenceResolver.cs new file mode 100755 index 000000000..83c6a8a3a --- /dev/null +++ b/src/NEsper.Common/common/client/artifact/MetadataReferenceResolver.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Reflection; + +using com.espertech.esper.common.@internal.util; +using com.espertech.esper.compat; +using com.espertech.esper.compat.collections; + +#if NETCOREAPP3_0_OR_GREATER +using System.Runtime.Loader; +#endif + +using com.espertech.esper.container; + +using Microsoft.CodeAnalysis; + +namespace com.espertech.esper.common.client.artifact +{ + public delegate MetadataReference MetadataReferenceResolver(Assembly assembly); +} \ No newline at end of file diff --git a/src/NEsper.Common/common/client/artifact/MetadataReferenceResolverExtensions.cs b/src/NEsper.Common/common/client/artifact/MetadataReferenceResolverExtensions.cs new file mode 100755 index 000000000..cd32fe491 --- /dev/null +++ b/src/NEsper.Common/common/client/artifact/MetadataReferenceResolverExtensions.cs @@ -0,0 +1,41 @@ +using System.Reflection; + +using com.espertech.esper.container; + +using Microsoft.CodeAnalysis; + +namespace com.espertech.esper.common.client.artifact +{ + public static class MetadataReferenceResolverExtensions + { + /// + /// Gets a metadata reference from an assembly. This method provides no caching of the metadata + /// reference. + /// + /// + /// a metadata reference for the requested assembly + public static MetadataReference GetMetadataReference(Assembly assembly) + { + return string.IsNullOrEmpty(assembly.Location) ? null : MetadataReference.CreateFromFile(assembly.Location); + } + + /// + /// Retrieves an instance of the MetadataReferenceResolver. If none has been registered, this method + /// will return the default resolver. + /// + /// + /// + public static MetadataReferenceResolver MetadataReferenceResolver(this IContainer container) + { + container.CheckContainer(); + + lock (container) { + if (container.DoesNotHave()) { + return GetMetadataReference; + } + } + + return container.Resolve(); + } + } +} \ No newline at end of file diff --git a/src/NEsper.Common/common/client/configuration/compiler/ConfigurationCompiler.cs b/src/NEsper.Common/common/client/configuration/compiler/ConfigurationCompiler.cs index 0481ff0f8..50aeeb145 100644 --- a/src/NEsper.Common/common/client/configuration/compiler/ConfigurationCompiler.cs +++ b/src/NEsper.Common/common/client/configuration/compiler/ConfigurationCompiler.cs @@ -106,7 +106,7 @@ public ConfigurationCompiler() /// /// Returns true if the compiler should set optimization to debug. /// - public bool IsDebugOptimization { get; private set; } + public bool IsDebugOptimization { get; set; } /// /// Returns the expression-related settings for compiler. diff --git a/src/NEsper.Common/common/internal/context/controller/hash/ContextControllerHashedGetterCRC32SerializedForge.cs b/src/NEsper.Common/common/internal/context/controller/hash/ContextControllerHashedGetterCRC32SerializedForge.cs index f22b300e1..1d7e520f4 100644 --- a/src/NEsper.Common/common/internal/context/controller/hash/ContextControllerHashedGetterCRC32SerializedForge.cs +++ b/src/NEsper.Common/common/internal/context/controller/hash/ContextControllerHashedGetterCRC32SerializedForge.cs @@ -19,6 +19,7 @@ using com.espertech.esper.common.@internal.util; using com.espertech.esper.compat; using com.espertech.esper.compat.logging; +using com.espertech.esper.container; using static com.espertech.esper.common.@internal.bytecodemodel.model.expression.CodegenExpressionBuilder; @@ -48,17 +49,38 @@ public ContextControllerHashedGetterCRC32SerializedForge( /// serializers /// hash public static int SerializeAndCRC32Hash( + IContainer container, + object objectMayArray, + int granularity, + Serializer[] serializers) + { + return SerializeAndCRC32Hash( + SerializerFactory.Instance, + objectMayArray, + granularity, + serializers); + } + + /// + /// NOTE: Code-generation-invoked method, method name and parameter order matters + /// + /// value + /// granularity + /// serializers + /// hash + public static int SerializeAndCRC32Hash( + SerializerFactory serializerFactory, object objectMayArray, int granularity, Serializer[] serializers) { byte[] bytes; try { - if (objectMayArray is object[]) { - bytes = SerializerFactory.Serialize(serializers, (object[]) objectMayArray); + if (objectMayArray is object[] objectArray) { + bytes = serializerFactory.Serialize(serializers, objectArray); } else { - bytes = SerializerFactory.Serialize(serializers[0], objectMayArray); + bytes = serializerFactory.Serialize(serializers[0], objectMayArray); } } catch (IOException e) { @@ -83,8 +105,8 @@ public CodegenExpression EventBeanGetCodegen( var serializers = classScope.AddDefaultFieldUnshared( true, typeof(Serializer[]), - StaticMethod( - typeof(SerializerFactory), + ExprDotMethod( + EnumValue(typeof(SerializerFactory), "Instance"), "GetSerializers", Constant(ExprNodeUtilityQuery.GetExprResultTypes(nodes)))); @@ -133,6 +155,7 @@ public CodegenExpression EventBeanGetCodegen( StaticMethod( typeof(ContextControllerHashedGetterCRC32SerializedForge), "SerializeAndCRC32Hash", + EnumValue(typeof(SerializerFactory), "Instance"), Ref("values"), Constant(granularity), serializers)); diff --git a/src/NEsper.Common/common/internal/epl/fafquery/querymethod/FAFQueryMethodSelectExecNoContextJoin.cs b/src/NEsper.Common/common/internal/epl/fafquery/querymethod/FAFQueryMethodSelectExecNoContextJoin.cs index 95f1dae94..7cc62a151 100644 --- a/src/NEsper.Common/common/internal/epl/fafquery/querymethod/FAFQueryMethodSelectExecNoContextJoin.cs +++ b/src/NEsper.Common/common/internal/epl/fafquery/querymethod/FAFQueryMethodSelectExecNoContextJoin.cs @@ -19,6 +19,7 @@ using com.espertech.esper.common.@internal.epl.resultset.core; using com.espertech.esper.common.@internal.@event.core; using com.espertech.esper.common.@internal.view.core; +using com.espertech.esper.compat.collections; using static com.espertech.esper.common.@internal.epl.fafquery.querymethod.FAFQueryMethodSelectExecUtil; @@ -90,7 +91,10 @@ public EPPreparedQueryResult Execute( agentInstanceContext); } - UniformPair results = resultSetProcessor.ProcessJoinResult(result.First, null, true); + UniformPair results = resultSetProcessor.ProcessJoinResult( + result.First, + EmptySet>.Instance, + true); EventBean[] distinct = EventBeanUtility.GetDistinctByProp(results?.First, select.DistinctKeyGetter); diff --git a/src/NEsper.Common/common/internal/epl/join/base/JoinSetComposerPrototypeGeneral.cs b/src/NEsper.Common/common/internal/epl/join/base/JoinSetComposerPrototypeGeneral.cs index 9cfc8380a..b6f5c155a 100644 --- a/src/NEsper.Common/common/internal/epl/join/base/JoinSetComposerPrototypeGeneral.cs +++ b/src/NEsper.Common/common/internal/epl/join/base/JoinSetComposerPrototypeGeneral.cs @@ -112,7 +112,7 @@ public override JoinSetComposerDesc Create( streamJoinAnalysisResult, agentInstanceContext); if (virtualDWView != null) { - index = VirtualDWQueryPlanUtil.GetJoinIndexTable(items.Get(entry.Key), virtualDWView); + index = VirtualDWQueryPlanUtil.GetJoinIndexTable(items.Get(entry.Key)); } else { index = EventTableUtil.BuildIndex( diff --git a/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWEventTable.cs b/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWEventTable.cs index dffc3d6c1..0f86ba150 100644 --- a/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWEventTable.cs +++ b/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWEventTable.cs @@ -24,14 +24,12 @@ public VirtualDWEventTable( bool unique, IList hashAccess, IList btreeAccess, - EventTableOrganization organization, - VirtualDWView virtualDwViewMayNull) + EventTableOrganization organization) { IsUnique = unique; HashAccess = Collections.ReadonlyList(hashAccess); BtreeAccess = Collections.ReadonlyList(btreeAccess); Organization = organization; - VirtualDWViewMayNull = virtualDwViewMayNull; } public IList HashAccess { get; } @@ -80,9 +78,7 @@ public IEnumerator GetEnumerator() IEnumerator IEnumerable.GetEnumerator() { - return VirtualDWViewMayNull != null - ? VirtualDWViewMayNull.VirtualDataWindow.GetEnumerator() - : GetEnumerator(); + return EnumerationHelper.Empty(); } public bool IsEmpty => true; diff --git a/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWQueryPlanUtil.cs b/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWQueryPlanUtil.cs index a5cfa924b..eb35166bd 100644 --- a/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWQueryPlanUtil.cs +++ b/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWQueryPlanUtil.cs @@ -25,8 +25,7 @@ public class VirtualDWQueryPlanUtil public static Pair GetSubordinateQueryDesc( bool unique, IndexedPropDesc[] hashedProps, - IndexedPropDesc[] btreeProps, - VirtualDWView virtualDWView) + IndexedPropDesc[] btreeProps) { IList hashFields = new List(); foreach (var hashprop in hashedProps) { @@ -43,12 +42,12 @@ public static Pair GetSubordinateQueryDesc( new VirtualDataWindowLookupFieldDesc(btreeprop.IndexPropName, null, btreeprop.CoercionType)); } - var eventTable = new VirtualDWEventTable(unique, hashFields, btreeFields, TABLE_ORGANIZATION, virtualDWView); + var eventTable = new VirtualDWEventTable(unique, hashFields, btreeFields, TABLE_ORGANIZATION); var imk = new IndexMultiKey(unique, hashedProps, btreeProps, null); return new Pair(imk, eventTable); } - public static EventTable GetJoinIndexTable(QueryPlanIndexItem queryPlanIndexItem, VirtualDWView virtualDWView) + public static EventTable GetJoinIndexTable(QueryPlanIndexItem queryPlanIndexItem) { IList hashFields = new List(); var count = 0; @@ -78,7 +77,7 @@ public static EventTable GetJoinIndexTable(QueryPlanIndexItem queryPlanIndexItem } } - return new VirtualDWEventTable(false, hashFields, btreeFields, TABLE_ORGANIZATION, virtualDWView); + return new VirtualDWEventTable(false, hashFields, btreeFields, TABLE_ORGANIZATION); } public static Pair GetFireAndForgetDesc( @@ -100,7 +99,7 @@ public static Pair GetFireAndForgetDesc( btreeIndexedFields.Add(new IndexedPropDesc(btreeprop, eventType.GetPropertyType(btreeprop))); } - var noopTable = new VirtualDWEventTable(false, hashFields, btreeFields, TABLE_ORGANIZATION, null); + var noopTable = new VirtualDWEventTable(false, hashFields, btreeFields, TABLE_ORGANIZATION); var imk = new IndexMultiKey(false, hashIndexedFields, btreeIndexedFields, null); return new Pair(imk, noopTable); diff --git a/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWViewImpl.cs b/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWViewImpl.cs index 7e910d149..a42c7cb42 100644 --- a/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWViewImpl.cs +++ b/src/NEsper.Common/common/internal/epl/virtualdw/VirtualDWViewImpl.cs @@ -87,8 +87,7 @@ public SubordTableLookupStrategy GetSubordinateLookupStrategy( Pair tableVW = VirtualDWQueryPlanUtil.GetSubordinateQueryDesc( false, subordTableFactory.IndexHashedProps, - subordTableFactory.IndexBtreeProps, - this); + subordTableFactory.IndexBtreeProps); VirtualDWEventTable noopTable = tableVW.Second; for (int i = 0; i < noopTable.BtreeAccess.Count; i++) { string opRange = subordTableFactory.RangeEvals[i].Type.StringOp(); diff --git a/src/NEsper.Common/common/internal/event/map/MapEventBeanArrayPropertyGetter.cs b/src/NEsper.Common/common/internal/event/map/MapEventBeanArrayPropertyGetter.cs index 602d79343..5bac20c79 100644 --- a/src/NEsper.Common/common/internal/event/map/MapEventBeanArrayPropertyGetter.cs +++ b/src/NEsper.Common/common/internal/event/map/MapEventBeanArrayPropertyGetter.cs @@ -38,9 +38,6 @@ public MapEventBeanArrayPropertyGetter( { this.propertyName = propertyName; this.underlyingType = underlyingType; - if (underlyingType.Name == "MyEvent") { - Console.WriteLine("MapEventBeanArrayPropertyGetter: ctor"); - } } public object GetMap(IDictionary map) diff --git a/src/NEsper.Common/common/internal/util/AssemblyLoadContextExtensions.cs b/src/NEsper.Common/common/internal/util/AssemblyLoadContextExtensions.cs index bede15f98..e7a70ebb2 100644 --- a/src/NEsper.Common/common/internal/util/AssemblyLoadContextExtensions.cs +++ b/src/NEsper.Common/common/internal/util/AssemblyLoadContextExtensions.cs @@ -1,6 +1,6 @@ using System; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; #endif diff --git a/src/NEsper.Common/common/internal/util/SerializerFactory.cs b/src/NEsper.Common/common/internal/util/SerializerFactory.cs index c2abb3380..b3d0024bf 100644 --- a/src/NEsper.Common/common/internal/util/SerializerFactory.cs +++ b/src/NEsper.Common/common/internal/util/SerializerFactory.cs @@ -19,98 +19,103 @@ namespace com.espertech.esper.common.@internal.util { public class SerializerFactory { - private static readonly List Serializers; - private static readonly BinaryFormatter BinaryFormatter = new BinaryFormatter(); - - public static readonly Serializer NULL_SERIALIZER = new StreamSerializer { - ProcSerialize = ( - obj, - writer) => { - }, - ProcDeserialize = stream => null - }; - - public static readonly Serializer OBJECT_SERIALIZER = new StreamSerializer { - ProcSerialize = ( - obj, - stream) => BinaryFormatter.Serialize(stream, obj), - ProcDeserialize = stream => { - try { - return BinaryFormatter.Deserialize(stream); - } - catch (TypeLoadException e) { - throw new IOException("unable to deserialize object", e); - } - } - }; - - static SerializerFactory() + public static SerializerFactory Instance = new SerializerFactory(); + + private readonly List _serializers; + private readonly BinaryFormatter _binaryFormatter = new BinaryFormatter(); + + public readonly Serializer NULL_SERIALIZER; + public readonly Serializer OBJECT_SERIALIZER; + + public SerializerFactory() { - Serializers = new List(); - Serializers.Add( + NULL_SERIALIZER = new StreamSerializer { + ProcSerialize = ( + obj, + writer) => { + }, + ProcDeserialize = stream => null + }; + + OBJECT_SERIALIZER = new StreamSerializer { + ProcSerialize = ( + obj, + stream) => _binaryFormatter.Serialize(stream, obj), + ProcDeserialize = stream => { + try { + return _binaryFormatter.Deserialize(stream); + } + catch (TypeLoadException e) { + throw new IOException("unable to deserialize object", e); + } + } + }; + + _serializers = new List(); + _serializers.Add( new SmartSerializer { ProcSerialize = ( obj, writer) => writer.Write(obj), ProcDeserialize = reader => reader.ReadBoolean() }); - Serializers.Add( + _serializers.Add( new SmartSerializer { ProcSerialize = ( obj, writer) => writer.Write(obj), ProcDeserialize = reader => reader.ReadChar() }); - Serializers.Add( + _serializers.Add( new SmartSerializer { ProcSerialize = ( obj, writer) => writer.Write(obj), ProcDeserialize = reader => reader.ReadByte() }); - Serializers.Add( + _serializers.Add( new SmartSerializer { ProcSerialize = ( obj, writer) => writer.Write(obj), ProcDeserialize = reader => reader.ReadInt16() }); - Serializers.Add( + _serializers.Add( new SmartSerializer { ProcSerialize = ( obj, writer) => writer.Write(obj), ProcDeserialize = reader => reader.ReadInt32() }); - Serializers.Add( + _serializers.Add( new SmartSerializer { ProcSerialize = ( obj, writer) => writer.Write(obj), ProcDeserialize = reader => reader.ReadInt64() }); - Serializers.Add( + _serializers.Add( new SmartSerializer { ProcSerialize = ( obj, writer) => writer.Write(obj), ProcDeserialize = reader => reader.ReadSingle() }); - Serializers.Add( + _serializers.Add( new SmartSerializer { ProcSerialize = ( obj, writer) => writer.Write(obj), ProcDeserialize = reader => reader.ReadDouble() }); - Serializers.Add( + _serializers.Add( new SmartSerializer { ProcSerialize = ( obj, writer) => writer.Write(obj), ProcDeserialize = reader => reader.ReadDecimal() }); - Serializers.Add( + _serializers.Add( new SmartSerializer { ProcSerialize = ( obj, @@ -119,34 +124,35 @@ static SerializerFactory() }); } - public static Serializer[] GetDefaultSerializers() + public Serializer[] GetDefaultSerializers() { List serializer = new List(); serializer.Add(NULL_SERIALIZER); - serializer.AddRange(Serializers); + serializer.AddRange(_serializers); serializer.Add(OBJECT_SERIALIZER); return serializer.ToArray(); } - public static Serializer[] GetSerializers(IEnumerable types) + public Serializer[] GetSerializers(IEnumerable types) { return types.Select(GetSerializer).ToArray(); } - public static Serializer GetSerializer(Type type) + public Serializer GetSerializer(Type type) { if (type == null) { return NULL_SERIALIZER; } - foreach (var serializer in Serializers.Where(serializer => serializer.Accepts(type.GetBoxedType()))) { + type = type.GetBoxedType(); + foreach (var serializer in _serializers.Where(serializer => serializer.Accepts(type))) { return serializer; } return OBJECT_SERIALIZER; } - public static byte[] Serialize( + public byte[] Serialize( Serializer[] serializers, object[] objects) { @@ -161,7 +167,7 @@ public static byte[] Serialize( } } - public static byte[] Serialize( + public byte[] Serialize( Serializer serializer, object @object) { @@ -171,7 +177,7 @@ public static byte[] Serialize( } } - public static object[] Deserialize( + public object[] Deserialize( int numObjects, byte[] bytes, Serializer[] serializers) diff --git a/src/NEsper.Common/common/internal/util/SerializerUtil.cs b/src/NEsper.Common/common/internal/util/SerializerUtil.cs index 719a8a377..9a034b1b3 100644 --- a/src/NEsper.Common/common/internal/util/SerializerUtil.cs +++ b/src/NEsper.Common/common/internal/util/SerializerUtil.cs @@ -21,8 +21,8 @@ public class SerializerUtil /// byte array public static byte[] ObjectToByteArr(object underlying) { - return SerializerFactory.Serialize( - new[] {SerializerFactory.OBJECT_SERIALIZER}, + return SerializerFactory.Instance.Serialize( + new[] {SerializerFactory.Instance.OBJECT_SERIALIZER}, new[] {underlying}); } @@ -35,10 +35,10 @@ public static object ByteArrToObject(byte[] bytes) return null; } - return SerializerFactory.Deserialize( + return SerializerFactory.Instance.Deserialize( 1, bytes, - new[] {SerializerFactory.OBJECT_SERIALIZER})[0]; + new[] {SerializerFactory.Instance.OBJECT_SERIALIZER})[0]; } public static object ByteArrBase64ToObject(string s) diff --git a/src/NEsper.Common/common/internal/util/TypeHelper.cs b/src/NEsper.Common/common/internal/util/TypeHelper.cs index 5819d256a..6662f2c80 100644 --- a/src/NEsper.Common/common/internal/util/TypeHelper.cs +++ b/src/NEsper.Common/common/internal/util/TypeHelper.cs @@ -15,7 +15,7 @@ using System.Reflection; using System.Runtime.CompilerServices; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; #endif @@ -2078,7 +2078,7 @@ public static Type ResolveType( { IEnumerable assemblySearchPath = AssemblySearchPath?.Invoke(); if (assemblySearchPath == null) { -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER assemblySearchPath = AssemblyLoadContext.Default.Assemblies.ToList(); #else assemblySearchPath = AppDomain.CurrentDomain.GetAssemblies(); diff --git a/src/NEsper.Common/container/ContainerImpl.cs b/src/NEsper.Common/container/ContainerImpl.cs index 51f6c4ef7..1d62bc0e4 100644 --- a/src/NEsper.Common/container/ContainerImpl.cs +++ b/src/NEsper.Common/container/ContainerImpl.cs @@ -142,6 +142,12 @@ public bool Has() return _container.Kernel.HasComponent(typeof(T)); } + public bool Has(string name) + { + CheckDisposed(); + return _container.Kernel.HasComponent(name); + } + public bool Has(Type serviceType) { CheckDisposed(); diff --git a/src/NEsper.Common/container/ContainerInitializer.cs b/src/NEsper.Common/container/ContainerInitializer.cs index 1a7179199..12b3c3566 100644 --- a/src/NEsper.Common/container/ContainerInitializer.cs +++ b/src/NEsper.Common/container/ContainerInitializer.cs @@ -9,7 +9,7 @@ using System; using System.Linq; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; #endif @@ -101,10 +101,11 @@ public static IContainer InitializeDefaultServices(this IContainer container) ic => DefaultResourceManager(), Lifespan.Singleton); if (container.DoesNotHave()) container.Register( - ic => new SystemTimerFactory(), Lifespan.Singleton); + ic => new SimpleTimerFactory(), Lifespan.Singleton); //if (container.DoesNotHave()) // container.Register( // Lifespan.Transient); + if (container.DoesNotHave()) container.Register( ic => new ArtifactTypeResolverProvider(ic), diff --git a/src/NEsper.Compat/compat/AssemblyResolver.cs b/src/NEsper.Compat/compat/AssemblyResolver.cs new file mode 100755 index 000000000..991e7cdbe --- /dev/null +++ b/src/NEsper.Compat/compat/AssemblyResolver.cs @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2006-2019 Esper Team. All rights reserved. / +// http://esper.codehaus.org / +// ---------------------------------------------------------------------------------- / +// The software in this package is published under the terms of the GPL license / +// a copy of which has been included with this distribution in the license.txt file. / +/////////////////////////////////////////////////////////////////////////////////////// + +using System.Reflection; + +namespace com.espertech.esper.compat +{ + /// + /// AssemblyResolver provides resolution of assemblies that may or may not be materialized into the process space. + /// Name of the assembly. + /// + /// + public delegate Assembly AssemblyResolver(AssemblyName assemblyName); +} diff --git a/src/NEsper.Compat/compat/HighResolutionTimeProvider.cs b/src/NEsper.Compat/compat/HighResolutionTimeProvider.cs index 21c94b97e..702e36a7a 100644 --- a/src/NEsper.Compat/compat/HighResolutionTimeProvider.cs +++ b/src/NEsper.Compat/compat/HighResolutionTimeProvider.cs @@ -17,7 +17,7 @@ public class HighResolutionTimeProvider { public static readonly HighResolutionTimeProvider Instance = new HighResolutionTimeProvider(); -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER public long CurrentTime => DateTimeHelper.CurrentTimeNanos; #else [DllImport("Kernel32.dll")] diff --git a/src/NEsper.Compat/compat/diagnostics/PerformanceMetricsHelper.cs b/src/NEsper.Compat/compat/diagnostics/PerformanceMetricsHelper.cs index eb16ca789..c0b7e0d6e 100644 --- a/src/NEsper.Compat/compat/diagnostics/PerformanceMetricsHelper.cs +++ b/src/NEsper.Compat/compat/diagnostics/PerformanceMetricsHelper.cs @@ -15,7 +15,7 @@ public static class PerformanceMetricsHelper { public static ProcessThread GetProcessThread() { -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER return null; #else var processThread = ProcessThreadHelper.GetProcessThread(); @@ -30,7 +30,7 @@ public static ProcessThread GetProcessThread() public static void ExecCpuBound(Func cpuAction) { -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER throw new NotSupportedException("cpu bound execution not supported"); #else var executionContext = new PerformanceExecutionContext(); @@ -40,7 +40,6 @@ public static void ExecCpuBound(Func cpuActio throw new IllegalStateException("unable to acquire process thread; check platform"); } - Console.WriteLine($"processthread: {processThread}"); executionContext.InitialUserTime = processThread.UserProcessorTime; executionContext.InitialPrivTime = processThread.PrivilegedProcessorTime; executionContext.InitialTotalTime = processThread.TotalProcessorTime; diff --git a/src/NEsper.Compat/compat/diagnostics/ProcessThreadHelper.cs b/src/NEsper.Compat/compat/diagnostics/ProcessThreadHelper.cs index 4d1b1f477..6a9dd9eaa 100644 --- a/src/NEsper.Compat/compat/diagnostics/ProcessThreadHelper.cs +++ b/src/NEsper.Compat/compat/diagnostics/ProcessThreadHelper.cs @@ -16,7 +16,7 @@ namespace com.espertech.esper.compat.diagnostics { public static class ProcessThreadHelper { -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER #else [DllImport("Kernel32.dll", EntryPoint = "GetCurrentThreadId", ExactSpelling = true)] public static extern int GetCurrentWin32ThreadId(); @@ -24,7 +24,7 @@ public static class ProcessThreadHelper public static ProcessThread GetProcessThread() { -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER return null; #else return GetProcessThread(GetCurrentWin32ThreadId()); diff --git a/src/NEsper.Compat/compat/timers/HighResolutionTimer.cs b/src/NEsper.Compat/compat/timers/HighResolutionTimer.cs index d6633bddf..dab84d455 100644 --- a/src/NEsper.Compat/compat/timers/HighResolutionTimer.cs +++ b/src/NEsper.Compat/compat/timers/HighResolutionTimer.cs @@ -15,8 +15,6 @@ namespace com.espertech.esper.compat.timers { -#if NETCORE -#else /// /// Windows timers are based on the system timer. The system timer runs at a /// frequency of about 50-60 hz depending on your machine. This presents a @@ -271,5 +269,4 @@ static void OnAppDomainUnload(object sender, EventArgs e) private static readonly ILog Log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); } -#endif } diff --git a/src/NEsper.Compat/compat/timers/HighResolutionTimerFactory.cs b/src/NEsper.Compat/compat/timers/HighResolutionTimerFactory.cs index c3cb90493..68ae86808 100644 --- a/src/NEsper.Compat/compat/timers/HighResolutionTimerFactory.cs +++ b/src/NEsper.Compat/compat/timers/HighResolutionTimerFactory.cs @@ -11,7 +11,7 @@ namespace com.espertech.esper.compat.timers { -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER #else /// /// Implementation of the TimerFactory that uses the HighResolutionTimer. diff --git a/src/NEsper.Compat/compat/timers/PeriodicTimerFactory.cs b/src/NEsper.Compat/compat/timers/PeriodicTimerFactory.cs index e5a8ed47e..5296d4f4e 100755 --- a/src/NEsper.Compat/compat/timers/PeriodicTimerFactory.cs +++ b/src/NEsper.Compat/compat/timers/PeriodicTimerFactory.cs @@ -14,7 +14,7 @@ namespace com.espertech.esper.compat.timers { -#if NET6 +#if NET6_0_OR_GREATER public class PeriodicTimerFactory : ITimerFactory { public ITimer CreateTimer( @@ -47,24 +47,18 @@ internal PeriodicTimeImpl( async void ExecuteTimer() { - Console.WriteLine("Starting"); - if (_offset != TimeSpan.Zero) { await Task.Delay(_offset); - Console.WriteLine("ExecuteTimer: Delay Fire: {0}", _offset); _timerCallback(this); } while (_isRunning && await _timer.WaitForNextTickAsync()) { - Console.WriteLine("ExecuteTimer: Fire"); _timerCallback(this); } } public void Dispose() { - Console.WriteLine("Dispose"); - _isRunning = false; _timer?.Dispose(); _timer = null; diff --git a/src/NEsper.Compat/compat/timers/SimpleTimerFactory.cs b/src/NEsper.Compat/compat/timers/SimpleTimerFactory.cs index a2be9f497..cce44774f 100644 --- a/src/NEsper.Compat/compat/timers/SimpleTimerFactory.cs +++ b/src/NEsper.Compat/compat/timers/SimpleTimerFactory.cs @@ -27,7 +27,7 @@ public ITimer CreateTimer( return new SimpleTimer(timerCallback, offsetInMillis, intervalInMillis); } - private class SimpleTimer : ITimer + public class SimpleTimer : ITimer { private Timer _timer; diff --git a/src/NEsper.Compat/compat/timers/SystemTimerFactory.cs b/src/NEsper.Compat/compat/timers/SystemTimerFactory.cs index 1e020ac1c..03c357f9a 100644 --- a/src/NEsper.Compat/compat/timers/SystemTimerFactory.cs +++ b/src/NEsper.Compat/compat/timers/SystemTimerFactory.cs @@ -99,13 +99,8 @@ private void CreateBaseTimer() { lock (_baseTimerLock) { - if (_baseTimer == null) - { -#if NETCORE - _baseTimer = new HarmonicTimer(OnTimerEvent); -#else + if (_baseTimer == null) { _baseTimer = new HighResolutionTimer(OnTimerEvent, null, 0, 10); -#endif } } } diff --git a/src/NEsper.Compat/compat/timers/TimerFactory.cs b/src/NEsper.Compat/compat/timers/TimerFactory.cs index f52033812..bae320b3e 100644 --- a/src/NEsper.Compat/compat/timers/TimerFactory.cs +++ b/src/NEsper.Compat/compat/timers/TimerFactory.cs @@ -25,15 +25,8 @@ public static ITimerFactory DefaultTimerFactory { get { - lock( factoryLock ) - { - if (defaultTimerFactory == null) - { - // use the system timer factory unless explicitly instructed - // to do otherwise. - - defaultTimerFactory = new SystemTimerFactory(); - } + lock( factoryLock ) { + defaultTimerFactory ??= new SimpleTimerFactory(); } return defaultTimerFactory; diff --git a/src/NEsper.Compiler/client/CoreAssemblyProvider.cs b/src/NEsper.Compiler/client/CoreAssemblyProvider.cs new file mode 100755 index 000000000..7f92be26b --- /dev/null +++ b/src/NEsper.Compiler/client/CoreAssemblyProvider.cs @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2006-2019 Esper Team. All rights reserved. / +// http://esper.codehaus.org / +// ---------------------------------------------------------------------------------- / +// The software in this package is published under the terms of the GPL license / +// a copy of which has been included with this distribution in the license.txt file. / +/////////////////////////////////////////////////////////////////////////////////////// + +using System.Collections.Generic; +using System.Reflection; + +namespace com.espertech.esper.compiler.client +{ + /// + /// CoreAssemblyProvider determines what assemblies should be provided to the compiler + /// as part of the compilation and linking process. + /// + public delegate IEnumerable CoreAssemblyProvider(); +} diff --git a/src/NEsper.Compiler/client/CoreAssemblyProviderExtensions.cs b/src/NEsper.Compiler/client/CoreAssemblyProviderExtensions.cs new file mode 100755 index 000000000..88ad9cf43 --- /dev/null +++ b/src/NEsper.Compiler/client/CoreAssemblyProviderExtensions.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.Loader; + +using com.espertech.esper.container; + +namespace com.espertech.esper.compiler.client +{ + public static class CoreAssemblyProviderExtensions + { + /// + /// Provides the assemblies should be provided to the compiler as part of the compilation and linking process. + /// + public static IEnumerable GetCoreAssemblies() + { +#if NETCOREAPP3_0_OR_GREATER + return AssemblyLoadContext.Default.Assemblies; +#else + return AppDomain.CurrentDomain.GetAssemblies(); +#endif + } + + /// + /// Retrieves an instance of the CoreAssemblyProvider. If none has been registered, this method + /// will return the default resolver. + /// + /// the IoC container + /// + public static CoreAssemblyProvider CoreAssemblyProvider(this IContainer container) + { + container.CheckContainer(); + + lock (container) { + if (container.DoesNotHave()) { + return GetCoreAssemblies; + } + } + + return container.Resolve(); + } + } +} \ No newline at end of file diff --git a/src/NEsper.Compiler/client/util/EPCompiledIOUtil.cs b/src/NEsper.Compiler/client/util/EPCompiledIOUtil.cs index 2335b51e2..a087e07f3 100644 --- a/src/NEsper.Compiler/client/util/EPCompiledIOUtil.cs +++ b/src/NEsper.Compiler/client/util/EPCompiledIOUtil.cs @@ -12,7 +12,7 @@ using System.Linq; using System.Reflection; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; #endif @@ -50,7 +50,7 @@ public class EPCompiledIOUtil private static Assembly LoadAssembly(byte[] image) { -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER var assemblyLoadContext = AssemblyLoadContext.CurrentContextualReflectionContext; if (assemblyLoadContext == null) { assemblyLoadContext = AssemblyLoadContext.Default; diff --git a/src/NEsper.Compiler/internal/util/CompileCallable.cs b/src/NEsper.Compiler/internal/util/CompileCallable.cs index 9af2bc916..a12ce1f05 100644 --- a/src/NEsper.Compiler/internal/util/CompileCallable.cs +++ b/src/NEsper.Compiler/internal/util/CompileCallable.cs @@ -45,6 +45,8 @@ public CompilableItemResult Call() var compiler = container .RoslynCompiler() .WithMetaDataReferences(repository.AllMetadataReferences) + .WithMetaDataReferences(container.MetadataReferenceProvider()?.Invoke()) + .WithDebugOptimization(_compileTimeServices.Configuration.Compiler.IsDebugOptimization) .WithCodeLogging(_compileTimeServices.Configuration.Compiler.Logging.IsEnableCode) .WithCodeAuditDirectory(_compileTimeServices.Configuration.Compiler.Logging.AuditDirectory) .WithCodegenClasses(_compilableItem.Classes); diff --git a/src/NEsper.Compiler/internal/util/CompilerHelperFAFProvider.cs b/src/NEsper.Compiler/internal/util/CompilerHelperFAFProvider.cs index 0f2af9aa4..1a325c0cc 100644 --- a/src/NEsper.Compiler/internal/util/CompilerHelperFAFProvider.cs +++ b/src/NEsper.Compiler/internal/util/CompilerHelperFAFProvider.cs @@ -317,6 +317,8 @@ private static string MakeFAFProvider( var compiler = container .RoslynCompiler() .WithMetaDataReferences(artifactRepository.AllMetadataReferences) + .WithMetaDataReferences(container.MetadataReferenceProvider()?.Invoke()) + .WithDebugOptimization(compileTimeServices.Configuration.Compiler.IsDebugOptimization) .WithCodeLogging(compileTimeServices.Configuration.Compiler.Logging.IsEnableCode) .WithCodeAuditDirectory(compileTimeServices.Configuration.Compiler.Logging.AuditDirectory) .WithCodegenClasses(new List() { clazz }); diff --git a/src/NEsper.Compiler/internal/util/CompilerHelperFAFQuery.cs b/src/NEsper.Compiler/internal/util/CompilerHelperFAFQuery.cs index 3ac8e6b34..0ddcee470 100644 --- a/src/NEsper.Compiler/internal/util/CompilerHelperFAFQuery.cs +++ b/src/NEsper.Compiler/internal/util/CompilerHelperFAFQuery.cs @@ -64,6 +64,8 @@ public static string CompileQuery( var compiler = container .RoslynCompiler() .WithMetaDataReferences(repository.AllMetadataReferences) + .WithMetaDataReferences(container.MetadataReferenceProvider()?.Invoke()) + .WithDebugOptimization(compileTimeServices.Configuration.Compiler.IsDebugOptimization) .WithCodeLogging(compileTimeServices.Configuration.Compiler.Logging.IsEnableCode) .WithCodeAuditDirectory(compileTimeServices.Configuration.Compiler.Logging.AuditDirectory) .WithCodegenClasses(classes); diff --git a/src/NEsper.Compiler/internal/util/CompilerHelperModuleProvider.cs b/src/NEsper.Compiler/internal/util/CompilerHelperModuleProvider.cs index d1dcd008e..3732d55da 100644 --- a/src/NEsper.Compiler/internal/util/CompilerHelperModuleProvider.cs +++ b/src/NEsper.Compiler/internal/util/CompilerHelperModuleProvider.cs @@ -463,6 +463,8 @@ private static string CompileModule( var compiler = container .RoslynCompiler() .WithMetaDataReferences(repository.AllMetadataReferences) + .WithMetaDataReferences(container.MetadataReferenceProvider()?.Invoke()) + .WithDebugOptimization(compileTimeServices.Configuration.Compiler.IsDebugOptimization) .WithCodeLogging(compileTimeServices.Configuration.Compiler.Logging.IsEnableCode) .WithCodeAuditDirectory(compileTimeServices.Configuration.Compiler.Logging.AuditDirectory) .WithCodegenClasses(new[] {clazz}); diff --git a/src/NEsper.Compiler/internal/util/CompilerHelperStatementProvider.cs b/src/NEsper.Compiler/internal/util/CompilerHelperStatementProvider.cs index 3debca11d..4304563db 100644 --- a/src/NEsper.Compiler/internal/util/CompilerHelperStatementProvider.cs +++ b/src/NEsper.Compiler/internal/util/CompilerHelperStatementProvider.cs @@ -350,6 +350,8 @@ public static CompilableItem CompileItem( var compiler = container .RoslynCompiler() .WithMetaDataReferences(artifactRepository.AllMetadataReferences) + .WithMetaDataReferences(container.MetadataReferenceProvider()?.Invoke()) + .WithDebugOptimization(compileTimeServices.Configuration.Compiler.IsDebugOptimization) .WithCodeLogging(compileTimeServices.Configuration.Compiler.Logging.IsEnableCode) .WithCodeAuditDirectory(compileTimeServices.Configuration.Compiler.Logging.AuditDirectory) .WithCodegenClasses(sorted); diff --git a/src/NEsper.Compiler/internal/util/CompilerServicesImpl.cs b/src/NEsper.Compiler/internal/util/CompilerServicesImpl.cs index f0d8168d2..0e4ef826c 100644 --- a/src/NEsper.Compiler/internal/util/CompilerServicesImpl.cs +++ b/src/NEsper.Compiler/internal/util/CompilerServicesImpl.cs @@ -101,6 +101,8 @@ public ICompileArtifact Compile(CompileRequest request) var compiler = container .RoslynCompiler() .WithMetaDataReferences(repository.AllMetadataReferences) + .WithMetaDataReferences(container.MetadataReferenceProvider()?.Invoke()) + .WithDebugOptimization(configuration.Compiler.IsDebugOptimization) .WithCodeLogging(configuration.Compiler.Logging.IsEnableCode) .WithCodeAuditDirectory(configuration.Compiler.Logging.AuditDirectory) .WithSources( diff --git a/src/NEsper.Compiler/internal/util/CompilerVersion.cs b/src/NEsper.Compiler/internal/util/CompilerVersion.cs index ad0d0d558..89e23d4a9 100644 --- a/src/NEsper.Compiler/internal/util/CompilerVersion.cs +++ b/src/NEsper.Compiler/internal/util/CompilerVersion.cs @@ -10,6 +10,6 @@ namespace com.espertech.esper.compiler.@internal.util { public class CompilerVersion { - public const string COMPILER_VERSION = "8.5.6"; + public const string COMPILER_VERSION = "8.5.7"; } } // end of namespace \ No newline at end of file diff --git a/src/NEsper.Compiler/internal/util/RoslynCompiler.cs b/src/NEsper.Compiler/internal/util/RoslynCompiler.cs index 325c092fe..94e1f22e1 100644 --- a/src/NEsper.Compiler/internal/util/RoslynCompiler.cs +++ b/src/NEsper.Compiler/internal/util/RoslynCompiler.cs @@ -12,7 +12,7 @@ using System.Linq; using System.Reflection; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; #endif @@ -22,6 +22,8 @@ using com.espertech.esper.compat; using com.espertech.esper.compat.collections; using com.espertech.esper.compat.logging; +using com.espertech.esper.compiler.client; +using com.espertech.esper.compiler.client.util; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -30,6 +32,7 @@ using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; using IContainer = com.espertech.esper.container.IContainer; +using MetadataReferenceResolver = com.espertech.esper.common.client.artifact.MetadataReferenceResolver; namespace com.espertech.esper.compiler.@internal.util { @@ -49,7 +52,6 @@ public RoslynCompiler(IContainer container) { Container = container; Sources = new List(); - InitializeAssemblyResolution(); } /// @@ -88,40 +90,6 @@ public RoslynCompiler(IContainer container) /// public bool IsDebugOptimization { get; set; } - /// - /// Initializes the assembly resolution mechanism. - /// - private void InitializeAssemblyResolution() - { -#if FALSE -#if NETCORE - LoadContext.Resolving += ( - context, - name) => { - Log.Info("AssemblyResolve for {0}", name.Name); - if (_assemblyCacheBindings.TryGetValue(name.Name, out var bindingPair)) { - Log.Debug("AssemblyResolve: Located {0}", name.Name); - return bindingPair.Assembly; - } - - Log.Warn("AssemblyResolve: Unable to locate {0}", name.Name); - return null; - }; -#else - AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => { - Log.Info("AssemblyResolve for {0}", args.Name); - if (_assemblyCacheBindings.TryGetValue(args.Name, out var bindingPair)) { - Log.Debug("AssemblyResolve: Located {0}", args.Name); - return bindingPair.Assembly; - } - - Log.Warn("AssemblyResolve: Unable to locate {0}", args.Name); - return null; - }; -#endif -#endif - } - public RoslynCompiler WithCodeLogging(bool isCodeLogging) { IsCodeLogging = isCodeLogging; @@ -134,7 +102,6 @@ public RoslynCompiler WithCodeAuditDirectory(string targetDirectory) return this; } - public RoslynCompiler WithCodegenClasses(IList sorted) { Sources = sorted.Select(_ => new SourceCodegen(_)).ToList(); @@ -149,7 +116,17 @@ public RoslynCompiler WithSources(IList sources) public RoslynCompiler WithMetaDataReferences(IEnumerable metadataReferences) { - MetadataReferences = metadataReferences; + if (metadataReferences != null) { + if (MetadataReferences == null) { + MetadataReferences = metadataReferences; + } + else { + MetadataReferences = MetadataReferences + .Concat(metadataReferences) + .ToList(); + } + } + return this; } @@ -170,15 +147,12 @@ private static bool IsGeneratedAssembly(Assembly assembly) internal IEnumerable GetCoreMetadataReferences() { -#if NETCORE - var coreAssemblies = AssemblyLoadContext.Default.Assemblies; -#else - var coreAssemblies = AppDomain.CurrentDomain.GetAssemblies(); -#endif - - return coreAssemblies + var resolver = Container.MetadataReferenceResolver(); + return Container + .CoreAssemblyProvider() + .Invoke() .Distinct() - .Select(GetMetadataReference) + .Select(_ => GetMetadataReference(resolver, _)) .Where(_ => _ != null); } @@ -287,12 +261,9 @@ public static bool IsDynamicAssembly(Assembly assembly) ); } - public MetadataReference GetMetadataReference(Assembly assembly) + public MetadataReference GetMetadataReference(MetadataReferenceResolver resolver, Assembly assembly) { - if (!IsDynamicAssembly(assembly)) - return MetadataReference.CreateFromFile(assembly.Location); - - return null; + return !IsDynamicAssembly(assembly) ? resolver.Invoke(assembly) : null; } /// diff --git a/src/NEsper.Compiler/internal/util/Version.cs b/src/NEsper.Compiler/internal/util/Version.cs index 07595ffcb..019f00fc5 100644 --- a/src/NEsper.Compiler/internal/util/Version.cs +++ b/src/NEsper.Compiler/internal/util/Version.cs @@ -11,7 +11,7 @@ namespace com.espertech.esper.compiler.@internal.util public class Version { public static string COMPILER_VERSION { - get => "8.5.6"; + get => "8.5.7"; } } } // end of namespace \ No newline at end of file diff --git a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarBaseListener.cs b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarBaseListener.cs index d217add38..ff6e4e5bf 100644 --- a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarBaseListener.cs +++ b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarBaseListener.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:\Src\Espertech\NEsper-8.5.6\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 +// Generated from C:\Src\Espertech\NEsper-8.5.7\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 // Unreachable code detected #pragma warning disable 0162 diff --git a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarBaseVisitor.cs b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarBaseVisitor.cs index 7e87d01f7..b5558331b 100644 --- a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarBaseVisitor.cs +++ b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarBaseVisitor.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:\Src\Espertech\NEsper-8.5.6\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 +// Generated from C:\Src\Espertech\NEsper-8.5.7\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 // Unreachable code detected #pragma warning disable 0162 diff --git a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarLexer.cs b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarLexer.cs index ec41d41c4..82982163b 100644 --- a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarLexer.cs +++ b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarLexer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:\Src\Espertech\NEsper-8.5.6\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 +// Generated from C:\Src\Espertech\NEsper-8.5.7\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 // Unreachable code detected #pragma warning disable 0162 diff --git a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarListener.cs b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarListener.cs index 52a140cb2..bef39d6d9 100644 --- a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarListener.cs +++ b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarListener.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:\Src\Espertech\NEsper-8.5.6\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 +// Generated from C:\Src\Espertech\NEsper-8.5.7\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 // Unreachable code detected #pragma warning disable 0162 diff --git a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarParser.cs b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarParser.cs index be4b21b57..2f7afcf21 100644 --- a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarParser.cs +++ b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarParser.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:\Src\Espertech\NEsper-8.5.6\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 +// Generated from C:\Src\Espertech\NEsper-8.5.7\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 // Unreachable code detected #pragma warning disable 0162 diff --git a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarVisitor.cs b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarVisitor.cs index 9f7aab506..271ec1607 100644 --- a/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarVisitor.cs +++ b/src/NEsper.Grammar/internal/generated/EsperEPL2GrammarVisitor.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:\Src\Espertech\NEsper-8.5.6\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 +// Generated from C:\Src\Espertech\NEsper-8.5.7\NEsper\grammar\EsperEPL2Grammar.g4 by ANTLR 4.7.1 // Unreachable code detected #pragma warning disable 0162 diff --git a/src/NEsper.Runtime/client/util/RuntimeVersion.cs b/src/NEsper.Runtime/client/util/RuntimeVersion.cs index 410f26fff..519651d4f 100644 --- a/src/NEsper.Runtime/client/util/RuntimeVersion.cs +++ b/src/NEsper.Runtime/client/util/RuntimeVersion.cs @@ -19,7 +19,7 @@ public class RuntimeVersion /// /// Current runtime version. /// - public const string RUNTIME_VERSION = "8.5.6"; + public const string RUNTIME_VERSION = "8.5.7"; /// /// Current runtime major version. diff --git a/src/NEsper.Runtime/internal/kernel/service/DeployerHelperInitStatement.cs b/src/NEsper.Runtime/internal/kernel/service/DeployerHelperInitStatement.cs index 8099c9589..fbc935f2a 100644 --- a/src/NEsper.Runtime/internal/kernel/service/DeployerHelperInitStatement.cs +++ b/src/NEsper.Runtime/internal/kernel/service/DeployerHelperInitStatement.cs @@ -10,7 +10,7 @@ using System.Collections.Generic; using System.Reflection; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; #endif @@ -61,7 +61,7 @@ public static DeployerModuleStatementLightweights InitializeStatements( // get module statements IList statementResources; try { -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER if (Log.IsDebugEnabled) { var assemblyLoadContext = AssemblyLoadContext.GetLoadContext(moduleProvider.ModuleProvider.GetType().Assembly); Log.Debug("AssemblyLoadContext: {0}", assemblyLoadContext); diff --git a/src/NEsper.Runtime/internal/kernel/service/DeployerRolloutArgs.cs b/src/NEsper.Runtime/internal/kernel/service/DeployerRolloutArgs.cs index feafe5392..e28b0720e 100755 --- a/src/NEsper.Runtime/internal/kernel/service/DeployerRolloutArgs.cs +++ b/src/NEsper.Runtime/internal/kernel/service/DeployerRolloutArgs.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; #endif diff --git a/src/NEsper.Runtime/internal/kernel/service/EPDeploymentServiceImpl.cs b/src/NEsper.Runtime/internal/kernel/service/EPDeploymentServiceImpl.cs index 1522e2148..ebeda709d 100644 --- a/src/NEsper.Runtime/internal/kernel/service/EPDeploymentServiceImpl.cs +++ b/src/NEsper.Runtime/internal/kernel/service/EPDeploymentServiceImpl.cs @@ -11,7 +11,7 @@ using System.Linq; using System.Reflection; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime.Loader; using com.espertech.esper.common.client.artifact; diff --git a/src/NEsper.Runtime/internal/namedwindow/NamedWindowDispatchServiceImpl.cs b/src/NEsper.Runtime/internal/namedwindow/NamedWindowDispatchServiceImpl.cs index d454a31c8..c321d0c4b 100644 --- a/src/NEsper.Runtime/internal/namedwindow/NamedWindowDispatchServiceImpl.cs +++ b/src/NEsper.Runtime/internal/namedwindow/NamedWindowDispatchServiceImpl.cs @@ -95,7 +95,6 @@ public bool Dispatch() dispatchesTL.Current.AddAll(dispatchesTL.Dispatches); dispatchesTL.Dispatches.Clear(); ProcessDispatches(dispatchesTL.Current, dispatchesTL.Work, dispatchesTL.DispatchesPerStmt); - Console.WriteLine("{0}", dispatchesTL.Current.Count); } catch (EPException) { throw; diff --git a/tst/NEsper.Common.Tests/internal/util/TestSerializerFactory.cs b/tst/NEsper.Common.Tests/internal/util/TestSerializerFactory.cs index 5ed36fb3b..91dd02fc3 100644 --- a/tst/NEsper.Common.Tests/internal/util/TestSerializerFactory.cs +++ b/tst/NEsper.Common.Tests/internal/util/TestSerializerFactory.cs @@ -65,14 +65,15 @@ public void TestTypes() classes[i] = expected.GetType(); } - var serializers = SerializerFactory.GetSerializers(classes); - var bytes = SerializerFactory.Serialize(serializers, expected); + var serializerFactory = SerializerFactory.Instance; + var serializers = serializerFactory.GetSerializers(classes); + var bytes = serializerFactory.Serialize(serializers, expected); - var result = SerializerFactory.Deserialize(expected.Length, bytes, serializers); + var result = serializerFactory.Deserialize(expected.Length, bytes, serializers); EPAssertionUtil.AssertEqualsExactOrder(expected, result); // null values are simply not serialized - bytes = SerializerFactory.Serialize(new[] { SerializerFactory.GetSerializer(typeof(int?)) }, new object[] { null }); + bytes = serializerFactory.Serialize(new[] { serializerFactory.GetSerializer(typeof(int?)) }, new object[] { null }); Assert.AreEqual(0, bytes.Length); } } diff --git a/tst/NEsper.Regression.Runner/runner/RegressionSession.cs b/tst/NEsper.Regression.Runner/runner/RegressionSession.cs index ad54c57f4..5db5459e1 100644 --- a/tst/NEsper.Regression.Runner/runner/RegressionSession.cs +++ b/tst/NEsper.Regression.Runner/runner/RegressionSession.cs @@ -10,7 +10,7 @@ using System.IO; using System.Linq; -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER using System.Runtime; using System.Runtime.Loader; #endif @@ -75,7 +75,7 @@ public void Dispose() Runtime = null; } -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER public class DisposableAssemblyLoadContext : AssemblyLoadContext, IDisposable { diff --git a/tst/NEsper.Regression.Runner/suite/client/TestSuiteClientRuntime.cs b/tst/NEsper.Regression.Runner/suite/client/TestSuiteClientRuntime.cs index e8bc422e0..fff12c2a7 100644 --- a/tst/NEsper.Regression.Runner/suite/client/TestSuiteClientRuntime.cs +++ b/tst/NEsper.Regression.Runner/suite/client/TestSuiteClientRuntime.cs @@ -314,10 +314,10 @@ public TestClientRuntimeStatementName() : base(Configure) } [Test, RunInApplicationDomain] - public void WithingleModuleTwoStatementsNoDep() => RegressionRunner.Run(_session, ClientRuntimeStatementName.WithingleModuleTwoStatementsNoDep()); + public void WithSingleModuleTwoStatementsNoDep() => RegressionRunner.Run(_session, ClientRuntimeStatementName.WithSingleModuleTwoStatementsNoDep()); [Test, RunInApplicationDomain] - public void WithtatementNameDuplicate() => RegressionRunner.Run(_session, ClientRuntimeStatementName.WithtatementNameDuplicate()); + public void WithStatementNameDuplicate() => RegressionRunner.Run(_session, ClientRuntimeStatementName.WithStatementNameDuplicate()); } /// @@ -334,9 +334,11 @@ public TestClientRuntimeSubscriber() : base(Configure) } [Test, RunInApplicationDomain] + [Parallelizable(ParallelScope.None)] public void WithPerformanceSynthetic() => RegressionRunner.Run(_session, ClientRuntimeSubscriber.WithPerformanceSynthetic()); [Test, RunInApplicationDomain] + [Parallelizable(ParallelScope.None)] public void WithPerformanceSyntheticUndelivered() => RegressionRunner.Run(_session, ClientRuntimeSubscriber.WithPerformanceSyntheticUndelivered()); [Test, RunInApplicationDomain] diff --git a/tst/NEsper.Regression.Runner/suite/expr/TestSuiteExprEnum.cs b/tst/NEsper.Regression.Runner/suite/expr/TestSuiteExprEnum.cs index 4427a8ff8..e3ce3223c 100644 --- a/tst/NEsper.Regression.Runner/suite/expr/TestSuiteExprEnum.cs +++ b/tst/NEsper.Regression.Runner/suite/expr/TestSuiteExprEnum.cs @@ -91,6 +91,7 @@ public void TestExprEnumInvalid() } [Test] + [Parallelizable(ParallelScope.None)] public void TestExprEnumNamedWindowPerformance() { RegressionRunner.Run(_session, new ExprEnumNamedWindowPerformance()); diff --git a/tst/NEsper.Regression/NEsperSetup.cs b/tst/NEsper.Regression/NEsperSetup.cs index c6b41b8b3..0266f197d 100644 --- a/tst/NEsper.Regression/NEsperSetup.cs +++ b/tst/NEsper.Regression/NEsperSetup.cs @@ -25,7 +25,7 @@ public class NEsperSetup [OneTimeSetUp] public void RunBeforeAnyTests() { -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER #else //var clearScript = typeof(ScriptingEngineJScript); #endif diff --git a/tst/NEsper.Regression/suite/client/deploy/ClientDeployVersion.cs b/tst/NEsper.Regression/suite/client/deploy/ClientDeployVersion.cs index 3651099f4..8df9b7825 100644 --- a/tst/NEsper.Regression/suite/client/deploy/ClientDeployVersion.cs +++ b/tst/NEsper.Regression/suite/client/deploy/ClientDeployVersion.cs @@ -37,7 +37,7 @@ public void Run(RegressionEnvironment env) EPCompiled compiled = EPCompiledIOUtil.Read(new File(file)); var versionMismatchMsg = - "Major or minor version of compiler and runtime mismatch; The runtime version is 8.5.6 and the compiler version of the compiled unit is 8.0.0"; + "Major or minor version of compiler and runtime mismatch; The runtime version is 8.5.7 and the compiler version of the compiled unit is 8.0.0"; AssertMessage( Assert.Throws( () => env.Runtime.DeploymentService.Deploy(compiled)), @@ -51,7 +51,7 @@ public void Run(RegressionEnvironment env) AssertMessage( Assert.Throws( () => env.Runtime.FireAndForgetService.ExecuteQuery(compiled)), - "Major or minor version of compiler and runtime mismatch; The runtime version is 8.5.6 and the compiler version of the compiled unit is 8.0.0"); + "Major or minor version of compiler and runtime mismatch; The runtime version is 8.5.7 and the compiler version of the compiled unit is 8.0.0"); #endif } } diff --git a/tst/NEsper.Regression/suite/client/runtime/ClientRuntimeStatementName.cs b/tst/NEsper.Regression/suite/client/runtime/ClientRuntimeStatementName.cs index a79baf2ee..a28e0baac 100644 --- a/tst/NEsper.Regression/suite/client/runtime/ClientRuntimeStatementName.cs +++ b/tst/NEsper.Regression/suite/client/runtime/ClientRuntimeStatementName.cs @@ -21,19 +21,19 @@ public class ClientRuntimeStatementName public static IList Executions() { IList execs = new List(); - WithtatementNameDuplicate(execs); - WithingleModuleTwoStatementsNoDep(execs); + WithStatementNameDuplicate(execs); + WithSingleModuleTwoStatementsNoDep(execs); return execs; } - public static IList WithingleModuleTwoStatementsNoDep(IList execs = null) + public static IList WithSingleModuleTwoStatementsNoDep(IList execs = null) { execs = execs ?? new List(); execs.Add(new ClientRuntimeSingleModuleTwoStatementsNoDep()); return execs; } - public static IList WithtatementNameDuplicate(IList execs = null) + public static IList WithStatementNameDuplicate(IList execs = null) { execs = execs ?? new List(); execs.Add(new ClientRuntimeStatementNameDuplicate()); diff --git a/tst/NEsper.Regression/suite/expr/exprcore/ExprCoreLikeRegexp.cs b/tst/NEsper.Regression/suite/expr/exprcore/ExprCoreLikeRegexp.cs index 329313c17..df54457a6 100644 --- a/tst/NEsper.Regression/suite/expr/exprcore/ExprCoreLikeRegexp.cs +++ b/tst/NEsper.Regression/suite/expr/exprcore/ExprCoreLikeRegexp.cs @@ -190,7 +190,7 @@ public void Run(RegressionEnvironment env) "select TheString regexp \"*any*\" from SupportBean", "Failed to validate select-clause expression 'TheString regexp \"*any*\"': " + "Failed to compile regex pattern '*any*': " + -#if NETCORE +#if NETCOREAPP3_0_OR_GREATER "Invalid pattern '*any*' at offset 1. Quantifier {x,y} following nothing." #else "parsing \"*any*\" - Quantifier {x,y} following nothing."