mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-01 03:12:15 +07:00
GitOrigin-RevId: 5e74319e790c4246b64e6d5f57c51c6930dbf19f
26 lines
1.3 KiB
Java
26 lines
1.3 KiB
Java
import com.intellij.openapi.application.ApplicationManager;
|
|
import com.intellij.openapi.components.Service;
|
|
import com.intellij.openapi.project.Project;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import serviceDeclarations.*;
|
|
|
|
|
|
class MyClass {
|
|
|
|
static final LightServiceAppAndProjectLevelAnnotation <warning descr="Application service must not be assigned to a static final field">myAppService1</warning> = LightServiceAppAndProjectLevelAnnotation.getInstance();
|
|
|
|
private static final LightServiceAppLevelAnnotation <warning descr="Application service must not be assigned to a static final field">myAppService2</warning> = ApplicationManager.getApplication().getService(LightServiceAppLevelAnnotation.class);
|
|
|
|
public static final LightServiceEmptyAnnotation <warning descr="Application service must not be assigned to a static final field">myAppService4</warning> = LightServiceEmptyAnnotation.getInstance();
|
|
|
|
// not final
|
|
static LightServiceAppAndProjectLevelAnnotation myAppService5 = LightServiceAppAndProjectLevelAnnotation.getInstance();
|
|
|
|
// not static
|
|
final LightServiceAppLevelAnnotation myAppService6 = LightServiceAppLevelAnnotation.getInstance();
|
|
|
|
// not an application service
|
|
static final LightServiceProjecLevelAnnotation myProjectService = new LightServiceProjecLevelAnnotation();
|
|
|
|
}
|