static SortedSet<Upgradeable> getDistributedUpgrades(int versionFrom, FSConstants.NodeType type) throws IOException { assert FSConstants.LAYOUT_VERSION <= versionFrom : "Incorrect version " + versionFrom + ". Expected to be <= " + FSConstants.LAYOUT_VERSION; SortedSet<Upgradeable> upgradeObjects = new TreeSet<Upgradeable>(); for (UOSignature sig : upgradeTable) { if (sig.getVersion() < FSConstants.LAYOUT_VERSION) continue; if (sig.getVersion() > versionFrom) break; if (sig.getType() != type) continue; upgradeObjects.add(sig.instantiate()); } if (upgradeObjects.size() == 0) return null; return upgradeObjects; }