Commit baa9cf87 authored by Simon Barner's avatar Simon Barner
Browse files

- Use getInstance() method for services instead of deprecated direct access to...

- Use getInstance() method for services instead of deprecated direct access to static INSTANCE field
refs 2597
parent da674d26
......@@ -57,7 +57,7 @@ import org.fortiss.tooling.kernel.ui.presentation.ModelElementLabelProvider;
* @author aravantinos
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 9D5B6F65159A9FD7CE80BB918D23DA33
* @ConQAT.Rating YELLOW Hash: F218CA5E5BBEED90100A1EBDFD42B0A9
*/
public class ComponentConnectionCompositor extends
ConnectionCompositorBase<IHierarchicElement, EObject, EObject> {
......@@ -107,7 +107,7 @@ public class ComponentConnectionCompositor extends
throw new OperationCanceledException();
}
Component parentComp = getConnectionContainer(sourceConnector, targetConnector);
ITopLevelElement topElement = IPersistencyService.INSTANCE.getTopLevelElementFor(source);
ITopLevelElement topElement = IPersistencyService.getInstance().getTopLevelElementFor(source);
if(topElement != null) {
topElement.prepareIDs(sourceConnector);
topElement.prepareIDs(targetConnector);
......@@ -201,7 +201,7 @@ public class ComponentConnectionCompositor extends
IElementCompositionContext dropCtx =
isTarget ? ctx.getTargetDropContext() : ctx.getSourceDropContext();
LayoutDataUtils.layoutModelElement(elt, dropCtx);
IElementCompositorService.INSTANCE.compose(end, elt, null);
IElementCompositorService.getInstance().compose(end, elt, null);
}
} else {
targetConnector = createPort(!isTarget);
......
......@@ -76,7 +76,7 @@ import org.fortiss.tooling.kernel.ui.service.IActionService;
* @author doebber
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating GREEN Hash: 8993B67DA52F3C98D86F3660292E7CF2
* @ConQAT.Rating RED Hash: 71EC116A3425A7509A2F05EF2C9BC55B
*/
public class CodeSpecificationEditor extends EditorBase<CodeSpecification> {
......@@ -118,7 +118,7 @@ public class CodeSpecificationEditor extends EditorBase<CodeSpecification> {
createCodeEditor(scrldfrmCodeSpecification.getBody());
updateModel();
if(ILibraryService.INSTANCE.isLibraryElementShadow(editedObject)) {
if(ILibraryService.getInstance().isLibraryElementShadow(editedObject)) {
codeViewer.getControl().setEnabled(false);
}
}
......@@ -271,7 +271,7 @@ public class CodeSpecificationEditor extends EditorBase<CodeSpecification> {
/** {@inheritDoc} */
@Override
public void registerGlobalActions(IActionBars bars) {
IActionService.INSTANCE.registerGlobalUndoRedoActions(bars);
IActionService.getInstance().registerGlobalUndoRedoActions(bars);
super.registerGlobalActions(bars);
}
......
......@@ -61,7 +61,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating GREEN Hash: 9FA6A9DBDDF1E0BF40BF28F05C7EFC49
* @ConQAT.Rating RED Hash: 326ADB0FFA1CA8F01C548F3721222E63
*/
public abstract class DataStateEditorBase<T extends IDataStateVariableProvider> extends
FormsEditorBase<T> {
......@@ -293,7 +293,7 @@ public abstract class DataStateEditorBase<T extends IDataStateVariableProvider>
String vName = "v" + (getEditedObject().getDataStateVariables().size() + 1);
final DataStateVariable dsvar = createDataStateVariable(vName, intType(), intConst(0));
final ITopLevelElement topLevel =
IPersistencyService.INSTANCE.getTopLevelElementFor(getEditedObject());
IPersistencyService.getInstance().getTopLevelElementFor(getEditedObject());
topLevel.runAsCommand(new Runnable() {
@Override
public void run() {
......@@ -313,7 +313,7 @@ public abstract class DataStateEditorBase<T extends IDataStateVariableProvider>
}
final ITopLevelElement topLevel =
IPersistencyService.INSTANCE.getTopLevelElementFor(getEditedObject());
IPersistencyService.getInstance().getTopLevelElementFor(getEditedObject());
topLevel.runAsCommand(new Runnable() {
@Override
public void run() {
......
......@@ -42,7 +42,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: F49B7B4EBE2F91E94E3C3D71AC6DA017
* @ConQAT.Rating YELLOW Hash: 0F5E9C5632A8429C299DB8B61669D749
*/
public class ComponentEditPart extends ElementEditPartBase<Component> {
......@@ -84,7 +84,7 @@ public class ComponentEditPart extends ElementEditPartBase<Component> {
decorationFigure.getParent().setConstraint(decorationFigure, decorationBounds);
EObject eObject = getModel();
ESeverity maxSeverity = IMarkerService.INSTANCE.getHighestViolationSeverity(eObject);
ESeverity maxSeverity = IMarkerService.getInstance().getHighestViolationSeverity(eObject);
decorationFigure.setIcon(getMarkerServiceDecorationIcon(maxSeverity,
useSmallDecorationImage()));
......@@ -95,10 +95,10 @@ public class ComponentEditPart extends ElementEditPartBase<Component> {
@Override
protected String getBaseFigureTooltip() {
EObject eObject = getModel();
String message = IModelElementHandlerService.INSTANCE.getWrappedNameDescription(eObject);
String message = IModelElementHandlerService.getInstance().getWrappedNameDescription(eObject);
Collection<IConstraintViolation<? extends EObject>> violations =
IMarkerService.INSTANCE.getViolations(eObject);
IMarkerService.getInstance().getViolations(eObject);
for(IConstraintViolation<?> v : violations) {
switch(v.getSeverity()) {
......@@ -112,7 +112,7 @@ public class ComponentEditPart extends ElementEditPartBase<Component> {
}
if(violations.isEmpty() &&
IMarkerService.INSTANCE.getHighestViolationSeverity(eObject).compareTo(
IMarkerService.getInstance().getHighestViolationSeverity(eObject).compareTo(
ESeverity.lowest()) < 0) {
message += " right-click for more details.";
}
......
......@@ -35,7 +35,7 @@ import org.fortiss.tooling.kernel.ui.service.INavigatorService;
* @author hoelzl
* @author $Author: becker $
* @version $Rev: 2798 $
* @ConQAT.Rating GREEN Hash: E1990BDB3720844061854FC276E2E2CC
* @ConQAT.Rating YELLOW Hash: A0C09A6A8D6B8428B4A8C184377DEA15
*/
public class CCodeGeneratorEasyStartMenu extends EasyStartMenuBase {
......@@ -61,7 +61,7 @@ public class CCodeGeneratorEasyStartMenu extends EasyStartMenuBase {
protected boolean acceptSelection(INamedElement selection,
ContextMenuContextProvider contextProvider) {
return (selection instanceof ComponentArchitecture) &&
INavigatorService.INSTANCE.isNavigatorView(contextProvider);
INavigatorService.getInstance().isNavigatorView(contextProvider);
}
/** {@inheritDoc} */
......
......@@ -35,7 +35,7 @@ import org.fortiss.tooling.kernel.ui.service.INavigatorService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 9B8733B0510A3025D1536D6DED7EA22F
* @ConQAT.Rating YELLOW Hash: 4613F60163AEB28EC0935B4BFE6FBC92
*/
public class JavaCodeGeneratorEasyStartMenu extends EasyStartMenuBase {
......@@ -61,7 +61,7 @@ public class JavaCodeGeneratorEasyStartMenu extends EasyStartMenuBase {
protected boolean acceptSelection(INamedElement selection,
ContextMenuContextProvider contextProvider) {
return (selection instanceof ComponentArchitecture) &&
INavigatorService.INSTANCE.isNavigatorView(contextProvider);
INavigatorService.getInstance().isNavigatorView(contextProvider);
}
/** {@inheritDoc} */
......
......@@ -38,7 +38,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzlf
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 9F5C90B7284AC81A6B1B80AEEFEBB986
* @ConQAT.Rating YELLOW Hash: 8A6D6B7C33BB7D62881656185C80D956
*/
@SuppressWarnings({"rawtypes", "unchecked"})
......@@ -99,7 +99,7 @@ public class ComponentHandler extends NamedCommentedModelElementHandlerBase<Comp
/* package */static EObject doHandleOpenModelElementRequest(Component element) {
for(EObject spec : getFilteredSpecifications(element)) {
IModelElementHandler<EObject> handler =
IModelElementHandlerService.INSTANCE.getModelElementHandler(spec);
IModelElementHandlerService.getInstance().getModelElementHandler(spec);
if(handler instanceof IComponentBehaviorDefinitionHandler) {
return spec;
}
......
......@@ -39,7 +39,7 @@ import org.fortiss.tooling.kernel.ui.service.IContextMenuService;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 18709 $
* @ConQAT.Rating GREEN Hash: 0CBFC8E0E2DD83270767FAE198990F96
* @ConQAT.Rating YELLOW Hash: B449828103B93085CE54F5BC1661A4FC
*/
public class ConvertReferenceToComponent implements IContextMenuContributor {
......@@ -85,7 +85,7 @@ public class ConvertReferenceToComponent implements IContextMenuContributor {
/** {@inheritDoc} */
@Override
public void run() {
ModelElementLibraryService.INSTANCE
ModelElementLibraryService.getInstance()
.convertLibraryElementRefToHierarchicalElement(selectedComponentRef);
}
}
......
......@@ -51,7 +51,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
* @author eder
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 0730F5B14E5C6EADE243A9F69745E2A2
* @ConQAT.Rating YELLOW Hash: FD4F05146615E605C16E3B1A94481EC3
*/
public final class ComponentSpecificationPropertySection extends PropertySectionBase {
......@@ -121,7 +121,7 @@ public final class ComponentSpecificationPropertySection extends PropertySection
/** Store the value of verification behavior when it changes. */
private void verifBehaviourChangeHandler(final VerificationBehaviour value) {
ITopLevelElement topLevel = IPersistencyService.INSTANCE.getTopLevelElementFor(component);
ITopLevelElement topLevel = IPersistencyService.getInstance().getTopLevelElementFor(component);
topLevel.runAsCommand(new Runnable() {
@Override
public void run() {
......
......@@ -53,7 +53,7 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author eder
* @author $Author: hoelzl $
* @version $Rev: 1650 $
* @ConQAT.Rating GREEN Hash: 8FF5A32B223D4A9C4258DFF0ED75FDAE
* @ConQAT.Rating YELLOW Hash: 824665721EDB11E8A95A6C59ED02E8B9
*/
public class PortDataPropagation implements SelectionListener {
/**
......@@ -159,7 +159,7 @@ public class PortDataPropagation implements SelectionListener {
@Override
public void widgetSelected(SelectionEvent e) {
ITopLevelElement topLevel =
IPersistencyService.INSTANCE.getTopLevelElementFor(portDataAccess
IPersistencyService.getInstance().getTopLevelElementFor(portDataAccess
.getPortSpecification());
topLevel.runAsCommand(new Runnable() {
@Override
......@@ -228,12 +228,12 @@ public class PortDataPropagation implements SelectionListener {
EList<Channel> channels =
seenAsSrc ? port.getOutgoingChannels() : port.getIncomingChannels();
if(ILibraryService.INSTANCE.isLibraryElementShadow(port)) {
if(ILibraryService.getInstance().isLibraryElementShadow(port)) {
return res;
}
for(Channel c : channels) {
Port otherPort = seenAsSrc ? c.getTarget() : c.getSource();
if(!ILibraryService.INSTANCE.isLibraryElementShadow(otherPort)) {
if(!ILibraryService.getInstance().isLibraryElementShadow(otherPort)) {
res.add(new Pair<Channel, Port>(c, otherPort));
}
}
......
......@@ -79,7 +79,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
* @author eder
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 1077E39A12D4DD0F2444C3BA98B48173
* @ConQAT.Rating YELLOW Hash: 179FC0A0078359F6FD268BD7A1273897
*/
public final class PortSpecificationPropertySection extends PropertySectionBase implements
PortDataPropagation.PortDataAccess {
......@@ -176,7 +176,7 @@ public final class PortSpecificationPropertySection extends PropertySectionBase
public void modifyText(ModifyEvent e) {
if(userInput) {
ITopLevelElement topLevel =
IPersistencyService.INSTANCE.getTopLevelElementFor(spec);
IPersistencyService.getInstance().getTopLevelElementFor(spec);
topLevel.runAsCommand(new Runnable() {
@Override
......@@ -203,7 +203,7 @@ public final class PortSpecificationPropertySection extends PropertySectionBase
public void selectionChanged(SelectionChangedEvent event) {
if(userInput) {
ITopLevelElement topLevel =
IPersistencyService.INSTANCE.getTopLevelElementFor(spec);
IPersistencyService.getInstance().getTopLevelElementFor(spec);
topLevel.runAsCommand(new Runnable() {
@Override
......@@ -368,7 +368,7 @@ public final class PortSpecificationPropertySection extends PropertySectionBase
.getType().toString(), spec, spec.getType(), spec.getInitialValue(), true);
if(initialValue != null) {
ICommandStackService.INSTANCE.runAsCommand(spec, new Runnable() {
ICommandStackService.getInstance().runAsCommand(spec, new Runnable() {
@Override
public void run() {
spec.setInitialValue(initialValue);
......
......@@ -75,7 +75,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: D474B704DB1AACAD43BAFA9BEDCC3384
* @ConQAT.Rating YELLOW Hash: 5FAE39CE7B3DF256922C89B28B7C178E
*/
public class SimulationView extends ViewPart implements IPropertyListener, EventListener, Observer {
......@@ -105,9 +105,9 @@ public class SimulationView extends ViewPart implements IPropertyListener, Event
EObject spec = ((ExecutableComponent<?>)element).getSpecification();
if(spec != null) {
return IModelElementHandlerService.INSTANCE.getIcon(spec);
return IModelElementHandlerService.getInstance().getIcon(spec);
}
return IModelElementHandlerService.INSTANCE.getIcon(modelElement);
return IModelElementHandlerService.getInstance().getIcon(modelElement);
}
return super.getImage(element);
}
......
......@@ -46,7 +46,7 @@ import org.fortiss.tooling.kernel.ui.service.INavigatorService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: FFFEA1D3D01333C4D3DB01407217866D
* @ConQAT.Rating YELLOW Hash: 62D8192E780280B47D7DD14A06A80B7E
*/
public class SimulatorEasyStartMenu extends EasyStartMenuBase {
......@@ -72,7 +72,7 @@ public class SimulatorEasyStartMenu extends EasyStartMenuBase {
protected boolean acceptSelection(INamedElement selection,
ContextMenuContextProvider contextProvider) {
return (selection instanceof ComponentArchitecture || selection instanceof Component) &&
INavigatorService.INSTANCE.isNavigatorView(contextProvider);
INavigatorService.getInstance().isNavigatorView(contextProvider);
}
/** {@inheritDoc} */
......
......@@ -39,7 +39,7 @@ import org.fortiss.tooling.kernel.service.ILoggingService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: DFCC9B4B70F14BA78AB9F47C596A4CC1
* @ConQAT.Rating YELLOW Hash: 3ABA1993DABA5C032D30460E40E7EE4C
*/
public class ComponentArchitectureCompositor extends
HierarchicElementCompositorBase<ComponentArchitecture> {
......@@ -68,7 +68,7 @@ public class ComponentArchitectureCompositor extends
// Unfortunately, the IElementCompositionContext cannot be used as an indicator
// since it is also null when the composition is triggered by a non-drag'n'drop
// operation.
ILoggingService.INSTANCE.processMessage(new ModelElementWithRefCopyMessage(),
ILoggingService.getInstance().processMessage(new ModelElementWithRefCopyMessage(),
new LogMessageUserInteractionContext());
}
// get(0): gets the hidden top component (which must be there and must be unique by
......
......@@ -47,7 +47,7 @@ import org.fortiss.tooling.kernel.service.ILoggingService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 2604274EE11B68168CB23AD4BC36B2E9
* @ConQAT.Rating YELLOW Hash: 3A1F361D6040F16855A2EF555B65F464
*/
public class ComponentCompositor extends HierarchicElementCompositorBase<Component> {
......@@ -91,7 +91,7 @@ public class ComponentCompositor extends HierarchicElementCompositorBase<Compone
// Unfortunately, the IElementCompositionContext cannot be used as an indicator
// since it is also null when the composition is triggered by a non-drag'n'drop
// operation.
ILoggingService.INSTANCE.processMessage(new ModelElementWithRefCopyMessage(),
ILoggingService.getInstance().processMessage(new ModelElementWithRefCopyMessage(),
new LogMessageUserInteractionContext());
}
LayoutDataUtils.layoutModelElement(component, context);
......
......@@ -40,7 +40,7 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author ratiu
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 6502913EF7A7A457016754370DF4DAEB
* @ConQAT.Rating RED Hash: 3A217AEA1E24A1CB9E1E308A27A415AA
*/
public class VariableBoundsSpecificationUtils {
......@@ -75,7 +75,7 @@ public class VariableBoundsSpecificationUtils {
final VariableBoundsSpecification vbs = findVarBoundsSpec(varDef);
if(vbs != null) {
final ITopLevelElement topLevel =
IPersistencyService.INSTANCE.getTopLevelElementFor(varDef);
IPersistencyService.getInstance().getTopLevelElementFor(varDef);
topLevel.runAsCommand(new Runnable() {
@Override
public void run() {
......
......@@ -39,7 +39,7 @@ import org.fortiss.tooling.kernel.service.ILibraryService;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 18709 $
* @ConQAT.Rating GREEN Hash: 864753F9DA2184038E4C8D9D93C85612
* @ConQAT.Rating YELLOW Hash: CC0DDDA922B887FC9FEAA2CFC4E82687
*/
class ComponentRefStaticImpl {
......@@ -58,37 +58,37 @@ class ComponentRefStaticImpl {
/** Returns the channels of the wrapped component. */
static EList<Channel> getChannels(ComponentRef componentRef) {
ILibraryService.INSTANCE.ensureWrappedElementIsUpToDate(componentRef);
ILibraryService.getInstance().ensureWrappedElementIsUpToDate(componentRef);
return componentRef.getLibraryComponentShadow().getChannels();
}
/** Returns the subcomponents of the wrapped component. */
static EList<Component> getSubComponents(ComponentRef componentRef) {
ILibraryService.INSTANCE.ensureWrappedElementIsUpToDate(componentRef);
ILibraryService.getInstance().ensureWrappedElementIsUpToDate(componentRef);
return componentRef.getLibraryComponentShadow().getSubComponents();
}
/** Returns the contained elements in the wrapped component. */
static EList<IHierarchicElement> getContainedElements(ComponentRef componentRef) {
ILibraryService.INSTANCE.ensureWrappedElementIsUpToDate(componentRef);
ILibraryService.getInstance().ensureWrappedElementIsUpToDate(componentRef);
return componentRef.getLibraryComponentShadow().getContainedElements();
}
/** Returns the definition element of the wrapped component. */
static IVariableDefinition getDefinitionElement(ComponentRef componentRef, VarBase var) {
ILibraryService.INSTANCE.ensureWrappedElementIsUpToDate(componentRef);
ILibraryService.getInstance().ensureWrappedElementIsUpToDate(componentRef);
return componentRef.getLibraryComponentShadow().getDefinitionElement(var);
}
/** Returns the causality specification of the wrapped component. */
static CausalityComponentSpecification getCausalitySpecification(ComponentRef componentRef) {
ILibraryService.INSTANCE.ensureWrappedElementIsUpToDate(componentRef);
ILibraryService.getInstance().ensureWrappedElementIsUpToDate(componentRef);
return componentRef.getLibraryComponentShadow().getCausalitySpecification();
}
/** Returns the specifications of the wrapped component. */
static EList<IModelElementSpecification> getSpecifications(ComponentRef componentRef) {
ILibraryService.INSTANCE.ensureWrappedElementIsUpToDate(componentRef);
ILibraryService.getInstance().ensureWrappedElementIsUpToDate(componentRef);
return componentRef.getLibraryComponentShadow().getSpecifications();
}
......
......@@ -54,7 +54,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: EFAF77AAC8460EA3C92CC4C7A51B892C
* @ConQAT.Rating YELLOW Hash: CF592FACB32734461ECEEFE7F8C91699
*/
public class ComponentLibraryUtils {
......@@ -65,7 +65,7 @@ public class ComponentLibraryUtils {
*/
public static List<LibraryComponent> getComponentsFromAllWorkspaceLibraries() {
return pickInstanceOf(LibraryComponent.class,
ILibraryService.INSTANCE.getLibraryElementsFromAllWorkspaceLibraries());
ILibraryService.getInstance().getLibraryElementsFromAllWorkspaceLibraries());
}
/**
......@@ -89,12 +89,12 @@ public class ComponentLibraryUtils {
}
Component top = comp.getTopComponentParent();
ModelElementLibraryService.INSTANCE.ensureChildrenLibraryReferenceAreUpToDate(top);
ModelElementLibraryService.getInstance().ensureChildrenLibraryReferenceAreUpToDate(top);
Component newTop = copy(top);
List<ComponentRef> componentReferences = getChildrenWithType(newTop, ComponentRef.class);
for(ComponentRef cRef : componentReferences) {
ModelElementLibraryService.INSTANCE
ModelElementLibraryService.getInstance()
.doConvertLibraryElementRefToHierarchicalElement(cRef);
}
......@@ -105,14 +105,14 @@ public class ComponentLibraryUtils {
Component res = (Component)findElementById(comp.getId(), newTop);
newFp.setId(fp.hashCode());
IPersistencyService.INSTANCE.addDummyEObjectAsTopLevelElement(newFp);
IPersistencyService.getInstance().addDummyEObjectAsTopLevelElement(newFp);
return res;
}
/** Cleans-up the dummy element from the top level elements. */
public static void cleanTemporaryCopiedProject(Component copiedComponent) {
FileProject fp = getParentElement(copiedComponent, FileProject.class, false);
IPersistencyService.INSTANCE.removeDummyTopLevelElement(fp);
IPersistencyService.getInstance().removeDummyTopLevelElement(fp);
}
/**
......@@ -164,7 +164,7 @@ public class ComponentLibraryUtils {
*/
private static FileProject findOriginalProject(FileProject project) {
FileProject originalProject = null;
for(ITopLevelElement topLevelElement : IPersistencyService.INSTANCE.getTopLevelElements()) {
for(ITopLevelElement topLevelElement : IPersistencyService.getInstance().getTopLevelElements()) {
EObject rootElement = topLevelElement.getRootModelElement();
if(rootElement instanceof FileProject) {
if((project.getName().equals("Temporary") && rootElement.hashCode() == project
......
......@@ -46,13 +46,13 @@ import org.fortiss.tooling.kernel.utils.UniqueIDUtils;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating GREEN Hash: 85C135462F7588673AA8562D477AC4B1
* @ConQAT.Rating YELLOW Hash: B2FA3E8AF83EA6B4F376E534489FD2FA
*/
public class LibraryTestBase {
/** Saves the library. */
public static void saveLibrary(FileLibrary lib) {
final ITopLevelElement topLevel = IPersistencyService.INSTANCE.getTopLevelElementFor(lib);
final ITopLevelElement topLevel = IPersistencyService.getInstance().getTopLevelElementFor(lib);
try {
topLevel.doSave(new NullProgressMonitor());
......@@ -65,7 +65,7 @@ public class LibraryTestBase {
/** Returns a {@link ILibrary} with a given name or null if it does not exist. */
public static ILibrary findLibrary(String libraryName) {
for(ILibrary lib : ILibraryService.INSTANCE.getLibrariesFromWorkspace()) {
for(ILibrary lib : ILibraryService.getInstance().getLibrariesFromWorkspace()) {
if(lib.getName().equals(libraryName)) {
return lib;
}
......@@ -75,7 +75,7 @@ public class LibraryTestBase {
/** Returns a {@link ILibraryPackage} with a given name or null if it does not exist. */
public static ILibraryPackage findLibraryPackage(ILibrary lib, String packName) {
for(ILibraryPackage pack : ILibraryService.INSTANCE.getAllLibraryPackages(lib)) {
for(ILibraryPackage pack : ILibraryService.getInstance().getAllLibraryPackages(lib)) {
if(pack.getName().equals(packName)) {
return pack;
}
......@@ -86,7 +86,7 @@ public class LibraryTestBase {
/** Returns a {@link ILibraryPackage} with a given name or null if it does not exist. */
protected ILibraryPackage findLibraryPackage(String libName, String packName) {
ILibrary lib = findLibrary(libName);
for(ILibraryPackage pack : ILibraryService.INSTANCE.getAllLibraryPackages(lib)) {
for(ILibraryPackage pack : ILibraryService.getInstance().getAllLibraryPackages(lib)) {
if(pack.getName().equals(packName)) {
return pack;
}
......@@ -108,7 +108,7 @@ public class LibraryTestBase {
public static void addElementToLibrary(String libName, String packName, EObject elem) {
ILibrary lib = findLibrary(libName);
ILibraryPackage pack = findLibraryPackage(lib, packName);
ModelElementLibraryService.INSTANCE.addElementToLibrary(pack, elem);
ModelElementLibraryService.getInstance().addElementToLibrary(pack, elem);
saveLibrary((FileLibrary)lib);
sleep();
}
......
......@@ -47,7 +47,7 @@ import org.junit.Test;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 5720 $
* @ConQAT.Rating YELLOW Hash: 4571A458A75BDB6C9F08C3F09977ED48
* @ConQAT.Rating YELLOW Hash: 810790E3BA62BD3F00B6D580AE15311E
*/
public class SmokeComponentLibraryTest extends LibraryTestBase {
......@@ -58,7 +58,7 @@ public class SmokeComponentLibraryTest extends LibraryTestBase {
@Before
public void setUp() throws Exception {
// Bring up persistency service for this test
IPersistencyService.INSTANCE.getClass();
IPersistencyService.getInstance().getClass();
FileProject project =
loadProjectFromPlugin(AF3ComponentActivator.PLUGIN_ID,
"test-data/LibraryTests.af3_20", true);
......@@ -103,7 +103,7 @@ public class SmokeComponentLibraryTest extends LibraryTestBase {