Applied Energistics 2

Applied Energistics 2

137M Downloads

Useless null check

Technici4n opened this issue · 4 comments

commented

The null checks for node.getGrid() in IManagedGridNode are useless: getGrid will never return a null grid.

commented

No:

@Override
public IGrid getGrid() {
if (this.myGrid == null) {
throw new IllegalStateException("A node is being used after it has been destroyed.");
}
return this.myGrid;
}

commented

Is it possible that this happens after/while destroying the grid?

commented
commented

Yeah, this is the kind of assumptions that are very hard to deal with... Only after extensive testing can we say that it's indeed safe to throw the exception...