ModCommand (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { var element = descriptor.getStartElement(); return ModCommand.psiUpdate(ActionContext.from(descriptor), updater -> { PsiModifierList modifierList = null; if (myAddVolatile) { modifierList = updater.getWritable(getFieldModifierList(element)); } if (myAddOnSpinWait) { addOnSpinWait(updater.getWritable(element)); } if (modifierList != null) { modifierList.setModifierProperty(PsiModifier.VOLATILE, true); } }); }