Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 6321e25

Browse files
committed
remove mocking of abstract type until proper use-case is found
1 parent 010d649 commit 6321e25

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

src/ServiceStack.Text/JsConfig.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,6 @@ public static DeserializationErrorDelegate OnDeserializationError
538538

539539
public static HashSet<Type> TreatValueAsRefTypes = new HashSet<Type>();
540540

541-
public static HashSet<Type> TreatAsAbstractType = new HashSet<Type>();
542-
543541
private static bool? sPreferInterfaces;
544542
/// <summary>
545543
/// If set to true, Interface types will be prefered over concrete types when serializing.
@@ -715,7 +713,6 @@ public static void Reset()
715713
HasSerializeFn = new HashSet<Type>();
716714
HasIncludeDefaultValue = new HashSet<Type>();
717715
TreatValueAsRefTypes = new HashSet<Type> { typeof(KeyValuePair<,>) };
718-
TreatAsAbstractType = new HashSet<Type>();
719716
sPropertyConvention = null;
720717
sExcludePropertyReferences = null;
721718
sExcludeTypes = new HashSet<Type> { typeof(Stream) };
@@ -772,23 +769,6 @@ public class JsConfig<T>
772769
/// </summary>
773770
public static bool? ExcludeTypeInfo = null;
774771

775-
/// <summary>
776-
/// Treat non-abstract type like an abstract type
777-
/// </summary>
778-
public static bool TreatAsAbstractType
779-
{
780-
get { return JsConfig.TreatAsAbstractType.Contains(typeof(T)); }
781-
set
782-
{
783-
if (value)
784-
JsConfig.TreatAsAbstractType.Add(typeof(T));
785-
else
786-
JsConfig.TreatAsAbstractType.Remove(typeof(T));
787-
788-
ClearFnCaches();
789-
}
790-
}
791-
792772
/// <summary>
793773
/// <see langword="true"/> if the <see cref="ITypeSerializer"/> is configured
794774
/// to take advantage of <see cref="CLSCompliantAttribute"/> specification,

src/ServiceStack.Text/ReflectionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,9 +1539,9 @@ public static bool IsStandardClass(this Type type)
15391539
public static bool IsAbstract(this Type type)
15401540
{
15411541
#if (NETFX_CORE || PCL)
1542-
return type.GetTypeInfo().IsAbstract || JsConfig.TreatAsAbstractType.Contains(type);
1542+
return type.GetTypeInfo().IsAbstract;
15431543
#else
1544-
return type.IsAbstract || JsConfig.TreatAsAbstractType.Contains(type);
1544+
return type.IsAbstract;
15451545
#endif
15461546
}
15471547

0 commit comments

Comments
 (0)