Commit 2fec4612 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

SafetyCases: Java 9 compliance.

* Rename the class Module to SafetyModule.
* Make the class SafetyModule abstract (as per intention of the meta-model).
* Align the naming of the ModuleRef class (Library elements) --> SafetyModuleRef.
* Add a migrator for ModuleRef elements. A migrator for Module elements is not needed since this class has been used like an abstract one.
* Change the getFileProject utility class to handle cases in which the passed element is the FileProject.
refs 3104
parent 5c2c6b3a
ConstraintsProjectUtils.java 5f4eee9a2c710babc11c2943df7ba3fe3a7636eb GREEN
ExternalFileUtils.java 6f84f06caaf9b5091fac7221e2533558441f6155 GREEN
FileUtils.java 0f069000d3c4b5fcbc8ecd1b2abbe5c670629229 GREEN
FunctionScopeUtils.java 2338b20409080b5c7e644db8143581824f80c83d GREEN
LibraryModelElementFactory.java e33981a7adb3e2fc5a158b225f2c41c3e2cf9183 GREEN
ProjectModelElementFactory.java 573fd3ac782b94daad366f9a5a0a90e9721bce7b GREEN
ProjectUtils.java e4a1ca035a903fe0f118ccd6d9f9e26f863847a7 GREEN
ProjectUtils.java 3e236c5fe1157d21db5343ebd869496340e2fb26 YELLOW
TypeScopeUtils.java b2a1595c02350afc1324f3d17b697901d238aa92 GREEN
VariableScopeUtils.java 7a5058241b7d4ee154938eac6dd09e3e4a47443b GREEN
......@@ -56,21 +56,21 @@ import org.fortiss.tooling.kernel.utils.KernelModelElementUtils;
public final class ProjectUtils {
/**
* Returns the {@link FileProject} of a element.
* Returns the {@link FileProject} of an given element. The search is reflexive.
*
* @param element
* the element to start the search
* @return {@link FileProject}, which contains the given {@link EObject}. Returns {@code null}
* if no {@link FileProject} can be identified.
* The element to start the search.
* @return {@link FileProject}, which contains the given {@link EObject}, or itself if the given
* element is a {@link FileProject}. Returns {@code null} if no {@link FileProject} can
* be identified.
*/
public static FileProject getFileProject(EObject element) {
while(element != null) {
element = element.eContainer();
if(element instanceof FileProject) {
return (FileProject)element;
}
element = element.eContainer();
}
return null;
}
......@@ -87,8 +87,8 @@ public final class ProjectUtils {
* @return the specific configuration element contained in the project
* configuration.
*/
public static <T extends IProjectConfigurationElement> T getProjectConfigurationElement(
EObject element, Class<? extends T> clazz) {
public static <T extends IProjectConfigurationElement> T
getProjectConfigurationElement(EObject element, Class<? extends T> clazz) {
ProjectConfiguration projConfig = getRootElement(element, ProjectConfiguration.class);
if(projConfig == null) {
return null;
......@@ -158,8 +158,8 @@ public final class ProjectUtils {
* create it.
* @return the execution configuration for the given target element.
*/
public static ExecutionConfiguration findOrCreateExecutionConfigurationFor(
INamedElement targetElement) {
public static ExecutionConfiguration
findOrCreateExecutionConfigurationFor(INamedElement targetElement) {
final ExecutionConfigurationStore store =
getRootElement(targetElement, ExecutionConfigurationStore.class);
if(store == null) {
......@@ -196,9 +196,8 @@ public final class ProjectUtils {
ICommandStackService.getInstance().runAsCommand(targetElement, new Runnable() {
@Override
public void run() {
EObject rootElement =
IPersistencyService.getInstance().getTopLevelElementFor(targetElement)
.getRootModelElement();
EObject rootElement = IPersistencyService.getInstance()
.getTopLevelElementFor(targetElement).getRootModelElement();
IElementCompositorService.getInstance().compose(rootElement, newStore, null);
}
});
......
ArgumentModuleEditor.java 445fe9909eba69a993ae2915ca321b9a2db6ab67 YELLOW
ArgumentModuleEditorBinding.java f3097081f5882121b3c43d348a8987f6d14c9845 GREEN
ArgumentModuleEditorBinding.java ed6d93e7b2444f2f18baa0892d176e77b2a72568 YELLOW
ContractModuleEditor.java 48eaa95f705280282dc3eb927966491d08af06e2 GREEN
ContractModuleEditorBinding.java d40f04c2a169916d240a5bbb039a353c9e80be8e GREEN
ModuleRefEditor.java f558138509f4a248fd2a1a1282a255ae9e6bdfac GREEN
ModuleRefEditorBindings.java 1564fb2ae9fe1a907625d915e5cfa951232b805f GREEN
SafetyCasesEditor.java cc47256db03bed1570e9c548ade32b1998b00745 GREEN
ModuleRefEditorBindings.java 667fe031fa4f21347a5035d9599dba32a086049a YELLOW
SafetyCasesEditor.java e5faa91130fb20b737b65acb944fe70fa08de5b1 YELLOW
SafetyCasesEditorBinding.java 963cc69867a4fdbb7644ae7319673f78f9461b43 GREEN
......@@ -16,26 +16,26 @@
package org.fortiss.af3.safetycases.ui.editor;
import org.eclipse.ui.IEditorPart;
import org.fortiss.af3.safetycases.model.Module;
import org.fortiss.af3.safetycases.model.SafetyModule;
import org.fortiss.tooling.kernel.ui.extension.IModelEditorBinding;
/**
* {@link IModelEditorBinding} implementation for the
* editor opened by {@link Module} model element.
* editor opened by {@link SafetyModule} model element.
*
* @author carmen
*/
public class ArgumentModuleEditorBinding implements IModelEditorBinding<Module> {
public class ArgumentModuleEditorBinding implements IModelEditorBinding<SafetyModule> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass(Module object) {
public Class<? extends IEditorPart> getEditorClass(SafetyModule object) {
return ArgumentModuleEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel(Module object) {
public String getLabel(SafetyModule object) {
return "Argument Module";
}
......
......@@ -17,12 +17,12 @@ package org.fortiss.af3.safetycases.ui.editor;
import org.eclipse.ui.IEditorPart;
import org.fortiss.af3.safetycases.model.LibraryModule;
import org.fortiss.af3.safetycases.model.ModuleRef;
import org.fortiss.af3.safetycases.model.SafetyModuleRef;
import org.fortiss.tooling.kernel.ui.extension.IModelEditorBinding;
/**
* {@link IModelEditorBinding} implementation for the
* editor opened by {@link ModuleRef} model element.
* editor opened by {@link SafetyModuleRef} model element.
*
* @author carmen
*/
......
......@@ -7,7 +7,7 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.fortiss.af3.safetycases.model.InContextOf;
import org.fortiss.af3.safetycases.model.Module;
import org.fortiss.af3.safetycases.model.SafetyModule;
import org.fortiss.af3.safetycases.model.OptionEntity;
import org.fortiss.af3.safetycases.model.SafetyCase;
import org.fortiss.af3.safetycases.model.SupportedBy;
......@@ -41,7 +41,7 @@ public class SafetyCasesEditor extends DiagramEditorBase<SafetyCase> {
@SuppressWarnings("unchecked")
@Override
public Class<? extends EObject>[] getVisibleEObjectTypes() {
return new Class[] {SafetyCase.class, Module.class, SupportedBy.class, InContextOf.class,
return new Class[] {SafetyCase.class, SafetyModule.class, SupportedBy.class, InContextOf.class,
OptionEntity.class};
}
}
ArgumentModuleDiagramEditPart.java edc11f4e60acb03482649c599e1b0daf15aaf078 YELLOW
ArgumentModuleDiagramEditPart.java cc6d1201134f76ffaf38684cbef06f462b404268 YELLOW
ArgumentModuleEditPart.java 67e63e77a752afc5d4ad55f4177de80ea9f7424a YELLOW
AssumptionEditPart.java 57f8a1cbe040153419ef1aca38ff079e3898a9a3 YELLOW
AwayContextEditPart.java 98397acd1223db81dca0328c53305abab6be1b57 YELLOW
......@@ -6,13 +6,13 @@ AwayContractModuleEditPart.java 5099cfccd7bec2ac9903ff557bb6e51e954d3293 YELLOW
AwayGoalEditPart.java 2093fe3b52e3f08be7c1cba945e11030272cd411 YELLOW
AwaySolutionEditPart.java b24b1f51b5ddfe02ec5912e47a7d2491a18ead00 YELLOW
ContextEditPart.java 1dc9b04718fe355645bcd7061b2be8cab0de0bbb YELLOW
ContractModuleDiagramEditPart.java 37d66b4ca89ddeaed7eba5ce4bb1627d779c5f16 YELLOW
ContractModuleDiagramEditPart.java 13b2f56ea9a840630aca5622b0c2af953ceecb35 YELLOW
ContractModuleEditPart.java ca97955388175075db3cfd367813292cfb60b4f1 YELLOW
EditPartFactory.java 697c2576a59e6fd594325fa979bc2097801c6434 YELLOW
EntryConnectorEditPart.java 34249cc6f7ce1925e21a4c6020f9bef575e27085 YELLOW
ExitConnectorEditPart.java a66a852025bf1462cfc6efbc3151ca88e6cb619c YELLOW
FreeEntryConnectorEditPart.java 9a99010daf7a046aea2d43bf0b091320520f6d75 YELLOW
FreeExitConnectorEditPart.java 137f826ac24dd71fce5c8cd472f4e5a0668b4c48 YELLOW
FreeEntryConnectorEditPart.java efc4177932397aae7b0c8b97e381797a23ffebb2 YELLOW
FreeExitConnectorEditPart.java 9306197778e08359142951c88bb9f4d2f787c3b0 YELLOW
GSNEditPart.java 651ff7652f6867f818123e4afd338b3ebc6ac600 YELLOW
GSNPositionedEditPartBase.java c99f7f1db7ecb97163dfae3279e59e63238f7e2c YELLOW
GSNPositionedEditPartBaseForRoundFigures.java 01371e397c6a1f271bacc925baac15d1b99a1c71 YELLOW
......
......@@ -19,7 +19,7 @@ import java.util.ArrayList;
import java.util.List;
import org.fortiss.af3.safetycases.model.ArgumentModule;
import org.fortiss.af3.safetycases.model.ModuleRef;
import org.fortiss.af3.safetycases.model.SafetyModuleRef;
import org.fortiss.tooling.base.ui.editpart.DiagramEditPartBase;
import org.fortiss.tooling.base.ui.layout.RectangleGridLayoutDiagramConfiguration;
......@@ -43,8 +43,8 @@ public class ArgumentModuleDiagramEditPart extends DiagramEditPartBase<ArgumentM
result.addAll(getModel().getContainedElements());
List<Object> connectorsList;
if(getModel() instanceof ModuleRef) {
connectorsList = (List)((ModuleRef)getModel()).getLibraryModuleShadow().getConnectors();
if(getModel() instanceof SafetyModuleRef) {
connectorsList = (List)((SafetyModuleRef)getModel()).getLibraryModuleShadow().getConnectors();
} else {
connectorsList = (List)modelElementHandler.getConnectors(getModel());
}
......
......@@ -19,7 +19,7 @@ import java.util.ArrayList;
import java.util.List;
import org.fortiss.af3.safetycases.model.ContractModule;
import org.fortiss.af3.safetycases.model.ModuleRef;
import org.fortiss.af3.safetycases.model.SafetyModuleRef;
import org.fortiss.tooling.base.ui.editpart.DiagramEditPartBase;
import org.fortiss.tooling.base.ui.layout.RectangleGridLayoutDiagramConfiguration;
......@@ -43,8 +43,8 @@ public class ContractModuleDiagramEditPart extends DiagramEditPartBase<ContractM
result.addAll(getModel().getContainedElements());
List<Object> connectorsList;
if(getModel() instanceof ModuleRef) {
connectorsList = (List)((ModuleRef)getModel()).getLibraryModuleShadow().getConnectors();
if(getModel() instanceof SafetyModuleRef) {
connectorsList = (List)((SafetyModuleRef)getModel()).getLibraryModuleShadow().getConnectors();
} else {
connectorsList = (List)modelElementHandler.getConnectors(getModel());
}
......
......@@ -16,7 +16,7 @@
package org.fortiss.af3.safetycases.ui.editpart;
import org.fortiss.af3.safetycases.model.EntryConnector;
import org.fortiss.af3.safetycases.model.Module;
import org.fortiss.af3.safetycases.model.SafetyModule;
import org.fortiss.tooling.base.model.base.ConnectorBase;
import org.fortiss.tooling.base.ui.editpart.FreeConnectorEditPartBase;
......@@ -34,7 +34,7 @@ public class FreeEntryConnectorEditPart extends FreeConnectorEditPartBase<Connec
/** {@inheritDoc} */
@Override
protected Module getRootHierarchicElement() {
return (Module)getModel().eContainer();
protected SafetyModule getRootHierarchicElement() {
return (SafetyModule)getModel().eContainer();
}
}
......@@ -16,7 +16,7 @@
package org.fortiss.af3.safetycases.ui.editpart;
import org.fortiss.af3.safetycases.model.ExitConnector;
import org.fortiss.af3.safetycases.model.Module;
import org.fortiss.af3.safetycases.model.SafetyModule;
import org.fortiss.tooling.base.model.base.ConnectorBase;
import org.fortiss.tooling.base.ui.editpart.FreeConnectorEditPartBase;
......@@ -34,7 +34,7 @@ public class FreeExitConnectorEditPart extends FreeConnectorEditPartBase<Connect
/** {@inheritDoc} */
@Override
protected Module getRootHierarchicElement() {
return (Module)getModel().eContainer();
protected SafetyModule getRootHierarchicElement() {
return (SafetyModule)getModel().eContainer();
}
}
AbstractArgumentModuleToImage.java d4781ff0bcd2bb60150bd98461a72bb0f9cc1206 YELLOW
ExportArgumentModuleToImage.java 8adcff8cbe05c9f95124c58155307f00e4ff36d2 YELLOW
ExportArgumentModuleToImage.java 13319bc35ffd6a29dd80e107151e86a84710f052 YELLOW
......@@ -32,7 +32,7 @@ import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.fortiss.af3.safetycases.model.ArgumentModule;
import org.fortiss.af3.safetycases.model.ModuleRef;
import org.fortiss.af3.safetycases.model.SafetyModuleRef;
import org.fortiss.af3.safetycases.ui.AF3SafetyCasesUIActivator;
import org.fortiss.af3.safetycases.ui.editor.ArgumentModuleEditor;
import org.fortiss.af3.safetycases.ui.exporter.dialog.ArgumentModuleToImageDialog;
......@@ -56,7 +56,7 @@ public class ExportArgumentModuleToImage extends AbstractArgumentModuleToImage {
selectedArgumentModule = null;
if(contextProvider instanceof ArgumentModuleEditor ||
contextProvider instanceof NavigatorViewPart) {
if(selection instanceof ArgumentModule && !(selection instanceof ModuleRef)) {
if(selection instanceof ArgumentModule && !(selection instanceof SafetyModuleRef)) {
selectedArgumentModule = (ArgumentModule)selection;
final List<IContributionItem> contributionItems =
new ArrayList<IContributionItem>();
......
ArgumentModuleToImageDialog.java cdcca73959f8e4eb8512f79a10a87cb4368f1f49 YELLOW
ModelToDocumentDialog.java 0bda3dc6aa84a0e2e91ca146728d72448ee427e8 YELLOW
ModelToDocumentDialog.java 9d97ae618b6215872387bffa1529ad4dbb9bd808 RED
AddArgumentModuleToLibrary.java 3ec845b05bd49cb7c106631ae0c84ba182c47ced GREEN
ConvertReferenceToArgumentModule.java f39817417c6bed1c2bd6baacfe47f6f5ae9b82fd GREEN
AddArgumentModuleToLibrary.java cd0503173c1348a2b1633488b54938deb6457043 YELLOW
ConvertReferenceToArgumentModule.java cd34fb7a3cb943b33bd7148fec855e4e778be06f YELLOW
......@@ -31,7 +31,7 @@ import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.fortiss.af3.safetycases.model.ArgumentModule;
import org.fortiss.af3.safetycases.model.LibraryModulePackage;
import org.fortiss.af3.safetycases.model.ModuleRef;
import org.fortiss.af3.safetycases.model.SafetyModuleRef;
import org.fortiss.af3.safetycases.ui.AF3SafetyCasesUIActivator;
import org.fortiss.tooling.kernel.model.ILibraryPackage;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor;
......@@ -48,7 +48,7 @@ public class AddArgumentModuleToLibrary implements IContextMenuContributor {
@Override
public List<IContributionItem> getContributedItems(EObject selection,
ContextMenuContextProvider contextProvider) {
if(selection instanceof ArgumentModule && !(selection instanceof ModuleRef)) {
if(selection instanceof ArgumentModule && !(selection instanceof SafetyModuleRef)) {
List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
AddModuleToLibraryAction action =
new AddModuleToLibraryAction((ArgumentModule)selection);
......
......@@ -27,13 +27,13 @@ import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.fortiss.af3.safetycases.model.ArgumentElementBase;
import org.fortiss.af3.safetycases.model.ModuleRef;
import org.fortiss.af3.safetycases.model.SafetyModuleRef;
import org.fortiss.af3.safetycases.ui.AF3SafetyCasesUIActivator;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
/**
* Menu for converting {@link ModuleRef} references into {@link ArgumentElementBase}.
* Menu for converting {@link SafetyModuleRef} references into {@link ArgumentElementBase}.
*
* @author carmen
*/
......@@ -43,10 +43,10 @@ public class ConvertReferenceToArgumentModule implements IContextMenuContributor
@Override
public List<IContributionItem> getContributedItems(EObject selection,
ContextMenuContextProvider contextProvider) {
if(selection instanceof ModuleRef) {
if(selection instanceof SafetyModuleRef) {
List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
ConvertModuleRefToModuleAction action =
new ConvertModuleRefToModuleAction((ModuleRef)selection);
new ConvertModuleRefToModuleAction((SafetyModuleRef)selection);
contributionItems.add(new ActionContributionItem(action));
return contributionItems;
}
......@@ -63,10 +63,10 @@ public class ConvertReferenceToArgumentModule implements IContextMenuContributor
private class ConvertModuleRefToModuleAction extends Action {
/** The selected module reference. */
private ModuleRef selectedModuleRef;
private SafetyModuleRef selectedModuleRef;
/** Constructor. */
ConvertModuleRefToModuleAction(ModuleRef selectedModuleReference) {
ConvertModuleRefToModuleAction(SafetyModuleRef selectedModuleReference) {
super("Disconnect from library", AF3SafetyCasesUIActivator
.getImageDescriptor("icons/library.png"));
this.selectedModuleRef = selectedModuleReference;
......
ArgumentElementPropertySection.java d8f6934abee2edd6fe8c30e998a6ce4087e9ee01 YELLOW
ArgumentElementPropertySection.java ccbeac457dd298be80c8caf8b2ce40a171a6af4b YELLOW
ArgumentModulePropertySection.java e6b7a3252ab613ec18ddd2371a1f2e4ff7ded47c GREEN
AwayEntityPropertySection.java 4fc2c744103ecf4752fd399468da89de79c08fd2 GREEN
ConnectionPropertySection.java d69632bcff7c0a7b49b4b76eb777c42c879cd5d1 GREEN
......
......@@ -56,7 +56,7 @@ import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.safetycases.model.ArgumentElementBase;
import org.fortiss.af3.safetycases.model.AwayArgumentElement;
import org.fortiss.af3.safetycases.model.AwaySolution;
import org.fortiss.af3.safetycases.model.Module;
import org.fortiss.af3.safetycases.model.SafetyModule;
import org.fortiss.af3.safetycases.model.OptionEntity;
import org.fortiss.af3.safetycases.model.Solution;
import org.fortiss.af3.safetycases.ui.utils.StringToClaimValidator;
......@@ -231,7 +231,7 @@ public class ArgumentElementPropertySection extends PropertySectionBase {
claimText.setEnabled(isSolution);
if(currentlySelectedGSNElement instanceof OptionEntity ||
currentlySelectedGSNElement instanceof Module ||
currentlySelectedGSNElement instanceof SafetyModule ||
currentlySelectedGSNElement instanceof AwayArgumentElement) {
addDocumentReferenceButton.setEnabled(false);
removeDocumentReferenceButton.setEnabled(false);
......
AF3SelectionDialogUtils.java 42aeea21957fbf517baf88d9f352013367c85031 GREEN
ComponentsContentProvider.java 75ccc34620fc54501bec4ed3af2d4e496c4cf515 GREEN
GSNSelectionDialogUtils.java e479305b653f07cfbc164993ada98d440853ad8f YELLOW
GSNSelectionDialogUtils.java 8944227c6b3ef42e8e77031c3cbc0995a71cd22f YELLOW
GoalsContentProvider.java 533b420587ad41007c4cb0dc7eaadefcf76f9967 GREEN
InstantiationOfGSNElementsUtils.java ed1af34020a7d12202985def9fb8273a888ab8d2 RED
InstantiationOfGSNElementsUtils.java 09ea99d5ecb222487574c66761bb4a5decb5b00d RED
OptionEntityInstantiation.java 3071b85086e485c3a8ee8d2a61f9dfb3fdcef396 GREEN
SRContentProvider.java 390684edfb38a062bbd79d82dd4cba457cb656d6 GREEN
SafetyCasesLibraryUIUtils.java d87b5cc8dbd9b62972218bf5b36d4f8879a9286b GREEN
StringToClaimValidator.java ebd6b17c81ec1d8ccfffc749bbc65e82f2625a08 GREEN
StringToGsnIdValidator.java 68444753692b681799540242117b95653b4ac65f GREEN
StringToRequiredNumberValidator.java b8e58caa0bf7252225fdadbd01047d228ba5b8f3 GREEN
StringToRequiredNumberValidator.java 78b1ce142b2cdd2b9283a78d1cf5e3ac2ffc564a RED
TextHyperlinkingUtils.java 2baed81fe929ed523676034d93024198b242fc52 YELLOW
Utils.java 549312835ab4cd6f63118f54613f05b58f5bc47d GREEN
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment