@@ -55,7 +55,7 @@ public void ClearAllPools()
55
55
foreach ( KeyValuePair < DbConnectionPoolKey , DbConnectionPoolGroup > entry in connectionPoolGroups )
56
56
{
57
57
DbConnectionPoolGroup poolGroup = entry . Value ;
58
- if ( null != poolGroup )
58
+ if ( poolGroup != null )
59
59
{
60
60
poolGroup . Clear ( ) ;
61
61
}
@@ -69,7 +69,7 @@ public void ClearPool(DbConnection connection)
69
69
using ( TryEventScope . Create ( "<prov.DbConnectionFactory.ClearPool|API> {0}" , GetObjectId ( connection ) ) )
70
70
{
71
71
DbConnectionPoolGroup poolGroup = GetConnectionPoolGroup ( connection ) ;
72
- if ( null != poolGroup )
72
+ if ( poolGroup != null )
73
73
{
74
74
poolGroup . Clear ( ) ;
75
75
}
@@ -98,15 +98,15 @@ internal virtual DbConnectionPoolProviderInfo CreateConnectionPoolProviderInfo(D
98
98
99
99
internal DbConnectionInternal CreateNonPooledConnection ( DbConnection owningConnection , DbConnectionPoolGroup poolGroup , DbConnectionOptions userOptions )
100
100
{
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?" ) ;
103
103
104
104
DbConnectionOptions connectionOptions = poolGroup . ConnectionOptions ;
105
105
DbConnectionPoolGroupProviderInfo poolGroupProviderInfo = poolGroup . ProviderInfo ;
106
106
DbConnectionPoolKey poolKey = poolGroup . PoolKey ;
107
107
108
108
DbConnectionInternal newConnection = CreateConnection ( connectionOptions , poolKey , poolGroupProviderInfo , null , owningConnection , userOptions ) ;
109
- if ( null != newConnection )
109
+ if ( newConnection != null )
110
110
{
111
111
SqlClientEventSource . Log . HardConnectRequest ( ) ;
112
112
newConnection . MakeNonPooledObject ( owningConnection ) ;
@@ -117,11 +117,11 @@ internal DbConnectionInternal CreateNonPooledConnection(DbConnection owningConne
117
117
118
118
internal DbConnectionInternal CreatePooledConnection ( DbConnectionPool pool , DbConnection owningObject , DbConnectionOptions options , DbConnectionPoolKey poolKey , DbConnectionOptions userOptions )
119
119
{
120
- Debug . Assert ( null != pool , "null pool?" ) ;
120
+ Debug . Assert ( pool != null , "null pool?" ) ;
121
121
DbConnectionPoolGroupProviderInfo poolGroupProviderInfo = pool . PoolGroup . ProviderInfo ;
122
122
123
123
DbConnectionInternal newConnection = CreateConnection ( options , poolKey , poolGroupProviderInfo , pool , owningObject , userOptions ) ;
124
- if ( null != newConnection )
124
+ if ( newConnection != null )
125
125
{
126
126
SqlClientEventSource . Log . HardConnectRequest ( ) ;
127
127
newConnection . MakePooledConnection ( pool ) ;
@@ -167,8 +167,8 @@ private DbConnectionPool GetConnectionPool(DbConnection owningObject, DbConnecti
167
167
{
168
168
// if poolgroup is disabled, it will be replaced with a new entry
169
169
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?" ) ;
172
172
173
173
// It is possible that while the outer connection object has
174
174
// been sitting around in a closed and unused state in some long
@@ -179,7 +179,7 @@ private DbConnectionPool GetConnectionPool(DbConnection owningObject, DbConnecti
179
179
// re-create the pool entry whenever it's disabled.
180
180
181
181
// 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 )
183
183
{
184
184
SqlClientEventSource . Log . TryTraceEvent ( "<prov.DbConnectionFactory.GetConnectionPool|RES|INFO|CPOOL> {0}, DisabledPoolGroup={1}" , ObjectID , connectionPoolGroup ? . ObjectID ) ;
185
185
@@ -188,10 +188,10 @@ private DbConnectionPool GetConnectionPool(DbConnection owningObject, DbConnecti
188
188
189
189
// get the string to hash on again
190
190
DbConnectionOptions connectionOptions = connectionPoolGroup . ConnectionOptions ;
191
- Debug . Assert ( null != connectionOptions , "prevent expansion of connectionString" ) ;
191
+ Debug . Assert ( connectionOptions != null , "prevent expansion of connectionString" ) ;
192
192
193
193
connectionPoolGroup = GetConnectionPoolGroup ( connectionPoolGroup . PoolKey , poolOptions , ref connectionOptions ) ;
194
- Debug . Assert ( null != connectionPoolGroup , "null connectionPoolGroup?" ) ;
194
+ Debug . Assert ( connectionPoolGroup != null , "null connectionPoolGroup?" ) ;
195
195
SetConnectionPoolGroup ( owningObject , connectionPoolGroup ) ;
196
196
}
197
197
DbConnectionPool connectionPool = connectionPoolGroup . GetConnectionPool ( this ) ;
@@ -207,7 +207,7 @@ internal DbConnectionPoolGroup GetConnectionPoolGroup(DbConnectionPoolKey key, D
207
207
208
208
DbConnectionPoolGroup connectionPoolGroup ;
209
209
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 ) )
211
211
{
212
212
// If we can't find an entry for the connection string in
213
213
// our collection of pool entries, then we need to create a
@@ -238,7 +238,7 @@ internal DbConnectionPoolGroup GetConnectionPoolGroup(DbConnectionPoolKey key, D
238
238
// We don't support connection pooling on Win9x
239
239
if ( poolOptions == null )
240
240
{
241
- if ( null != connectionPoolGroup )
241
+ if ( connectionPoolGroup != null )
242
242
{
243
243
// reusing existing pool option in case user originally used SetConnectionPoolOptions
244
244
poolOptions = connectionPoolGroup . PoolGroupOptions ;
@@ -276,8 +276,8 @@ internal DbConnectionPoolGroup GetConnectionPoolGroup(DbConnectionPoolKey key, D
276
276
Debug . Assert ( ! connectionPoolGroup . IsDisabled , "Disabled pool entry discovered" ) ;
277
277
}
278
278
}
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?" ) ;
281
281
}
282
282
else if ( userConnectionOptions == null )
283
283
{
@@ -303,7 +303,7 @@ private void PruneConnectionPoolGroups(object state)
303
303
DbConnectionPool [ ] poolsToRelease = _poolsToRelease . ToArray ( ) ;
304
304
foreach ( DbConnectionPool pool in poolsToRelease )
305
305
{
306
- if ( null != pool )
306
+ if ( pool != null )
307
307
{
308
308
pool . Clear ( ) ;
309
309
@@ -328,7 +328,7 @@ private void PruneConnectionPoolGroups(object state)
328
328
DbConnectionPoolGroup [ ] poolGroupsToRelease = _poolGroupsToRelease . ToArray ( ) ;
329
329
foreach ( DbConnectionPoolGroup poolGroup in poolGroupsToRelease )
330
330
{
331
- if ( null != poolGroup )
331
+ if ( poolGroup != null )
332
332
{
333
333
int poolsLeft = poolGroup . Clear ( ) ; // may add entries to _poolsToRelease
334
334
@@ -353,7 +353,7 @@ private void PruneConnectionPoolGroups(object state)
353
353
354
354
foreach ( KeyValuePair < DbConnectionPoolKey , DbConnectionPoolGroup > entry in connectionPoolGroups )
355
355
{
356
- if ( null != entry . Value )
356
+ if ( entry . Value != null )
357
357
{
358
358
Debug . Assert ( ! entry . Value . IsDisabled , "Disabled pool entry discovered" ) ;
359
359
@@ -380,7 +380,7 @@ internal void QueuePoolForRelease(DbConnectionPool pool, bool clearing)
380
380
// Queue the pool up for release -- we'll clear it out and dispose
381
381
// of it as the last part of the pruning timer callback so we don't
382
382
// 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?" ) ;
384
384
385
385
// set the pool to the shutdown state to force all active
386
386
// connections to be automatically disposed when they
@@ -401,7 +401,7 @@ internal void QueuePoolForRelease(DbConnectionPool pool, bool clearing)
401
401
402
402
internal void QueuePoolGroupForRelease ( DbConnectionPoolGroup poolGroup )
403
403
{
404
- Debug . Assert ( null != poolGroup , "null poolGroup?" ) ;
404
+ Debug . Assert ( poolGroup != null , "null poolGroup?" ) ;
405
405
SqlClientEventSource . Log . TryTraceEvent ( "<prov.DbConnectionFactory.QueuePoolGroupForRelease|RES|INFO|CPOOL> {0}, poolGroup={1}" , ObjectID , poolGroup . ObjectID ) ;
406
406
407
407
lock ( _poolGroupsToRelease )
0 commit comments