void (Object requestor, @VirtualFile.PropName @NotNull String propertyName, Object oldValue, Object newValue) { if (Comparing.equal(oldValue, newValue) && FileContentUtilCore.FORCE_RELOAD_REQUESTOR != requestor) { throw new IllegalArgumentException("Values must be different, got the same: " + oldValue); } switch (propertyName) { case VirtualFile.PROP_NAME: if (oldValue == null) throw new IllegalArgumentException("oldName must not be null"); if (!(oldValue instanceof String)) throw new IllegalArgumentException("oldName must be String, got " + oldValue); if (newValue == null) throw new IllegalArgumentException("newName must not be null"); if (!(newValue instanceof String)) throw new IllegalArgumentException("newName must be String, got " + newValue); break; case VirtualFile.PROP_ENCODING: if (oldValue == null) throw new IllegalArgumentException("oldCharset must not be null"); if (!(oldValue instanceof Charset)) throw new IllegalArgumentException("oldValue must be Charset, got "+oldValue); break; case VirtualFile.PROP_WRITABLE: if (!(oldValue instanceof Boolean)) throw new IllegalArgumentException("oldWriteable must be boolean, got " + oldValue); if (!(newValue instanceof Boolean)) throw new IllegalArgumentException("newWriteable must be boolean, got " + newValue); break; case VirtualFile.PROP_HIDDEN: if (!(oldValue instanceof Boolean)) throw new IllegalArgumentException("oldHidden must be boolean, got " + oldValue); if (!(newValue instanceof Boolean)) throw new IllegalArgumentException("newHidden must be boolean, got " + newValue); break; case VirtualFile.PROP_SYMLINK_TARGET: if (oldValue != null && !(oldValue instanceof String)) { throw new IllegalArgumentException("oldSymTarget must be String, got " + oldValue); } if (newValue != null && !(newValue instanceof String)) { throw new IllegalArgumentException("newSymTarget must be String, got " + newValue); } break; case VirtualFile.PROP_CHILDREN_CASE_SENSITIVITY: if (!(oldValue instanceof FileAttributes.CaseSensitivity)) { throw new IllegalArgumentException("oldValue must be FileAttributes.CaseSensitivity but got " + oldValue); } if (!(newValue instanceof FileAttributes.CaseSensitivity)) { throw new IllegalArgumentException("newValue must be FileAttributes.CaseSensitivity but got " + newValue); } if (oldValue.equals(newValue)) { throw new IllegalArgumentException("newValue must be different from the oldValue but got " + newValue); } break; default: throw new IllegalArgumentException( "Unknown property name '" + propertyName + "'. " + "Must be one of VirtualFile.{PROP_NAME|PROP_ENCODING|PROP_WRITABLE|PROP_HIDDEN|PROP_SYMLINK_TARGET}"); } }