fixed PMD warnings

This commit is contained in:
anhefti 2019-10-08 13:08:01 +02:00
parent e5560ea2f3
commit 54cf9fc5fe
13 changed files with 27 additions and 36 deletions

View file

@ -29,7 +29,7 @@ public class ProxyData {
final int proxyPort, final int proxyPort,
final CharSequence proxyAuthUsername, final CharSequence proxyAuthUsername,
final CharSequence proxyAuthSecret) { final CharSequence proxyAuthSecret) {
;
this.proxyAuthType = proxyAuthType; this.proxyAuthType = proxyAuthType;
this.proxyName = proxyName; this.proxyName = proxyName;
this.proxyPort = proxyPort; this.proxyPort = proxyPort;

View file

@ -220,11 +220,6 @@ public final class UserInfo implements UserAccount, Activatable, Serializable {
return new EntityKey(this.uuid, entityType()); return new EntityKey(this.uuid, entityType());
} }
@Override
public Object clone() throws CloneNotSupportedException {
return UserInfo.of(this);
}
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;

View file

@ -121,7 +121,6 @@ public class InstitutionList implements TemplateComposer {
.newAction(ActionDefinition.INSTITUTION_MODIFY_FROM_LIST) .newAction(ActionDefinition.INSTITUTION_MODIFY_FROM_LIST)
.withSelect(table::getSelection, PageAction::applySingleSelection, EMPTY_SELECTION_TEXT_KEY) .withSelect(table::getSelection, PageAction::applySingleSelection, EMPTY_SELECTION_TEXT_KEY)
.publishIf(() -> instGrant.m() && table.hasAnyContent()); .publishIf(() -> instGrant.m() && table.hasAnyContent());
;
} }
} }

View file

@ -215,8 +215,6 @@ public class LmsSetupForm implements TemplateComposer {
? restService.getRestCall(NewLmsSetup.class) ? restService.getRestCall(NewLmsSetup.class)
: restService.getRestCall(SaveLmsSetup.class)); : restService.getRestCall(SaveLmsSetup.class));
;
// propagate content actions to action-pane // propagate content actions to action-pane
this.pageService.pageActionBuilder(formContext.clearEntityKeys()) this.pageService.pageActionBuilder(formContext.clearEntityKeys())

View file

@ -468,7 +468,7 @@ public class ActivitiesPane implements TemplateComposer {
} }
for (final TreeItem item : items) { for (final TreeItem item : items) {
if (item == currentSelection) { if (item.equals(currentSelection)) {
return true; return true;
} }
} }

View file

@ -107,6 +107,7 @@ interface CellFieldBuilderAdapter {
default: { default: {
label.setAlignment(SWT.LEFT); label.setAlignment(SWT.LEFT);
break;
} }
} }
label.setLayoutData(gridData); label.setLayoutData(gridData);

View file

@ -79,6 +79,7 @@ public class TextFieldBuilder implements InputFieldBuilder {
} }
default: { default: {
text = new Text(innerGrid, SWT.LEFT | SWT.BORDER); text = new Text(innerGrid, SWT.LEFT | SWT.BORDER);
break;
} }
} }
text.setLayoutData(gridData); text.setLayoutData(gridData);

View file

@ -312,7 +312,7 @@ public class DefaultPageLayout implements TemplateComposer {
urlLauncher.openURL(link); urlLauncher.openURL(link);
} }
} catch (final Exception e) { } catch (final Exception e) {
log.error("Invalid Help link", e);
} }
}); });

View file

