{
colPermsDescriptor = (ColPermsDescriptor) iterator.next();
removePermEntryInCache(colPermsDescriptor);
uuidKey = rf.buildIndexKeyRow(rf.COLPERMSID_INDEX_NUM, colPermsDescriptor);
curRow=ti.getRow(tc, uuidKey, rf.COLPERMSID_INDEX_NUM);
FormatableBitSet columns = (FormatableBitSet) curRow.getColumn(
SYSCOLPERMSRowFactory.COLUMNS_COL_NUM).getObject();
// See whether this is ADD COLUMN or DROP COLUMN. If ADD, then
// add a new bit to the bit set. If DROP, then remove the bit
// for the dropped column.
if (columnDescriptor == null)
{
int currentLength = columns.getLength();
columns.grow(currentLength+1);
}
else
{
FormatableBitSet modifiedColumns=new FormatableBitSet(columns);
modifiedColumns.shrink(columns.getLength()-1);
// All the bits from 0 ... colPosition-2 are OK. The bits from
// colPosition to the end need to be shifted 1 to the left.
// The bit for colPosition-1 simply disappears from COLUMNS.
// ColumnPosition values count from 1, while bits in the
// FormatableBitSet count from 0.
for (int i = columnDescriptor.getPosition()-1;
i < modifiedColumns.getLength();
i++)
{
if (columns.isSet(i+1))
modifiedColumns.set(i);
else
modifiedColumns.clear(i);
}
columns = modifiedColumns;
}
curRow.setColumn(SYSCOLPERMSRowFactory.COLUMNS_COL_NUM,
dvf.getDataValue((Object) columns));