Skip to content

Commit 9813060

Browse files
BananeweizenCalixte
authored andcommitted
Fix new violations
These violations are shown with the most recent 10.14.1 by the eclipse plugin itself, but are not part of the github verification due to an older version being used there.
1 parent 97d25fb commit 9813060

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/config/ConfigurationWriter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static void writeNewConfiguration(OutputStream out, ICheckConfiguration c
6666

6767
// write an empty list of modules
6868
// mandatory modules are added automatically
69-
write(out, new ArrayList<Module>(), checkConfig);
69+
write(out, new ArrayList<>(), checkConfig);
7070
}
7171

7272
/**
@@ -141,8 +141,6 @@ public static void write(OutputStream out, List<Module> modules, ICheckConfigura
141141
private static void writeModule(Module module, Branch parent, Severity parentSeverity,
142142
List<Module> remainingModules) {
143143

144-
Severity severity = parentSeverity;
145-
146144
// remove this module from the list of modules to write
147145
remainingModules.remove(module);
148146

@@ -161,6 +159,7 @@ private static void writeModule(Module module, Branch parent, Severity parentSev
161159
}
162160

163161
// Write severity only if it differs from the parents severity
162+
Severity severity = parentSeverity;
164163
if (module.getSeverity() != null && !Severity.inherit.equals(module.getSeverity())) {
165164

166165
Element propertyEl = moduleEl.addElement(XMLTags.PROPERTY_TAG);

net.sf.eclipsecs.ui/src/net/sf/eclipsecs/ui/properties/filter/PackageFilterEditor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,16 +488,18 @@ public void widgetDefaultSelected(SelectionEvent e) {
488488
protected Control createDialogArea(Composite parent) {
489489
Composite composite = (Composite) super.createDialogArea(parent);
490490
Label messageLabel = createMessageArea(composite);
491-
CheckboxTreeViewer treeViewer = createTreeViewer(composite);
491+
if (mIsEmpty) {
492+
messageLabel.setEnabled(false);
493+
}
492494

495+
CheckboxTreeViewer treeViewer = createTreeViewer(composite);
493496
GridData data = new GridData(GridData.FILL_BOTH);
494497
data.widthHint = convertWidthInCharsToPixels(mWidth);
495498
data.heightHint = convertHeightInCharsToPixels(mHeight);
496499
Tree treeWidget = treeViewer.getTree();
497500
treeWidget.setLayoutData(data);
498501
treeWidget.setFont(parent.getFont());
499502
if (mIsEmpty) {
500-
messageLabel.setEnabled(false);
501503
treeWidget.setEnabled(false);
502504
}
503505
return composite;

net.sf.eclipsecs.ui/src/net/sf/eclipsecs/ui/quickfixes/coding/StringLiteralEqualityQuickfix.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,14 @@ public boolean visit(InfixExpression node) {
7272
return true;
7373
}
7474

75-
Expression replacementNode = null;
76-
7775
MethodInvocation equalsInvocation = node.getAST().newMethodInvocation();
7876
equalsInvocation.setName(node.getAST().newSimpleName("equals")); //$NON-NLS-1$
7977
equalsInvocation.setExpression((Expression) ASTNode.copySubtree(node.getAST(), literal));
8078
equalsInvocation.arguments().add(ASTNode.copySubtree(node.getAST(), otherOperand));
8179

8280
// if the string was compared with != create a not
8381
// expression
82+
final Expression replacementNode;
8483
if (node.getOperator().equals(InfixExpression.Operator.NOT_EQUALS)) {
8584
PrefixExpression prefixExpression = node.getAST().newPrefixExpression();
8685
prefixExpression.setOperator(PrefixExpression.Operator.NOT);

0 commit comments

Comments
 (0)