Merge pull request #1609 from yueh/fix-1510

Splitted channeldata into two ints
This commit is contained in:
yueh 2015-06-16 18:04:49 +02:00
commit c6383f21c5

View file

@ -71,7 +71,8 @@ public class GridNode implements IGridNode, IPathItem
private Object visitorIterationNumber = null;
// connection criteria
private int compressedData = 0;
private int channelData = 0;
private int usedChannels = 0;
private int lastUsedChannels = 0;
public GridNode( IGridBlock what )
{
@ -90,7 +91,7 @@ public class GridNode implements IGridNode, IPathItem
public int usedChannels()
{
return this.channelData >> 8;
return this.lastUsedChannels;
}
public Class<? extends IGridHost> getMachineClass()
@ -361,7 +362,7 @@ public class GridNode implements IGridNode, IPathItem
@Override
public boolean meetsChannelRequirements()
{
return ( !this.gridProxy.getFlags().contains( GridFlags.REQUIRE_CHANNEL ) || this.getUsedChannels() > 0 );
return( !this.gridProxy.getFlags().contains( GridFlags.REQUIRE_CHANNEL ) || this.getUsedChannels() > 0 );
}
@Override
@ -387,7 +388,7 @@ public class GridNode implements IGridNode, IPathItem
public int getUsedChannels()
{
return this.channelData & 0xff;
return this.usedChannels;
}
public void FindConnections()
@ -584,7 +585,7 @@ public class GridNode implements IGridNode, IPathItem
public void setGridStorage( GridStorage s )
{
this.myStorage = s;
this.channelData = 0;
this.usedChannels = 0;
}
@Override
@ -603,7 +604,7 @@ public class GridNode implements IGridNode, IPathItem
{
if( zeroOut )
{
this.channelData &= ~0xff;
this.usedChannels = 0;
}
int idx = this.connections.indexOf( fast );
@ -634,7 +635,7 @@ public class GridNode implements IGridNode, IPathItem
@Override
public void incrementChannelCount( int usedChannels )
{
this.channelData += usedChannels;
this.usedChannels += usedChannels;
}
@Override
@ -653,8 +654,7 @@ public class GridNode implements IGridNode, IPathItem
if( this.getLastUsedChannels() != this.getUsedChannels() )
{
this.channelData &= 0xff;
this.channelData |= this.channelData << 8;
this.lastUsedChannels = this.usedChannels;
if( this.getInternalGrid() != null )
{
@ -665,7 +665,7 @@ public class GridNode implements IGridNode, IPathItem
public int getLastUsedChannels()
{
return ( this.channelData >> 8 ) & 0xff;
return lastUsedChannels;
}
private static class MachineSecurityBreak implements Callable<Void>
@ -686,7 +686,6 @@ public class GridNode implements IGridNode, IPathItem
}
}
private static class ConnectionComparator implements Comparator<IGridConnection>
{
private final IGridNode gn;