@@ -55,7 +55,7 @@ public void ClearAllPools()
5555 foreach ( KeyValuePair < DbConnectionPoolKey , DbConnectionPoolGroup > entry in connectionPoolGroups )
5656 {
5757 DbConnectionPoolGroup poolGroup = entry . Value ;
58- if ( null != poolGroup )
58+ if ( poolGroup != null )
5959 {
6060 poolGroup . Clear ( ) ;
6161 }
@@ -69,7 +69,7 @@ public void ClearPool(DbConnection connection)
6969 using ( TryEventScope . Create ( "<prov.DbConnectionFactory.ClearPool|API> {0}" , GetObjectId ( connection ) ) )
7070 {
7171 DbConnectionPoolGroup poolGroup = GetConnectionPoolGroup ( connection ) ;
72- if ( null != poolGroup )
72+ if ( poolGroup != null )
7373 {
7474 poolGroup . Clear ( ) ;
7575 }
@@ -98,15 +98,15 @@ internal virtual DbConnectionPoolProviderInfo CreateConnectionPoolProviderInfo(D
9898
9999 internal DbConnectionInternal CreateNonPooledConnection ( DbConnection owningConnection , DbConnectionPoolGroup poolGroup , DbConnectionOptions userOptions )
100100 {
101- Debug . Assert ( null != owningConnection , "null owningConnection?" ) ;
102- Debug . Assert ( null != poolGroup , "null poolGroup?" ) ;
101+ Debug . Assert ( owningConnection != null , "null owningConnection?" ) ;
102+ Debug . Assert ( poolGroup != null , "null poolGroup?" ) ;
103103
104104 DbConnectionOptions connectionOptions = poolGroup . ConnectionOptions ;
105105 DbConnectionPoolGroupProviderInfo poolGroupProviderInfo = poolGroup . ProviderInfo ;
106106 DbConnectionPoolKey poolKey = poolGroup . PoolKey ;
107107
108108 DbConnectionInternal newConnection = CreateConnection ( connectionOptions , poolKey , poolGroupProviderInfo , null , owningConnection , userOptions ) ;
109- if ( null != newConnection )
109+ if ( newConnection != null )
110110 {
111111 SqlClientEventSource . Log . HardConnectRequest ( ) ;
112112 newConnection . MakeNonPooledObject ( owningConnection ) ;
@@ -117,11 +117,11 @@ internal DbConnectionInternal CreateNonPooledConnection(DbConnection owningConne
117117
118118 internal DbConnectionInternal CreatePooledConnection ( DbConnectionPool pool , DbConnection owningObject , DbConnectionOptions options , DbConnectionPoolKey poolKey , DbConnectionOptions userOptions )
119119 {
120- Debug . Assert ( null != pool , "null pool?" ) ;
120+ Debug . Assert ( pool != null , "null pool?" ) ;
121121 DbConnectionPoolGroupProviderInfo poolGroupProviderInfo = pool . PoolGroup . ProviderInfo ;
122122
123123 DbConnectionInternal newConnection = CreateConnection ( options , poolKey , poolGroupProviderInfo , pool , owningObject , userOptions ) ;
124- if ( null != newConnection )
124+ if ( newConnection != null )
125125 {
126126 SqlClientEventSource . Log . HardConnectRequest ( ) ;
127127 newConnection . MakePooledConnection ( pool ) ;
@@ -167,8 +167,8 @@ private DbConnectionPool GetConnectionPool(DbConnection owningObject, DbConnecti
167167 {
168168 // if poolgroup is disabled, it will be replaced with a new entry
169169
170- Debug . Assert ( null != owningObject , "null owningObject?" ) ;
171- Debug . Assert ( null != connectionPoolGroup , "null connectionPoolGroup?" ) ;
170+ Debug . Assert ( owningObject != null , "null owningObject?" ) ;
171+ Debug . Assert ( connectionPoolGroup != null , "null connectionPoolGroup?" ) ;
172172
173173 // It is possible that while the outer connection object has
174174 // been sitting around in a closed and unused state in some long
@@ -179,7 +179,7 @@ private DbConnectionPool GetConnectionPool(DbConnection owningObject, DbConnecti
179179 // re-create the pool entry whenever it's disabled.
180180
181181 // however, don't rebuild connectionOptions if no pooling is involved - let new connections do that work
182- if ( connectionPoolGroup . IsDisabled && ( null != connectionPoolGroup . PoolGroupOptions ) )
182+ if ( connectionPoolGroup . IsDisabled && connectionPoolGroup . PoolGroupOptions != null )
183183 {
184184 SqlClientEventSource . Log . TryTraceEvent ( "<prov.DbConnectionFactory.GetConnectionPool|RES|INFO|CPOOL> {0}, DisabledPoolGroup={1}" , ObjectID , connectionPoolGroup ? . ObjectID ) ;
185185
@@ -188,10 +188,10 @@ private DbConnectionPool GetConnectionPool(DbConnection owningObject, DbConnecti
188188
189189 // get the string to hash on again
190190 DbConnectionOptions connectionOptions = connectionPoolGroup . ConnectionOptions ;
191- Debug . Assert ( null != connectionOptions , "prevent expansion of connectionString" ) ;
191+ Debug . Assert ( connectionOptions != null , "prevent expansion of connectionString" ) ;
192192
193193 connectionPoolGroup = GetConnectionPoolGroup ( connectionPoolGroup . PoolKey , poolOptions , ref connectionOptions ) ;
194- Debug . Assert ( null != connectionPoolGroup , "null connectionPoolGroup?" ) ;
194+ Debug . Assert ( connectionPoolGroup != null , "null connectionPoolGroup?" ) ;
195195 SetConnectionPoolGroup ( owningObject , connectionPoolGroup ) ;
196196 }
197197 DbConnectionPool connectionPool = connectionPoolGroup . GetConnectionPool ( this ) ;
@@ -207,7 +207,7 @@ internal DbConnectionPoolGroup GetConnectionPoolGroup(DbConnectionPoolKey key, D
207207
208208 DbConnectionPoolGroup connectionPoolGroup ;
209209 Dictionary < DbConnectionPoolKey , DbConnectionPoolGroup > connectionPoolGroups = _connectionPoolGroups ;
210- if ( ! connectionPoolGroups . TryGetValue ( key , out connectionPoolGroup ) || ( connectionPoolGroup . IsDisabled && ( null != connectionPoolGroup . PoolGroupOptions ) ) )
210+ if ( ! connectionPoolGroups . TryGetValue ( key , out connectionPoolGroup ) || ( connectionPoolGroup . IsDisabled && connectionPoolGroup . PoolGroupOptions != null ) )
211211 {
212212 // If we can't find an entry for the connection string in
213213 // our collection of pool entries, then we need to create a
@@ -238,7 +238,7 @@ internal DbConnectionPoolGroup GetConnectionPoolGroup(DbConnectionPoolKey key, D
238238 // We don't support connection pooling on Win9x
239239 if ( poolOptions == null )
240240 {
241- if ( null != connectionPoolGroup )
241+ if ( connectionPoolGroup != null )
242242 {
243243 // reusing existing pool option in case user originally used SetConnectionPoolOptions
244244 poolOptions = connectionPoolGroup . PoolGroupOptions ;
@@ -276,8 +276,8 @@ internal DbConnectionPoolGroup GetConnectionPoolGroup(DbConnectionPoolKey key, D
276276 Debug . Assert ( ! connectionPoolGroup . IsDisabled , "Disabled pool entry discovered" ) ;
277277 }
278278 }
279- Debug . Assert ( null != connectionPoolGroup , "how did we not create a pool entry?" ) ;
280- Debug . Assert ( null != userConnectionOptions , "how did we not have user connection options?" ) ;
279+ Debug . Assert ( connectionPoolGroup != null , "how did we not create a pool entry?" ) ;
280+ Debug . Assert ( userConnectionOptions != null , "how did we not have user connection options?" ) ;
281281 }
282282 else if ( userConnectionOptions == null )
283283 {
@@ -303,7 +303,7 @@ private void PruneConnectionPoolGroups(object state)
303303 DbConnectionPool [ ] poolsToRelease = _poolsToRelease . ToArray ( ) ;
304304 foreach ( DbConnectionPool pool in poolsToRelease )
305305 {
306- if ( null != pool )
306+ if ( pool != null )
307307 {
308308 pool . Clear ( ) ;
309309
@@ -328,7 +328,7 @@ private void PruneConnectionPoolGroups(object state)
328328 DbConnectionPoolGroup [ ] poolGroupsToRelease = _poolGroupsToRelease . ToArray ( ) ;
329329 foreach ( DbConnectionPoolGroup poolGroup in poolGroupsToRelease )
330330 {
331- if ( null != poolGroup )
331+ if ( poolGroup != null )
332332 {
333333 int poolsLeft = poolGroup . Clear ( ) ; // may add entries to _poolsToRelease
334334
@@ -353,7 +353,7 @@ private void PruneConnectionPoolGroups(object state)
353353
354354 foreach ( KeyValuePair < DbConnectionPoolKey , DbConnectionPoolGroup > entry in connectionPoolGroups )
355355 {
356- if ( null != entry . Value )
356+ if ( entry . Value != null )
357357 {
358358 Debug . Assert ( ! entry . Value . IsDisabled , "Disabled pool entry discovered" ) ;
359359
@@ -380,7 +380,7 @@ internal void QueuePoolForRelease(DbConnectionPool pool, bool clearing)
380380 // Queue the pool up for release -- we'll clear it out and dispose
381381 // of it as the last part of the pruning timer callback so we don't
382382 // do it with the pool entry or the pool collection locked.
383- Debug . Assert ( null != pool , "null pool?" ) ;
383+ Debug . Assert ( pool != null , "null pool?" ) ;
384384
385385 // set the pool to the shutdown state to force all active
386386 // connections to be automatically disposed when they
@@ -401,7 +401,7 @@ internal void QueuePoolForRelease(DbConnectionPool pool, bool clearing)
401401
402402 internal void QueuePoolGroupForRelease ( DbConnectionPoolGroup poolGroup )
403403 {
404- Debug . Assert ( null != poolGroup , "null poolGroup?" ) ;
404+ Debug . Assert ( poolGroup != null , "null poolGroup?" ) ;
405405 SqlClientEventSource . Log . TryTraceEvent ( "<prov.DbConnectionFactory.QueuePoolGroupForRelease|RES|INFO|CPOOL> {0}, poolGroup={1}" , ObjectID , poolGroup . ObjectID ) ;
406406
407407 lock ( _poolGroupsToRelease )
0 commit comments