Reporter | Sean Epping (jsseanepping) |
---|---|
Created | Feb 2, 2012 2:45:28 AM |
Updated | Feb 20, 2012 5:56:43 PM |
Resolved | Feb 20, 2012 5:56:43 PM |
Priority | Normal |
Type | Bug |
Fix versions | No Fix versions |
State | Won't fix |
Assignee | Alexey Kuptsov (alexey.kuptsov) |
Subsystem | Refactoring |
Affected versions | 6.1 |
Fixed in build | No Fixed in build |
When applied to:
public void OpenMarket()
{
if (MarketState != MarketState.Open || MarketState != MarketState.Opening)
{
lock (_marketStateLock)
{
if (MarketState != MarketState.Open || MarketState != MarketState.Opening)
{
MarketState = MarketState.Opening;
_timer = new Timer(UpdateStockPrices, null, _updateInterval, _updateInterval);
MarketState = MarketState.Open;
BroadcastMarketStateChange(MarketState.Open);
}
}
}
}
It produces:
if(MarketState == MarketState.Open
&& MarketState == MarketState.Opening)
{
return;
}
lock (_marketStateLock)
{
if (MarketState != MarketState.Open || MarketState != MarketState.Opening)
{
MarketState = MarketState.Opening;
_timer = new Timer(UpdateStockPrices, null, _updateInterval, _updateInterval);
MarketState = MarketState.Open;
BroadcastMarketStateChange(MarketState.Open);
}
}
Which could never be true in this case.
public void OpenMarket()
{
if (MarketState != MarketState.Open || MarketState != MarketState.Opening)
{
lock (_marketStateLock)
{
if (MarketState != MarketState.Open || MarketState != MarketState.Opening)
{
MarketState = MarketState.Opening;
_timer = new Timer(UpdateStockPrices, null, _updateInterval, _updateInterval);
MarketState = MarketState.Open;
BroadcastMarketStateChange(MarketState.Open);
}
}
}
}
It produces:
if(MarketState == MarketState.Open
&& MarketState == MarketState.Opening)
{
return;
}
lock (_marketStateLock)
{
if (MarketState != MarketState.Open || MarketState != MarketState.Opening)
{
MarketState = MarketState.Opening;
_timer = new Timer(UpdateStockPrices, null, _updateInterval, _updateInterval);
MarketState = MarketState.Open;
BroadcastMarketStateChange(MarketState.Open);
}
}
Which could never be true in this case.