Hi,
I have made a custom EvictionPolicy as explained here. Since there has been a new JBC release, I have to remodify released code in order to modify NodeEntry to enable setNumberOfElements to work.
I think a good change could be to change EvictionQueue to have a method like this one:
void modifyElementCount(NodeEntry entry, int difference);
public void NodeEntry.setNumberOfElements(int numberOfElements) { if (queue != null) { int difference = numberOfElements - this.numberOfElements; queue.modifyElementCount(this, difference); } this.numberOfElements = numberOfElements; }
Sure, feel free to contribute a patch for the next JBC release.