@@ -65,7 +65,7 @@ public override object ReadJson(
6565
6666 var token = JToken . Load ( reader ) ;
6767 var count = token . Children ( ) . Count ( ) ;
68-
68+
6969#pragma warning disable CA1062 // Validate arguments of public methods
7070 if ( mainType . GenericTypeArguments . Length == 1 )
7171#pragma warning restore CA1062 // Validate arguments of public methods
@@ -117,11 +117,10 @@ public override object ReadJson(
117117 for ( var i = mainType . GenericTypeArguments . Length - 1 ; i >= 0 ; i -- )
118118 {
119119 var type = mainType . GenericTypeArguments [ i ] ;
120- object args = null ;
121120
122121 try
123122 {
124- args = ParseTokenArguments ( token , tokenType , type , value ) ;
123+ var args = ParseTokenArguments ( token , tokenType , type , value ) ;
125124
126125 if ( args != null )
127126 {
@@ -227,7 +226,7 @@ private static object ParseTokenArguments(JToken token, JsonToken tokenType, Typ
227226 {
228227 const string SCHEMA_ORG = "http://schema.org/" ;
229228 const int SCHEMA_ORG_LENGTH = 18 ; // equivalent to "http://schema.org/".Length
230- object args = null ;
229+ object args ;
231230 var unwrappedType = type . GetUnderlyingTypeFromNullable ( ) ;
232231 if ( unwrappedType . GetTypeInfo ( ) . IsEnum )
233232 {
@@ -506,28 +505,6 @@ private static IList ReadJsonArray(JToken token, Type type, int? count = null)
506505 return ( IList ) list ;
507506 }
508507
509- private static IEnumerable < Type > GetTypeHierarchy ( Type type )
510- {
511- if ( type == null )
512- {
513- yield break ;
514- }
515-
516- var tt = type . GetTypeInfo ( ) . GetNestedTypes ( BindingFlags . Public ) ;
517-
518- foreach ( var t in tt )
519- {
520- yield return t ;
521- }
522-
523- var ii = type . GetInterfaces ( ) ;
524-
525- foreach ( var i in ii )
526- {
527- yield return i ;
528- }
529- }
530-
531508 private static string GetTypeNameFromToken ( JToken token )
532509 {
533510 var o = token as JObject ;
0 commit comments