mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-05 15:50:49 +07:00
IDEA-327590 GitOrigin-RevId: 721b34c773e16b93cc593080ba2dbc130606ed40
13 lines
470 B
Java
13 lines
470 B
Java
import com.intellij.openapi.application.ApplicationManager;
|
|
import com.intellij.openapi.components.Service;
|
|
|
|
@Service
|
|
final class MyService {
|
|
public static MyService getInstance() {
|
|
return ApplicationManager.getApplication().getService(MyService.class);
|
|
}
|
|
|
|
void foo() {
|
|
MyService service = ApplicationManager.getApplication().<weak_warning descr="Can be replaced with 'MyService.getInstance()' call">get<caret>Service</weak_warning>(MyService.class);
|
|
}
|
|
} |