use of com.intellij.psi.PsiSynchronizedStatement in project intellij-community by JetBrains.
the class MissingSynchronizedBodyFixer method apply.
@Override
public void apply(Editor editor, JavaSmartEnterProcessor processor, PsiElement psiElement) throws IncorrectOperationException {
if (!(psiElement instanceof PsiSynchronizedStatement))
return;
PsiSynchronizedStatement syncStatement = (PsiSynchronizedStatement) psiElement;
final Document doc = editor.getDocument();
PsiElement body = syncStatement.getBody();
if (body != null)
return;
doc.insertString(syncStatement.getTextRange().getEndOffset(), "{}");
}
use of com.intellij.psi.PsiSynchronizedStatement in project intellij-community by JetBrains.
the class JavaSynchronizedUnwrapper method doUnwrap.
@Override
protected void doUnwrap(PsiElement element, Context context) throws IncorrectOperationException {
PsiCodeBlock body = ((PsiSynchronizedStatement) element).getBody();
context.extractFromCodeBlock(body, element);
context.delete(element);
}
Aggregations