Skip to content

Commit

Permalink
avoid useless assignment to local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Nov 17, 2023
1 parent 5a37af9 commit fca9872
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 14 deletions.
Expand Up @@ -82,13 +82,11 @@ public void pushRedo(TextInfo delta) {
}

public TextInfo popUndo() {
TextInfo res = undo.pop();
return res;
return undo.pop();
}

public TextInfo popRedo() {
TextInfo res = redo.pop();
return res;
return redo.pop();
}

public void clearRedo() {
Expand Down
Expand Up @@ -64,7 +64,6 @@ public Iterable<Diagnostic> getDiagnostic(final EObject eObject, final EStructur
context.put(SubstitutionLabelProvider.class,
new DatabindingSubstitutionLabelProvider(eObject, labelProvider, featureLabelCaptionProvider));
List<Diagnostic> diagnostics = diagnosticUtil.flatten(diagnostician.validate(eObject, context));
Iterable<Diagnostic> filtered = filter(diagnostics, d -> contains(d.getData(), feature));
return filtered;
return filter(diagnostics, d -> contains(d.getData(), feature));
}
}
Expand Up @@ -164,8 +164,7 @@ public Image getImage(Object element) {
return null;
}

Image ret = polymorphicGetImage(element, geteStructuralFeature());
return ret;
return polymorphicGetImage(element, geteStructuralFeature());
}

@Override
Expand Down
Expand Up @@ -123,7 +123,7 @@ protected TableViewerColumn createTableViewerColumn(

private SelectionAdapter getSelectionAdapter(final TableViewer viewer, final TableColumn column,
final int index) {
SelectionAdapter selectionAdapter = new SelectionAdapter() {
return new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
GenericFeatureViewerComparator comparator = (GenericFeatureViewerComparator) viewer.getComparator();
Expand All @@ -134,6 +134,5 @@ public void widgetSelected(SelectionEvent e) {
viewer.refresh();
}
};
return selectionAdapter;
}
}
Expand Up @@ -49,8 +49,7 @@ public Text createText(Composite parent, String text, int style) {

@Override
public ComboViewer createComboViewer(Composite parent, int style) {
ComboViewer combo = new ComboViewer(parent, style);
return combo;
return new ComboViewer(parent, style);
}

@Override
Expand Down
Expand Up @@ -106,8 +106,7 @@ public void assertContainsMessage(String messagePart) {
}

protected String eventsToString() {
String eventsToString = join(map(logListener.getEvents(), it -> it.getMessage().toString()), ",");
return eventsToString;
return join(map(logListener.getEvents(), it -> it.getMessage().toString()), ",");
}

public void assertEmpty() {
Expand Down

0 comments on commit fca9872

Please sign in to comment.