SWEEP: Factored out exceptions into a new feature FEATURE_SERIALIZABLE_EXCEPTIONS, since we cannot support them on .NET Standard 2.0 and reworked build configurations to remove any .NET Standard 2.0 configurations that are not needed
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/71612621 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/71612621 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/71612621 Branch: refs/heads/master Commit: 71612621626a3c9a9854b889dc5b1f058d4ff4a7 Parents: dc993d0 Author: Shad Storhaug <[email protected]> Authored: Wed Sep 6 17:29:08 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Wed Sep 6 17:29:08 2017 +0700 ---------------------------------------------------------------------- .../Lucene.Net.Analysis.Common.csproj | 4 +- .../Lucene.Net.Analysis.Kuromoji.csproj | 9 +- .../Lucene.Net.Analysis.Phonetic.csproj | 12 +-- .../Lucene.Net.Analysis.SmartCn.csproj | 9 +- .../Lucene.Net.Analysis.Stempel.csproj | 8 +- .../ByTask/Feeds/NoMoreDataException.cs | 8 +- .../Lucene.Net.Benchmark.csproj | 9 +- .../Support/Sax/SAXException.cs | 9 +- .../Support/Sax/SAXNotRecognizedException.cs | 9 +- .../Support/Sax/SAXNotSupportedException.cs | 9 +- .../Support/Sax/SAXParseException.cs | 26 +++--- .../Lucene.Net.Classification.csproj | 8 +- src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj | 8 +- .../JS/JavascriptLexer.cs | 11 +-- .../Lucene.Net.Expressions.csproj | 11 ++- src/Lucene.Net.Facet/Lucene.Net.Facet.csproj | 9 +- .../Lucene.Net.Grouping.csproj | 8 +- .../Highlight/InvalidTokenOffsetsException.cs | 10 ++- .../Lucene.Net.Highlighter.csproj | 9 +- src/Lucene.Net.Join/Lucene.Net.Join.csproj | 8 +- src/Lucene.Net.Misc/Lucene.Net.Misc.csproj | 8 +- .../DocValues/DocTermsIndexDocValues.cs | 13 +-- .../Lucene.Net.Queries.csproj | 9 +- .../Classic/ParseException.cs | 26 +++--- .../Classic/QueryParser.cs | 8 +- .../Classic/QueryParserBase.cs | 9 +- .../Classic/TokenMgrError.cs | 12 +-- .../Flexible/Core/QueryNodeError.cs | 18 ++-- .../Flexible/Core/QueryNodeException.cs | 10 ++- .../Flexible/Core/QueryNodeParseException.cs | 10 ++- .../Flexible/Standard/Parser/ParseException.cs | 8 +- .../Standard/Parser/StandardSyntaxParser.cs | 8 +- .../Flexible/Standard/Parser/TokenMgrError.cs | 8 +- .../Lucene.Net.QueryParser.csproj | 4 +- .../Surround/Parser/ParseException.cs | 8 +- .../Surround/Parser/QueryParser.cs | 8 +- .../Surround/Parser/TokenMgrError.cs | 12 +-- .../Surround/Query/TooManyBasicQueries.cs | 10 ++- .../Xml/ParserException.cs | 8 +- .../Lucene.Net.Replicator.csproj | 9 +- .../SessionExpiredException.cs | 9 +- .../Lucene.Net.Sandbox.csproj | 8 +- .../Lucene.Net.Spatial.csproj | 2 +- .../Query/UnsupportedSpatialOperation.cs | 10 ++- .../Lucene.Net.Suggest.csproj | 8 +- .../Lucene.Net.TestFramework.csproj | 4 +- .../InternalAssumptionViolatedException.cs | 19 ++++- .../Lucene.Net.Tests.Analysis.Common.csproj | 4 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Analysis.Kuromoji.csproj | 3 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Analysis.Phonetic.csproj | 4 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Analysis.SmartCn.csproj | 3 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Analysis.Stempel.csproj | 3 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Benchmark.csproj | 4 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Classification.csproj | 5 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Codecs.csproj | 4 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Demo.csproj | 3 - .../Lucene.Net.Tests.Expressions.csproj | 5 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Facet.csproj | 4 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Grouping.csproj | 3 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Highlighter.csproj | 3 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Join.csproj | 3 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Memory.csproj | 8 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Misc.csproj | 3 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Queries.csproj | 5 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.QueryParser.csproj | 2 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Replicator.csproj | 3 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Sandbox.csproj | 3 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Spatial.csproj | 5 +- .../Support/TestExceptionSerialization.cs | 2 +- .../Lucene.Net.Tests.Suggest.csproj | 4 +- .../Support/TestExceptionSerialization.cs | 2 +- src/Lucene.Net.Tests/Lucene.Net.Tests.csproj | 2 +- .../Support/TestExceptionSerialization.cs | 2 +- src/Lucene.Net/Index/CorruptIndexException.cs | 9 +- .../Index/IndexFormatTooNewException.cs | 11 +-- .../Index/IndexFormatTooOldException.cs | 11 +-- src/Lucene.Net/Index/IndexNotFoundException.cs | 13 +-- src/Lucene.Net/Index/MergePolicy.cs | 18 ++-- src/Lucene.Net/Index/TwoPhaseCommitTool.cs | 22 ++--- src/Lucene.Net/Lucene.Net.csproj | 4 +- src/Lucene.Net/Search/BooleanQuery.cs | 9 +- .../Search/CollectionTerminatedException.cs | 9 +- src/Lucene.Net/Search/TimeLimitingCollector.cs | 9 +- src/Lucene.Net/Store/AlreadyClosedException.cs | 5 +- .../Store/LockObtainFailedException.cs | 9 +- .../Store/LockReleaseFailedException.cs | 9 +- .../Store/NoSuchDirectoryException.cs | 5 +- src/Lucene.Net/Support/C5.Support.cs | 86 +++++++++++++------- src/Lucene.Net/Support/IO/BufferExceptions.cs | 34 +++++--- src/Lucene.Net/Util/BytesRefHash.cs | 11 +-- src/Lucene.Net/Util/SetOnce.cs | 9 +- src/dotnet/Lucene.Net.ICU/Lucene.Net.ICU.csproj | 3 +- .../Lucene.Net.Replicator.AspNetCore.csproj | 6 +- .../Lucene.Net.Tests.ICU.csproj | 4 +- .../Support/TestExceptionSerialization.cs | 2 +- 114 files changed, 480 insertions(+), 408 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj b/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj index 75ab1c6..8a3dfb6 100644 --- a/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj +++ b/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj @@ -55,7 +55,7 @@ </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_CLONEABLE;FEATURE_DTD_PROCESSING;FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_CLONEABLE;FEATURE_DTD_PROCESSING</DefineConstants> <DebugType>portable</DebugType> </PropertyGroup> @@ -68,7 +68,7 @@ </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_CLONEABLE;FEATURE_DTD_PROCESSING;FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_CLONEABLE;FEATURE_DTD_PROCESSING</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Analysis.Kuromoji/Lucene.Net.Analysis.Kuromoji.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Kuromoji/Lucene.Net.Analysis.Kuromoji.csproj b/src/Lucene.Net.Analysis.Kuromoji/Lucene.Net.Analysis.Kuromoji.csproj index e70fcc1..a95a045 100644 --- a/src/Lucene.Net.Analysis.Kuromoji/Lucene.Net.Analysis.Kuromoji.csproj +++ b/src/Lucene.Net.Analysis.Kuromoji/Lucene.Net.Analysis.Kuromoji.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -54,14 +54,14 @@ <ProjectReference Include="..\Lucene.Net.Analysis.Common\Lucene.Net.Analysis.Common.csproj" /> </ItemGroup> - <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' "> + <!--<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' "> <PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.0" /> </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);NETSTANDARD;FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <PackageReference Include="System.Globalization.Extensions" Version="4.3.0" /> @@ -74,7 +74,6 @@ </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Analysis.Phonetic/Lucene.Net.Analysis.Phonetic.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Phonetic/Lucene.Net.Analysis.Phonetic.csproj b/src/Lucene.Net.Analysis.Phonetic/Lucene.Net.Analysis.Phonetic.csproj index 6f017f2..4698c1a 100644 --- a/src/Lucene.Net.Analysis.Phonetic/Lucene.Net.Analysis.Phonetic.csproj +++ b/src/Lucene.Net.Analysis.Phonetic/Lucene.Net.Analysis.Phonetic.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -55,21 +55,15 @@ <ProjectReference Include="..\Lucene.Net.Analysis.Common\Lucene.Net.Analysis.Common.csproj" /> </ItemGroup> - <ItemGroup> - <PackageReference Include="icu.net" Version="54.1.1-alpha" /> - </ItemGroup> - - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Analysis.SmartCn/Lucene.Net.Analysis.SmartCn.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.SmartCn/Lucene.Net.Analysis.SmartCn.csproj b/src/Lucene.Net.Analysis.SmartCn/Lucene.Net.Analysis.SmartCn.csproj index 26d2ce5..37604c0 100644 --- a/src/Lucene.Net.Analysis.SmartCn/Lucene.Net.Analysis.SmartCn.csproj +++ b/src/Lucene.Net.Analysis.SmartCn/Lucene.Net.Analysis.SmartCn.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -59,14 +59,14 @@ <PackageReference Include="icu.net" Version="54.1.1-alpha" /> </ItemGroup> - <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> + <!--<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.0" /> </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);NETSTANDARD;FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.0" /> @@ -78,7 +78,6 @@ </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj b/src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj index b159971..324b157 100644 --- a/src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj +++ b/src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -53,17 +53,15 @@ <ProjectReference Include="..\Lucene.Net.Analysis.Common\Lucene.Net.Analysis.Common.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Benchmark/ByTask/Feeds/NoMoreDataException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/ByTask/Feeds/NoMoreDataException.cs b/src/Lucene.Net.Benchmark/ByTask/Feeds/NoMoreDataException.cs index a7bfbad..9778124 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Feeds/NoMoreDataException.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Feeds/NoMoreDataException.cs @@ -1,5 +1,5 @@ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -27,7 +27,9 @@ namespace Lucene.Net.Benchmarks.ByTask.Feeds /// Thrown by Docs Makers if <c>doc.maker.forever</c> is <c>false</c> and docs sources of that maker where exhausted. /// This is useful for iterating all document of a source, in case we don't know in advance how many docs there are. /// </summary> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class NoMoreDataException : Exception @@ -35,7 +37,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Feeds public NoMoreDataException() { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.csproj b/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.csproj index 366d5ee..e9e0bc1 100644 --- a/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.csproj +++ b/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -65,14 +65,13 @@ <PackageReference Include="Spatial4n.Core" Version="0.4.1-beta00007" /> </ItemGroup> - <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> + <!--<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <PackageReference Include="SharpZipLib.NETStandard" Version="0.86.0.1" /> </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <PackageReference Include="SharpZipLib.NETStandard" Version="0.86.0.1" /> @@ -84,7 +83,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Benchmark/Support/Sax/SAXException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/Support/Sax/SAXException.cs b/src/Lucene.Net.Benchmark/Support/Sax/SAXException.cs index fc075d8..698e563 100644 --- a/src/Lucene.Net.Benchmark/Support/Sax/SAXException.cs +++ b/src/Lucene.Net.Benchmark/Support/Sax/SAXException.cs @@ -4,7 +4,7 @@ // $Id: SAXException.java,v 1.7 2002/01/30 21:13:48 dbrownell Exp $ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -33,8 +33,9 @@ namespace Sax /// specific location in an XML document, it should use the /// <see cref="SAXParseException"/> subclass. /// </remarks> - // LUCENENET: All exeption classes should be marked serializable -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class SAXException : Exception @@ -88,7 +89,7 @@ namespace Sax this.exception = e; } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Benchmark/Support/Sax/SAXNotRecognizedException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/Support/Sax/SAXNotRecognizedException.cs b/src/Lucene.Net.Benchmark/Support/Sax/SAXNotRecognizedException.cs index e0ef4f5..26d4ac0 100644 --- a/src/Lucene.Net.Benchmark/Support/Sax/SAXNotRecognizedException.cs +++ b/src/Lucene.Net.Benchmark/Support/Sax/SAXNotRecognizedException.cs @@ -5,7 +5,7 @@ // $Id: SAXNotRecognizedException.java,v 1.7 2002/01/30 21:13:48 dbrownell Exp $ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -28,8 +28,9 @@ namespace Sax /// <author>David Megginson</author> /// <version>2.0.1 (sax2r2)</version> /// <see cref="SAXNotSupportedException"/> - // LUCENENET: All exeption classes should be marked serializable -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class SAXNotRecognizedException : SAXException @@ -51,7 +52,7 @@ namespace Sax { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Benchmark/Support/Sax/SAXNotSupportedException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/Support/Sax/SAXNotSupportedException.cs b/src/Lucene.Net.Benchmark/Support/Sax/SAXNotSupportedException.cs index d5184c9..2471d70 100644 --- a/src/Lucene.Net.Benchmark/Support/Sax/SAXNotSupportedException.cs +++ b/src/Lucene.Net.Benchmark/Support/Sax/SAXNotSupportedException.cs @@ -5,7 +5,7 @@ // $Id: SAXNotSupportedException.java,v 1.7 2002/01/30 21:13:48 dbrownell Exp $ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -29,8 +29,9 @@ namespace Sax /// <author>David Megginson</author> /// <version>2.0.1 (sax2r2)</version> /// <seealso cref="SAXNotRecognizedException"/> - // LUCENENET: All exeption classes should be marked serializable -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class SAXNotSupportedException : SAXException @@ -52,7 +53,7 @@ namespace Sax { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Benchmark/Support/Sax/SAXParseException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/Support/Sax/SAXParseException.cs b/src/Lucene.Net.Benchmark/Support/Sax/SAXParseException.cs index b7cdf64..ec55680 100644 --- a/src/Lucene.Net.Benchmark/Support/Sax/SAXParseException.cs +++ b/src/Lucene.Net.Benchmark/Support/Sax/SAXParseException.cs @@ -4,7 +4,7 @@ // $Id: SAXParseException.java,v 1.11 2004/04/21 13:05:02 dmegginson Exp $ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -37,7 +37,9 @@ namespace Sax /// <seealso cref="SAXException"/> /// <seealso cref="ILocator"/> /// <seealso cref="IErrorHandler"/> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class SAXParseException : SAXException @@ -47,15 +49,6 @@ namespace Sax ////////////////////////////////////////////////////////////////////// /// <summary> - /// Construct a new exception with no message. - /// </summary> - // LUCENENET specific for serialization - public SAXParseException() - : base() - { - } - - /// <summary> /// Create a new <see cref="SAXParseException"/> from a message and a <see cref="ILocator"/>. /// </summary> /// <remarks> @@ -159,7 +152,16 @@ namespace Sax Init(publicId, systemId, lineNumber, columnNumber); } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS + /// <summary> + /// Construct a new exception with no message. + /// </summary> + // LUCENENET specific for serialization + public SAXParseException(string message) + : base(message) + { + } + /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Classification/Lucene.Net.Classification.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Classification/Lucene.Net.Classification.csproj b/src/Lucene.Net.Classification/Lucene.Net.Classification.csproj index 617a614..33c19ca 100644 --- a/src/Lucene.Net.Classification/Lucene.Net.Classification.csproj +++ b/src/Lucene.Net.Classification/Lucene.Net.Classification.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -53,17 +53,15 @@ <ProjectReference Include="..\Lucene.Net.Queries\Lucene.Net.Queries.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj b/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj index 87f9112..369e4ab 100644 --- a/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj +++ b/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -52,17 +52,15 @@ <ProjectReference Include="..\Lucene.Net\Lucene.Net.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Expressions/JS/JavascriptLexer.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Expressions/JS/JavascriptLexer.cs b/src/Lucene.Net.Expressions/JS/JavascriptLexer.cs index a15505d..4f0bb7a 100644 --- a/src/Lucene.Net.Expressions/JS/JavascriptLexer.cs +++ b/src/Lucene.Net.Expressions/JS/JavascriptLexer.cs @@ -22,7 +22,7 @@ // ANTLR GENERATED CODE: DO NOT EDIT (LUCENENET: Not really auto generated in the port) using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif using Antlr.Runtime; @@ -2186,8 +2186,9 @@ loop2_break: ; } } - // LUCENENET: All exeption classes should be marked serializable -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class ParseException : Exception @@ -2197,13 +2198,13 @@ loop2_break: ; { } +#if FEATURE_SERIALIZABLE_EXCEPTIONS // For testing - internal ParseException(string message) + public ParseException(string message) : base(message) { } -#if FEATURE_SERIALIZABLE /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Expressions/Lucene.Net.Expressions.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Expressions/Lucene.Net.Expressions.csproj b/src/Lucene.Net.Expressions/Lucene.Net.Expressions.csproj index caeb18c..a5d140e 100644 --- a/src/Lucene.Net.Expressions/Lucene.Net.Expressions.csproj +++ b/src/Lucene.Net.Expressions/Lucene.Net.Expressions.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -54,20 +54,19 @@ </ItemGroup> <ItemGroup> - <!--<PackageReference Include="antlr3.runtime.netcore" Version="3.6.0-rc2" />--> <PackageReference Include="Antlr3.Runtime" Version="3.5.1" /> </ItemGroup> - <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> + <!--<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <PackageReference Include="System.Reflection.Emit" Version="4.3.0" /> <PackageReference Include="System.Reflection.Emit.ILGeneration" Version="4.3.0" /> <PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" /> </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);NETSTANDARD;FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <PackageReference Include="System.Reflection.Emit" Version="4.3.0" /> @@ -88,7 +87,7 @@ </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Facet/Lucene.Net.Facet.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Facet/Lucene.Net.Facet.csproj b/src/Lucene.Net.Facet/Lucene.Net.Facet.csproj index a7b9eda..996903c 100644 --- a/src/Lucene.Net.Facet/Lucene.Net.Facet.csproj +++ b/src/Lucene.Net.Facet/Lucene.Net.Facet.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -53,13 +53,12 @@ <ProjectReference Include="..\Lucene.Net.Queries\Lucene.Net.Queries.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> - <PackageReference Include="System.Threading.Thread" Version="4.0.0" /> + <PackageReference Include="System.Threading.Thread" Version="4.3.0" /> <PackageReference Include="System.Net.Primitives" Version="4.3.0" /> </ItemGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Grouping/Lucene.Net.Grouping.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Grouping/Lucene.Net.Grouping.csproj b/src/Lucene.Net.Grouping/Lucene.Net.Grouping.csproj index 804fafa..e852cd0 100644 --- a/src/Lucene.Net.Grouping/Lucene.Net.Grouping.csproj +++ b/src/Lucene.Net.Grouping/Lucene.Net.Grouping.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -53,17 +53,15 @@ <ProjectReference Include="..\Lucene.Net.Queries\Lucene.Net.Queries.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Highlighter/Highlight/InvalidTokenOffsetsException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Highlighter/Highlight/InvalidTokenOffsetsException.cs b/src/Lucene.Net.Highlighter/Highlight/InvalidTokenOffsetsException.cs index c0b7259..45e11c9 100644 --- a/src/Lucene.Net.Highlighter/Highlight/InvalidTokenOffsetsException.cs +++ b/src/Lucene.Net.Highlighter/Highlight/InvalidTokenOffsetsException.cs @@ -1,5 +1,5 @@ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -25,8 +25,10 @@ namespace Lucene.Net.Search.Highlight /// <summary> /// Exception thrown if TokenStream Tokens are incompatible with provided text /// </summary> -#if FEATURE_SERIALIZABLE - [Serializable] + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS + [Serializable] #endif public class InvalidTokenOffsetsException : Exception { @@ -42,7 +44,7 @@ namespace Lucene.Net.Search.Highlight { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj b/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj index 6d64e85..f549f38 100644 --- a/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj +++ b/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -53,10 +53,9 @@ <ProjectReference Include="..\Lucene.Net.Queries\Lucene.Net.Queries.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <PackageReference Include="System.Net.Primitives" Version="4.3.0" /> @@ -67,7 +66,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Join/Lucene.Net.Join.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Join/Lucene.Net.Join.csproj b/src/Lucene.Net.Join/Lucene.Net.Join.csproj index 54c6f48..aa26c23 100644 --- a/src/Lucene.Net.Join/Lucene.Net.Join.csproj +++ b/src/Lucene.Net.Join/Lucene.Net.Join.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -52,17 +52,15 @@ <ProjectReference Include="..\Lucene.Net.Grouping\Lucene.Net.Grouping.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Misc/Lucene.Net.Misc.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Misc/Lucene.Net.Misc.csproj b/src/Lucene.Net.Misc/Lucene.Net.Misc.csproj index 3b0ffed..b7c7b15 100644 --- a/src/Lucene.Net.Misc/Lucene.Net.Misc.csproj +++ b/src/Lucene.Net.Misc/Lucene.Net.Misc.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -53,17 +53,15 @@ <ProjectReference Include="..\Lucene.Net\Lucene.Net.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs index ea648c4..bcd22fb 100644 --- a/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs +++ b/src/Lucene.Net.Queries/Function/DocValues/DocTermsIndexDocValues.cs @@ -3,7 +3,7 @@ using Lucene.Net.Search; using Lucene.Net.Util; using Lucene.Net.Util.Mutable; using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -205,8 +205,9 @@ namespace Lucene.Net.Queries.Function.DocValues /// <summary> /// Custom <see cref="Exception"/> to be thrown when the DocTermsIndex for a field cannot be generated /// </summary> - // LUCENENET: All exeption classes should be marked serializable -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public sealed class DocTermsIndexException : Exception @@ -214,15 +215,15 @@ namespace Lucene.Net.Queries.Function.DocValues public DocTermsIndexException(string fieldName, Exception cause) : base("Can't initialize DocTermsIndex to generate (function) FunctionValues for field: " + fieldName, cause) { - } + } +#if FEATURE_SERIALIZABLE_EXCEPTIONS // For testing - internal DocTermsIndexException(string message) + public DocTermsIndexException(string message) : base(message) { } -#if FEATURE_SERIALIZABLE /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Queries/Lucene.Net.Queries.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Queries/Lucene.Net.Queries.csproj b/src/Lucene.Net.Queries/Lucene.Net.Queries.csproj index b95b5ae..b89d69c 100644 --- a/src/Lucene.Net.Queries/Lucene.Net.Queries.csproj +++ b/src/Lucene.Net.Queries/Lucene.Net.Queries.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -52,17 +52,16 @@ <ProjectReference Include="..\Lucene.Net\Lucene.Net.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Classic/ParseException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Classic/ParseException.cs b/src/Lucene.Net.QueryParser/Classic/ParseException.cs index a258342..f5dc29e 100644 --- a/src/Lucene.Net.QueryParser/Classic/ParseException.cs +++ b/src/Lucene.Net.QueryParser/Classic/ParseException.cs @@ -1,7 +1,7 @@ using Lucene.Net.Support; using System; using System.Diagnostics.CodeAnalysis; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif using System.Text; @@ -25,19 +25,21 @@ namespace Lucene.Net.QueryParsers.Classic * limitations under the License. */ - /// <summary> + /// <summary> /// This exception is thrown when parse errors are encountered. - /// You can explicitly create objects of this exception type by - /// calling the method GenerateParseException in the generated - /// parser. - /// - /// You can modify this class to customize your error reporting - /// mechanisms so long as you retain the public fields. - /// </summary> -#if FEATURE_SERIALIZABLE + /// You can explicitly create objects of this exception type by + /// calling the method GenerateParseException in the generated + /// parser. + /// + /// You can modify this class to customize your error reporting + /// mechanisms so long as you retain the public fields. + /// </summary> + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif - public class ParseException : Exception + public class ParseException : Exception { /// <summary> /// This constructor is used by the method GenerateParseException() @@ -76,7 +78,7 @@ namespace Lucene.Net.QueryParsers.Classic : base(message, innerException) { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Classic/QueryParser.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParser.cs b/src/Lucene.Net.QueryParser/Classic/QueryParser.cs index c71b1a7..a525a98 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParser.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParser.cs @@ -4,7 +4,7 @@ using Lucene.Net.Util; using System; using System.Collections.Generic; using System.IO; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -702,7 +702,9 @@ namespace Lucene.Net.QueryParsers.Classic throw GenerateParseException(); } -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif private sealed class LookaheadSuccess : Exception @@ -710,7 +712,7 @@ namespace Lucene.Net.QueryParsers.Classic public LookaheadSuccess() { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs index dcc4d64..65634bc 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs @@ -10,7 +10,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.IO; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif using System.Text; @@ -55,8 +55,9 @@ namespace Lucene.Net.QueryParsers.Classic /// <summary> /// Do not catch this exception in your code, it means you are using methods that you should no longer use. /// </summary> - // LUCENENET: All exeption classes should be marked serializable -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class MethodRemovedUseAnother : Exception @@ -64,7 +65,7 @@ namespace Lucene.Net.QueryParsers.Classic public MethodRemovedUseAnother() { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Classic/TokenMgrError.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Classic/TokenMgrError.cs b/src/Lucene.Net.QueryParser/Classic/TokenMgrError.cs index ad0d642..68564ef 100644 --- a/src/Lucene.Net.QueryParser/Classic/TokenMgrError.cs +++ b/src/Lucene.Net.QueryParser/Classic/TokenMgrError.cs @@ -1,5 +1,5 @@ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif using System.Text; @@ -23,11 +23,13 @@ namespace Lucene.Net.QueryParsers.Classic * limitations under the License. */ - /// <summary>Token Manager Error. </summary> -#if FEATURE_SERIALIZABLE + /// <summary>Token Manager Error. </summary> + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif - public class TokenMgrError : Exception + public class TokenMgrError : Exception { /* * Ordinals for various reasons why an Error of this type can be thrown. @@ -172,7 +174,7 @@ namespace Lucene.Net.QueryParsers.Classic { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeError.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeError.cs b/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeError.cs index 22c69ea..1a3cb13 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeError.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeError.cs @@ -1,6 +1,6 @@ using Lucene.Net.QueryParsers.Flexible.Messages; using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -28,7 +28,9 @@ namespace Lucene.Net.QueryParsers.Flexible.Core /// </summary> /// <seealso cref="NLS"/> /// <seealso cref="IMessage"/> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class QueryNodeError : Exception, INLSException @@ -66,12 +68,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Core this.message = message; } +#if FEATURE_SERIALIZABLE_EXCEPTIONS // For testing - internal QueryNodeError(string message) + public QueryNodeError(string message) : base(message) { } -#if FEATURE_SERIALIZABLE /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> @@ -83,10 +85,10 @@ namespace Lucene.Net.QueryParsers.Flexible.Core } #endif - /// <summary> - /// <see cref="INLSException.MessageObject"/> - /// </summary> - public virtual IMessage MessageObject + /// <summary> + /// <see cref="INLSException.MessageObject"/> + /// </summary> + public virtual IMessage MessageObject { get { return this.message; } } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeException.cs b/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeException.cs index 4b4e263..13ab9c7 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeException.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeException.cs @@ -2,7 +2,7 @@ using Lucene.Net.QueryParsers.Flexible.Messages; using System; using System.Globalization; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -36,7 +36,9 @@ namespace Lucene.Net.QueryParsers.Flexible.Core /// <seealso cref="NLS"/> /// <seealso cref="INLSException"/> /// <seealso cref="Nodes.IQueryNode"/> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class QueryNodeException : Exception, INLSException @@ -60,12 +62,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Core this.m_message = message; } +#if FEATURE_SERIALIZABLE_EXCEPTIONS // For testing - internal QueryNodeException(string message) + public QueryNodeException(string message) : base(message) { } -#if FEATURE_SERIALIZABLE /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeParseException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeParseException.cs b/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeParseException.cs index 96b5d8e..514ce34 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeParseException.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Core/QueryNodeParseException.cs @@ -1,7 +1,7 @@ using Lucene.Net.QueryParsers.Flexible.Core.Messages; using Lucene.Net.QueryParsers.Flexible.Messages; using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -31,7 +31,9 @@ namespace Lucene.Net.QueryParsers.Flexible.Core /// <seealso cref="QueryNodeException"/> /// <seealso cref="Parser.ISyntaxParser"/> /// <seealso cref="Nodes.IQueryNode"/> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class QueryNodeParseException : QueryNodeException @@ -59,12 +61,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Core { } +#if FEATURE_SERIALIZABLE_EXCEPTIONS // For testing - internal QueryNodeParseException(string message) + public QueryNodeParseException(string message) : base(message) { } -#if FEATURE_SERIALIZABLE /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/ParseException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/ParseException.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/ParseException.cs index c6c3927..ebb7c58 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/ParseException.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/ParseException.cs @@ -4,7 +4,7 @@ using Lucene.Net.QueryParsers.Flexible.Messages; using Lucene.Net.Support; using System; using System.Diagnostics.CodeAnalysis; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif using System.Text; @@ -37,7 +37,9 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Parser /// You can modify this class to customize your error reporting /// mechanisms so long as you retain the public fields. /// </summary> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class ParseException : QueryNodeParseException @@ -80,7 +82,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Parser { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/StandardSyntaxParser.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/StandardSyntaxParser.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/StandardSyntaxParser.cs index ee67925..0cc249d 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/StandardSyntaxParser.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/StandardSyntaxParser.cs @@ -8,7 +8,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.IO; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -1077,7 +1077,9 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Parser throw GenerateParseException(); } -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif internal sealed class LookaheadSuccess : Exception @@ -1085,7 +1087,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Parser public LookaheadSuccess() { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/TokenMgrError.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/TokenMgrError.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/TokenMgrError.cs index 5187213..06cf2ff 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/TokenMgrError.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/TokenMgrError.cs @@ -1,6 +1,6 @@ using Lucene.Net.Support; using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif using System.Text; @@ -27,7 +27,9 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Parser /// <summary> /// Token Manager Error. /// </summary> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class TokenMgrError : Exception @@ -175,7 +177,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Parser { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj b/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj index c16b002..5b28210 100644 --- a/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj +++ b/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj @@ -55,7 +55,7 @@ </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE;FEATURE_CLONEABLE;FEATURE_XSLT</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_CLONEABLE;FEATURE_XSLT;FEATURE_SERIALIZABLE</DefineConstants> <DebugType>portable</DebugType> </PropertyGroup> @@ -68,7 +68,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE;FEATURE_CLONEABLE;FEATURE_XSLT</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_CLONEABLE;FEATURE_XSLT;FEATURE_SERIALIZABLE;FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs b/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs index 59f44da..7d14284 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs @@ -1,7 +1,7 @@ using Lucene.Net.Support; using System; using System.Diagnostics.CodeAnalysis; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif using System.Text; @@ -34,7 +34,9 @@ namespace Lucene.Net.QueryParsers.Surround.Parser /// You can modify this class to customize your error reporting /// mechanisms so long as you retain the public fields. /// </summary> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class ParseException : Exception @@ -76,7 +78,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser : base(message, innerException) { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs index ab5fbac..fd90c8f 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.IO; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -692,7 +692,9 @@ namespace Lucene.Net.QueryParsers.Surround.Parser throw GenerateParseException(); } -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif private sealed class LookaheadSuccess : Exception @@ -700,7 +702,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser public LookaheadSuccess() { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Surround/Parser/TokenMgrError.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/TokenMgrError.cs b/src/Lucene.Net.QueryParser/Surround/Parser/TokenMgrError.cs index 902d0f7..be9d2d3 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/TokenMgrError.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/TokenMgrError.cs @@ -1,5 +1,5 @@ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif using System.Text; @@ -23,11 +23,13 @@ namespace Lucene.Net.QueryParsers.Surround.Parser * limitations under the License. */ - /// <summary>Token Manager Error. </summary> -#if FEATURE_SERIALIZABLE + /// <summary>Token Manager Error. </summary> + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif - public class TokenMgrError : Exception + public class TokenMgrError : Exception { /* * Ordinals for various reasons why an Error of this type can be thrown. @@ -172,7 +174,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Surround/Query/TooManyBasicQueries.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Surround/Query/TooManyBasicQueries.cs b/src/Lucene.Net.QueryParser/Surround/Query/TooManyBasicQueries.cs index 2a5c978..e3e1da8 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/TooManyBasicQueries.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/TooManyBasicQueries.cs @@ -1,5 +1,5 @@ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -26,7 +26,9 @@ namespace Lucene.Net.QueryParsers.Surround.Query /// Exception thrown when <see cref="BasicQueryFactory"/> would exceed the limit /// of query clauses. /// </summary> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class TooManyBasicQueries : System.IO.IOException @@ -35,12 +37,12 @@ namespace Lucene.Net.QueryParsers.Surround.Query : base("Exceeded maximum of " + maxBasicQueries + " basic queries.") { } +#if FEATURE_SERIALIZABLE_EXCEPTIONS // For testing - internal TooManyBasicQueries(string message) + public TooManyBasicQueries(string message) : base(message) { } -#if FEATURE_SERIALIZABLE /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.QueryParser/Xml/ParserException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.QueryParser/Xml/ParserException.cs b/src/Lucene.Net.QueryParser/Xml/ParserException.cs index cd2e59b..0f9ad45 100644 --- a/src/Lucene.Net.QueryParser/Xml/ParserException.cs +++ b/src/Lucene.Net.QueryParser/Xml/ParserException.cs @@ -1,5 +1,5 @@ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -26,7 +26,9 @@ namespace Lucene.Net.QueryParsers.Xml /// Thrown when the xml queryparser encounters /// invalid syntax/configuration. /// </summary> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class ParserException : Exception @@ -51,7 +53,7 @@ namespace Lucene.Net.QueryParsers.Xml { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Replicator/Lucene.Net.Replicator.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Replicator/Lucene.Net.Replicator.csproj b/src/Lucene.Net.Replicator/Lucene.Net.Replicator.csproj index d80977f..976690f 100644 --- a/src/Lucene.Net.Replicator/Lucene.Net.Replicator.csproj +++ b/src/Lucene.Net.Replicator/Lucene.Net.Replicator.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -57,17 +57,16 @@ <PackageReference Include="Newtonsoft.Json" Version="9.0.1" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Replicator/SessionExpiredException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Replicator/SessionExpiredException.cs b/src/Lucene.Net.Replicator/SessionExpiredException.cs index 45c16a1..caa70bf 100644 --- a/src/Lucene.Net.Replicator/SessionExpiredException.cs +++ b/src/Lucene.Net.Replicator/SessionExpiredException.cs @@ -1,6 +1,6 @@ using System; using System.IO; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -31,8 +31,9 @@ namespace Lucene.Net.Replicator /// </remarks> /// <seealso cref="LocalReplicator.DEFAULT_SESSION_EXPIRATION_THRESHOLD"/> /// <seealso cref="LocalReplicator.ExpirationThreshold"/> - // LUCENENET: All exeption classes should be marked serializable -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class SessionExpiredException : IOException @@ -58,7 +59,7 @@ namespace Lucene.Net.Replicator { } -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Sandbox/Lucene.Net.Sandbox.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Sandbox/Lucene.Net.Sandbox.csproj b/src/Lucene.Net.Sandbox/Lucene.Net.Sandbox.csproj index 848b2a1..5e2e8c5 100644 --- a/src/Lucene.Net.Sandbox/Lucene.Net.Sandbox.csproj +++ b/src/Lucene.Net.Sandbox/Lucene.Net.Sandbox.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -52,17 +52,15 @@ <ProjectReference Include="..\Lucene.Net\Lucene.Net.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Spatial/Lucene.Net.Spatial.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Spatial/Lucene.Net.Spatial.csproj b/src/Lucene.Net.Spatial/Lucene.Net.Spatial.csproj index f643551..f931900 100644 --- a/src/Lucene.Net.Spatial/Lucene.Net.Spatial.csproj +++ b/src/Lucene.Net.Spatial/Lucene.Net.Spatial.csproj @@ -72,7 +72,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE;FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Spatial/Query/UnsupportedSpatialOperation.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Spatial/Query/UnsupportedSpatialOperation.cs b/src/Lucene.Net.Spatial/Query/UnsupportedSpatialOperation.cs index db6d79b..889c3e7 100644 --- a/src/Lucene.Net.Spatial/Query/UnsupportedSpatialOperation.cs +++ b/src/Lucene.Net.Spatial/Query/UnsupportedSpatialOperation.cs @@ -1,5 +1,5 @@ using System; -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using System.Runtime.Serialization; #endif @@ -27,7 +27,9 @@ namespace Lucene.Net.Spatial.Queries /// /// @lucene.experimental /// </summary> -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class UnsupportedSpatialOperation : NotSupportedException @@ -37,13 +39,13 @@ namespace Lucene.Net.Spatial.Queries { } +#if FEATURE_SERIALIZABLE_EXCEPTIONS // For testing - internal UnsupportedSpatialOperation(string message) + public UnsupportedSpatialOperation(string message) : base(message) { } -#if FEATURE_SERIALIZABLE /// <summary> /// Initializes a new instance of this class with serialized data. /// </summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Suggest/Lucene.Net.Suggest.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Suggest/Lucene.Net.Suggest.csproj b/src/Lucene.Net.Suggest/Lucene.Net.Suggest.csproj index b7c2b14..075b552 100644 --- a/src/Lucene.Net.Suggest/Lucene.Net.Suggest.csproj +++ b/src/Lucene.Net.Suggest/Lucene.Net.Suggest.csproj @@ -24,7 +24,7 @@ <Import Project="..\..\Version.proj" /> <PropertyGroup> - <TargetFrameworks>netstandard2.0;netstandard1.5;net451</TargetFrameworks> + <TargetFrameworks>netstandard1.5;net451</TargetFrameworks> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback> <!--<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>--> @@ -54,17 +54,15 @@ <ProjectReference Include="..\Lucene.Net.Queries\Lucene.Net.Queries.csproj" /> </ItemGroup> - <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <!--<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DebugType>portable</DebugType> - </PropertyGroup> + </PropertyGroup>--> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' "> <DebugType>portable</DebugType> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj b/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj index f1b809c..721adc2 100644 --- a/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj +++ b/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj @@ -62,7 +62,7 @@ </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> - <DefineConstants>$(DefineConstants);NETSTANDARD;FEATURE_SERIALIZABLE;FEATURE_CONCURRENTMERGESCHEDULER</DefineConstants> + <DefineConstants>$(DefineConstants);NETSTANDARD;FEATURE_CONCURRENTMERGESCHEDULER;FEATURE_SERIALIZABLE</DefineConstants> <DebugType>portable</DebugType> </PropertyGroup> @@ -79,7 +79,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE;FEATURE_CONCURRENTMERGESCHEDULER</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_CONCURRENTMERGESCHEDULER;FEATURE_SERIALIZABLE;FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.TestFramework/Randomized/InternalAssumptionViolatedException.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Randomized/InternalAssumptionViolatedException.cs b/src/Lucene.Net.TestFramework/Randomized/InternalAssumptionViolatedException.cs index 87a3525..bcafca8 100644 --- a/src/Lucene.Net.TestFramework/Randomized/InternalAssumptionViolatedException.cs +++ b/src/Lucene.Net.TestFramework/Randomized/InternalAssumptionViolatedException.cs @@ -16,10 +16,15 @@ */ using System; +#if FEATURE_SERIALIZABLE_EXCEPTIONS +using System.Runtime.Serialization; +#endif namespace Lucene.Net.Randomized { -#if FEATURE_SERIALIZABLE + // LUCENENET: It is no longer good practice to use binary serialization. + // See: https://github.com/dotnet/corefx/issues/23584#issuecomment-325724568 +#if FEATURE_SERIALIZABLE_EXCEPTIONS [Serializable] #endif public class InternalAssumptionViolatedException : NUnit.Framework.InconclusiveException @@ -31,5 +36,17 @@ namespace Lucene.Net.Randomized public InternalAssumptionViolatedException(string message, Exception inner) : base(message, inner) { } + +#if FEATURE_SERIALIZABLE_EXCEPTIONS + /// <summary> + /// Initializes a new instance of this class with serialized data. + /// </summary> + /// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param> + /// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param> + public InternalAssumptionViolatedException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } +#endif } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj index 508c738..fcbd97b 100644 --- a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj +++ b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj @@ -59,7 +59,7 @@ </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' "> - <DefineConstants>$(DefineConstants);NETSTANDARD;FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants> <DebugType>portable</DebugType> </PropertyGroup> @@ -69,7 +69,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net451' "> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants> <DebugType>full</DebugType> </PropertyGroup> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71612621/src/Lucene.Net.Tests.Analysis.Common/Support/TestExceptionSerialization.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Analysis.Common/Support/TestExceptionSerialization.cs b/src/Lucene.Net.Tests.Analysis.Common/Support/TestExceptionSerialization.cs index f0eacba..de2fce9 100644 --- a/src/Lucene.Net.Tests.Analysis.Common/Support/TestExceptionSerialization.cs +++ b/src/Lucene.Net.Tests.Analysis.Common/Support/TestExceptionSerialization.cs @@ -1,4 +1,4 @@ -#if FEATURE_SERIALIZABLE +#if FEATURE_SERIALIZABLE_EXCEPTIONS using Lucene.Net.Attributes; using NUnit.Framework; using System;