@ -233,7 +233,8 @@ public class PageServiceImpl implements PageService {
.logout(); .logout();
if (!logoutSuccessful) { if (!logoutSuccessful) {
// TODO error handling log.error("Failed to logout. See logfiles for more information");
pageContext.notifyError(new RuntimeException("Failed to logout. See logfiles for more information"));
} }
} catch (final Exception e) { } catch (final Exception e) {

View file

@ -455,10 +455,10 @@ public class EntityTable<ROW extends Entity> {
final Widget widget = event.widget; final Widget widget = event.widget;
if (widget instanceof TableColumn) { if (widget instanceof TableColumn) {
final TableColumn tableColumn = ((TableColumn) widget); final TableColumn tableColumn = ((TableColumn) widget);
if (this.filter != null && if (this.filter != null) {
this.filter.adaptColumnWidth( this.filter.adaptColumnWidth(
this.table.indexOf(tableColumn), this.table.indexOf(tableColumn),
tableColumn.getWidth())) { tableColumn.getWidth());
} }
} }
} }

View file

@ -352,33 +352,33 @@ public class GridTable extends Composite {
private static class CheckBox implements ControlAdapter { private static class CheckBox implements ControlAdapter {
private final Button checkbox; private final Button checkboxButton;
private final ColumnDef columnDef; private final ColumnDef columnDef;
CheckBox(final Composite parent, final ColumnDef columnDef, final Listener listener) { CheckBox(final Composite parent, final ColumnDef columnDef, final Listener listener) {
this.checkbox = new Button(parent, SWT.CHECK); this.checkboxButton = new Button(parent, SWT.CHECK);
this.checkbox.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); this.checkboxButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
this.columnDef = columnDef; this.columnDef = columnDef;
if (listener != null) { if (listener != null) {
this.checkbox.addListener(SWT.Selection, listener); this.checkboxButton.addListener(SWT.Selection, listener);
} }
} }
@Override @Override
public String getValue() { public String getValue() {
return this.checkbox.getSelection() return this.checkboxButton.getSelection()
? Constants.TRUE_STRING ? Constants.TRUE_STRING
: Constants.FALSE_STRING; : Constants.FALSE_STRING;
} }
@Override @Override
public void setValue(final String value) { public void setValue(final String value) {
this.checkbox.setSelection(BooleanUtils.toBoolean(value)); this.checkboxButton.setSelection(BooleanUtils.toBoolean(value));
} }
@Override @Override
public void dispose() { public void dispose() {
this.checkbox.dispose(); this.checkboxButton.dispose();
} }
@Override @Override
@ -389,30 +389,30 @@ public class GridTable extends Composite {
private static class TextField implements ControlAdapter { private static class TextField implements ControlAdapter {
private final Text textField; private final Text _textField;
private final ColumnDef columnDef; private final ColumnDef columnDef;
TextField(final Composite parent, final ColumnDef columnDef, final Listener listener) { TextField(final Composite parent, final ColumnDef columnDef, final Listener listener) {
this.textField = new Text(parent, SWT.LEFT | SWT.BORDER); this._textField = new Text(parent, SWT.LEFT | SWT.BORDER);
this.textField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); this._textField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
this.columnDef = columnDef; this.columnDef = columnDef;
this.textField.addListener(SWT.FocusOut, listener); this._textField.addListener(SWT.FocusOut, listener);
this.textField.addListener(SWT.Traverse, listener); this._textField.addListener(SWT.Traverse, listener);
} }
@Override @Override
public String getValue() { public String getValue() {
return this.textField.getText(); return this._textField.getText();
} }
@Override @Override
public void setValue(final String value) { public void setValue(final String value) {
this.textField.setText((value != null) ? value : ""); this._textField.setText((value != null) ? value : "");
} }
@Override @Override
public void dispose() { public void dispose() {
this.textField.dispose(); this._textField.dispose();
} }
@Override @Override

View file

@ -183,6 +183,7 @@ public class PaginationServiceImpl implements PaginationService {
} }
default: { default: {
PageHelper.orderBy(sortColumnName); PageHelper.orderBy(sortColumnName);
break;
} }
} }
} }

View file

@ -116,11 +116,6 @@ public final class SEBServerUser implements UserDetails, CredentialsContainer {
this.password = null; this.password = null;
} }
@Override
protected Object clone() throws CloneNotSupportedException {
return SEBServerUser.of(this);
}
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;