Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-09-24 18:51:52 +0000
committerEd Willink2016-09-24 20:26:33 +0000
commit1c02ad58a4987306888366ff9c43c8b4a4c4a875 (patch)
tree1c85d3fa6e48349a399beb950aa87fe1f9a35873 /plugins
parentcd6a485dab91f2a152f103734b307e8e3e838abe (diff)
downloadorg.eclipse.qvtd-1c02ad58a4987306888366ff9c43c8b4a4c4a875.tar.gz
org.eclipse.qvtd-1c02ad58a4987306888366ff9c43c8b4a4c4a875.tar.xz
org.eclipse.qvtd-1c02ad58a4987306888366ff9c43c8b4a4c4a875.zip
[unrelated] Resolve new M2 @NonNull errorsI201609250536
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java10
-rw-r--r--plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/launching/DirectionalMainTab.java22
-rw-r--r--plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/core/QVTiDebugCore.java28
-rw-r--r--plugins/org.eclipse.qvtd.pivot.schedule/src/org/eclipse/qvtd/pivot/schedule/utilities/MutiNamedElementKeyImpl.java30
4 files changed, 37 insertions, 53 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java
index fe7c411bd..370e272e3 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java
@@ -177,21 +177,21 @@ public abstract class SchedulerConstants
//
// Extract salient characteristics from the DependencyGraph.
//
- analyzeDatums(dependencyGraph.getDatums());
+ analyzeDatums(ClassUtil.nullFree(dependencyGraph.getDatums()));
}
- private void analyzeDatums(/*@NonNull*/ List<? extends AbstractDatum> datums) {
- for (AbstractDatum abstractDatum : datums) {
+ private void analyzeDatums(/*@NonNull*/ List<@NonNull ? extends AbstractDatum> datums) {
+ for (@NonNull AbstractDatum abstractDatum : datums) {
if (abstractDatum instanceof ClassDatum) {
ClassDatum classDatum = (ClassDatum)abstractDatum;
// class2classDatum.put(classDatum.getType(), classDatum);
- analyzeDatums(classDatum.getPropertyDatums());
+ analyzeDatums(ClassUtil.nullFree(classDatum.getPropertyDatums()));
}
else if (abstractDatum instanceof PropertyDatum) {
PropertyDatum propertyDatum = (PropertyDatum)abstractDatum;
property2propertyDatum.put(propertyDatum.getProperty(), propertyDatum);
}
- analyzeDatums(abstractDatum.getSub());
+ analyzeDatums(ClassUtil.nullFree(abstractDatum.getSub()));
}
}
diff --git a/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/launching/DirectionalMainTab.java b/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/launching/DirectionalMainTab.java
index 651d73cb1..63b84403d 100644
--- a/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/launching/DirectionalMainTab.java
+++ b/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/launching/DirectionalMainTab.java
@@ -55,25 +55,25 @@ public abstract class DirectionalMainTab extends MainTab implements QVTcLaunchCo
gl_directionGroup.marginHeight = 0;
directionGroup.setLayout(gl_directionGroup);
directionGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
-
+
Label modeLabel = new Label(directionGroup, SWT.NONE);
modeLabel.setSize(31, 15);
modeLabel.setText("Mode");
-
+
modeCombo = new Combo(directionGroup, SWT.NONE);
modeCombo.setToolTipText("Whether the execution\n- checks that the output corresponds to the input\n- creates new output model elements\n- updates existing model elements where possible ");
modeCombo.setItems(new String[] {/*CHECK_MODE,*/ ENFORCE_CREATE_MODE, /*ENFORCE_UPDATE_MODE*/});
modeCombo.select(0);
-
+
Label directionLabel = new Label(directionGroup, SWT.NONE);
directionLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
directionLabel.setText("Direction");
-
+
directionCombo = new Combo(directionGroup, SWT.NONE);
directionCombo.setToolTipText("Select enforceable output domain to choose the direction of a multi-directional transformation");
directionCombo.setItems(new String[] {"NONE"});
directionCombo.select(0);
-
+
viewCheckButton = new Button(directionGroup, SWT.CHECK);
viewCheckButton.setToolTipText("Whether the output may be a view of a larger model, or must be the whole model.");
viewCheckButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
@@ -138,7 +138,7 @@ public abstract class DirectionalMainTab extends MainTab implements QVTcLaunchCo
}
protected void setDirections(@NonNull Set<TypedModel> enforceables) {
-// System.out.println("setDirections");
+ // System.out.println("setDirections");
if (directionCombo.isDisposed()) {
return;
}
@@ -160,7 +160,7 @@ public abstract class DirectionalMainTab extends MainTab implements QVTcLaunchCo
@Override
protected void updateDirection(@NonNull Transformation transformation) {
-// System.out.println("updateDirection");
+ // System.out.println("updateDirection");
setDirections(QVTbaseUtil.getEnforceableTypedModels(transformation));
}
@@ -191,7 +191,6 @@ public abstract class DirectionalMainTab extends MainTab implements QVTcLaunchCo
for (TypedModel inputModel : inputModels) {
if (inputs.add(inputModel)) {
String name = inputModel.getName();
- assert name != null;
if (name != null) {
newInputsMap.put(name, null); //getDefaultPath(outputsGroup, name));
}
@@ -200,7 +199,6 @@ public abstract class DirectionalMainTab extends MainTab implements QVTcLaunchCo
for (TypedModel outputModel : outputModels) {
if (outputs.add(outputModel)) {
String name = outputModel.getName();
- assert name != null;
if (name != null) {
oldOutputsMap.put(name, null); //getDefaultPath(outputsGroup, name));
}
@@ -211,7 +209,6 @@ public abstract class DirectionalMainTab extends MainTab implements QVTcLaunchCo
for (TypedModel inputModel : inputModels) {
if (inputs.add(inputModel)) {
String name = inputModel.getName();
- assert name != null;
if (name != null) {
newInputsMap.put(name, null); //getDefaultPath(outputsGroup, name));
}
@@ -220,7 +217,6 @@ public abstract class DirectionalMainTab extends MainTab implements QVTcLaunchCo
for (TypedModel outputModel : outputModels) {
if (outputs.add(outputModel)) {
String name = outputModel.getName();
- assert name != null;
if (name != null) {
newOutputsMap.put(name, null); //getDefaultPath(outputsGroup, name));
}
@@ -231,7 +227,6 @@ public abstract class DirectionalMainTab extends MainTab implements QVTcLaunchCo
for (TypedModel inputModel : inputModels) {
if (inputs.add(inputModel)) {
String name = inputModel.getName();
- assert name != null;
if (name != null) {
oldInputsMap.put(name, null); //getDefaultPath(outputsGroup, name));
newInputsMap.put(name, null); //getDefaultPath(outputsGroup, name));
@@ -241,7 +236,6 @@ public abstract class DirectionalMainTab extends MainTab implements QVTcLaunchCo
for (TypedModel outputModel : outputModels) {
if (outputs.add(outputModel)) {
String name = outputModel.getName();
- assert name != null;
if (name != null) {
oldOutputsMap.put(name, null); //getDefaultPath(outputsGroup, name));
newOutputsMap.put(name, null); //getDefaultPath(outputsGroup, name));
@@ -249,7 +243,7 @@ public abstract class DirectionalMainTab extends MainTab implements QVTcLaunchCo
}
}
}
-/* for (TypedModel outputModel : outputModels) {
+ /* for (TypedModel outputModel : outputModels) {
if (outputs.add(outputModel)) {
String name = outputModel.getName();
assert name != null;
diff --git a/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/core/QVTiDebugCore.java b/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/core/QVTiDebugCore.java
index bb272f3b9..b49473b4c 100644
--- a/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/core/QVTiDebugCore.java
+++ b/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/core/QVTiDebugCore.java
@@ -27,21 +27,21 @@ import org.eclipse.qvtd.debug.QVTiDebugPlugin;
public class QVTiDebugCore extends VMDebugCore
{
public static final @NonNull QVTiDebugCore INSTANCE = new QVTiDebugCore();
-
+
public static final @NonNull String BREAKPOINT_MARKER_ID = "org.eclipse.qvtd.debug.QVTdBreakpointMarker"; //$NON-NLS-1$
public static final @NonNull String MODEL_ID = "org.eclipse.qvtd.debug"; //$NON-NLS-1$
public static final @NonNull String DEBUGGER_ACTIVE_PROPERTY = "org.eclipse.qvtd.debug.debuggerActive"; //$NON-NLS-1$
-
+
// The plug-in fBreakpointID
- public static final @NonNull String PLUGIN_ID = QVTiDebugPlugin.PLUGIN_ID; //$NON-NLS-1$
+ public static final @NonNull String PLUGIN_ID = QVTiDebugPlugin.PLUGIN_ID;
private static final @NonNull String EXCEPTIONS_CATCHING = PLUGIN_ID + "/exceptions/catching"; //$NON-NLS-1$
private static final @NonNull String EXCEPTIONS_THROWING = PLUGIN_ID + "/exceptions/throwing"; //$NON-NLS-1$
private static final @NonNull String METHODS_ENTERING = PLUGIN_ID + "/methods/entering"; //$NON-NLS-1$
private static final @NonNull String METHODS_EXITING = PLUGIN_ID + "/methods/exiting"; //$NON-NLS-1$
-
+
private static final @NonNull EssentialOCLLocationInFileProvider locationInFileProvider = new EssentialOCLLocationInFileProvider();
-
+
public static @NonNull Trace TRACE = new Trace(EXCEPTIONS_CATCHING, EXCEPTIONS_THROWING, METHODS_ENTERING, METHODS_EXITING);
private QVTiDebugCore() {}
@@ -55,9 +55,9 @@ public class QVTiDebugCore extends VMDebugCore
public @NonNull String getDebuggerActiveProperty() {
return DEBUGGER_ACTIVE_PROPERTY;
}
-
+
@Override
- public @NonNull List<QVTiLineBreakpoint> getLineBreakpoints() {
+ public @NonNull List<@NonNull QVTiLineBreakpoint> getLineBreakpoints() {
return getOCLBreakpoints(QVTiLineBreakpoint.class);
}
@@ -66,17 +66,17 @@ public class QVTiDebugCore extends VMDebugCore
return locationInFileProvider;
}
- @Override
+ @Override
public @Nullable ILog getLog() {
- QVTiDebugPlugin debugPlugin = QVTiDebugPlugin.getDefault();
+ QVTiDebugPlugin debugPlugin = QVTiDebugPlugin.getDefault();
return debugPlugin != null ? debugPlugin.getLog() : null;
- }
-
+ }
+
@Override
public @NonNull String getModelId() {
return MODEL_ID;
}
-
+
@Override
public @NonNull String getPluginId() {
return PLUGIN_ID;
@@ -86,9 +86,9 @@ public class QVTiDebugCore extends VMDebugCore
public @NonNull Trace getTrace() {
return TRACE;
}
-
+
@Override
public @NonNull String getVMThreadName() {
return "QVTi VM";
- }
+ }
}
diff --git a/plugins/org.eclipse.qvtd.pivot.schedule/src/org/eclipse/qvtd/pivot/schedule/utilities/MutiNamedElementKeyImpl.java b/plugins/org.eclipse.qvtd.pivot.schedule/src/org/eclipse/qvtd/pivot/schedule/utilities/MutiNamedElementKeyImpl.java
index 78aa7d34f..84230f982 100644
--- a/plugins/org.eclipse.qvtd.pivot.schedule/src/org/eclipse/qvtd/pivot/schedule/utilities/MutiNamedElementKeyImpl.java
+++ b/plugins/org.eclipse.qvtd.pivot.schedule/src/org/eclipse/qvtd/pivot/schedule/utilities/MutiNamedElementKeyImpl.java
@@ -24,21 +24,17 @@ import org.eclipse.ocl.pivot.NamedElement;
public class MutiNamedElementKeyImpl implements MultiValueKey<NamedElement, String>
{
public static final @NonNull MultiValueKey<?, ?> EMPTY_LIST = new MutiNamedElementKeyImpl();
-
- private final @NonNull List<String> valueIds = new ArrayList<String>();
- private final @NonNull NamedElement[] values;
+
+ private final @NonNull List<String> valueIds = new ArrayList<>();
+ private final @NonNull NamedElement @NonNull [] values;
private int hashCode;
-
- public MutiNamedElementKeyImpl(@NonNull NamedElement... values) {
+
+ public MutiNamedElementKeyImpl(@NonNull NamedElement @NonNull ... values) {
//this.parametersId = IdManager.getParametersId(parameterTypes);
this.values = values;
- for (NamedElement v : values) {
- if (v != null) {
- valueIds.add(v.getName());
- } else {
- valueIds.add("null");
- }
+ for (@NonNull NamedElement v : values) {
+ valueIds.add(v.getName());
}
hashCode = valueIds.hashCode();
}
@@ -57,14 +53,8 @@ public class MutiNamedElementKeyImpl implements MultiValueKey<NamedElement, Stri
return false;
}
for (int i = 0; i < values.length; i++) {
- if (values[i] != null) {
- if (!values[i].equals(thoseValues[i])) {
- return false;
- }
- } else {
- if (values[i] != thoseValues[i]) {
- return false;
- }
+ if (!values[i].equals(thoseValues[i])) {
+ return false;
}
}
return true;
@@ -87,7 +77,7 @@ public class MutiNamedElementKeyImpl implements MultiValueKey<NamedElement, Stri
public @NonNull NamedElement[] get() {
return values;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.qvtd.pivot.schedule.utilities.MultiValueKey#getParameters()
*/

Back to the top