void () { try { File targetTypesFile = getTargetTypesFile(); FileUtil.createParentDirs(targetTypesFile); try (DataOutputStream output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(targetTypesFile)))) { output.writeInt(myMaxTargetId.get()); output.writeLong(myLastSuccessfulRebuildDuration); } } catch (IOException e) { LOG.info("Cannot save targets info: " + e.getMessage(), e); } for (BuildTargetTypeState state : myTypeStates.values()) { state.save(); } }