Skip to content

Commit 702ac9a

Browse files
eclipse-pde-botlaeubi
authored andcommitted
Perform clean code of ui/org.eclipse.pde.genericeditor.extension
1 parent f4afdd8 commit 702ac9a

File tree

7 files changed

+22
-11
lines changed

7 files changed

+22
-11
lines changed

ui/org.eclipse.pde.genericeditor.extension/src/org/eclipse/pde/internal/genericeditor/target/extension/autocomplete/TagCompletionProposal.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ private static String getTagNameFromTageType(String tagType) {
104104

105105
private static int getcursorPositionFromReplacementString(String replacementString) {
106106
int emptyAttributeIndex = replacementString.indexOf("\"\"");
107-
if (emptyAttributeIndex >= 0)
107+
if (emptyAttributeIndex >= 0) {
108108
return emptyAttributeIndex + 1;
109+
}
109110
int tagEndingIndex = replacementString.indexOf('>');
110-
if (tagEndingIndex >= 0)
111+
if (tagEndingIndex >= 0) {
111112
return tagEndingIndex + 1;
113+
}
112114
return replacementString.length() + 1;
113115
}
114116

ui/org.eclipse.pde.genericeditor.extension/src/org/eclipse/pde/internal/genericeditor/target/extension/autocomplete/processors/AttributeValueCompletionProcessor.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,23 @@ public AttributeValueCompletionProcessor(String searchTerm, String acKey, int of
5757
public ICompletionProposal[] getCompletionProposals() {
5858
Parser parser = Parser.getDefault();
5959
Node rootNode = parser.getRootNode();
60-
if (rootNode == null)
60+
if (rootNode == null) {
6161
return new ICompletionProposal[] {};
62+
}
6263
List<Node> locationsNode = rootNode.getChildNodesByTag(ITargetConstants.LOCATIONS_TAG);
63-
if (locationsNode == null || locationsNode.isEmpty())
64+
if (locationsNode == null || locationsNode.isEmpty()) {
6465
return new ICompletionProposal[] {};
66+
}
6567
Node locationNode = null;
6668
for (Node u : locationsNode.get(0).getChildNodesByTag(ITargetConstants.LOCATION_TAG)) {
6769
if ((offset >= u.getOffsetStart()) && (offset < u.getOffsetEnd())) {
6870
locationNode = u;
6971
break;
7072
}
7173
}
72-
if (locationNode == null)
74+
if (locationNode == null) {
7375
return new ICompletionProposal[] {};
76+
}
7477
UnitNode node = null;
7578
for (Node u : locationNode.getChildNodesByTag(ITargetConstants.UNIT_TAG)) {
7679
if ((offset >= u.getOffsetStart()) && (offset < u.getOffsetEnd())) {

ui/org.eclipse.pde.genericeditor.extension/src/org/eclipse/pde/internal/genericeditor/target/extension/command/UpdateUnitVersions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
5959
return null;
6060
}
6161
Node rootNode = parser.getRootNode();
62-
if (rootNode == null)
62+
if (rootNode == null) {
6363
return null;
64+
}
6465
List<Node> locationsNode = rootNode.getChildNodesByTag(ITargetConstants.LOCATIONS_TAG);
65-
if (locationsNode == null || locationsNode.isEmpty())
66+
if (locationsNode == null || locationsNode.isEmpty()) {
6667
return null;
68+
}
6769

6870
int offsetChange = 0;
6971
String documentText = document.get();

ui/org.eclipse.pde.genericeditor.extension/src/org/eclipse/pde/internal/genericeditor/target/extension/reconciler/folding/FoldingReconcilerStrategy.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ public void initialReconcile() {
6464
return;
6565
}
6666
ProjectionAnnotationModel projectionAnnotationModel = projectionViewer.getProjectionAnnotationModel();
67-
if (document.get().equals(oldDocument) || projectionAnnotationModel == null)
67+
if (document.get().equals(oldDocument) || projectionAnnotationModel == null) {
6868
return;
69+
}
6970
oldDocument = document.get();
7071

7172
List<Position> positions = getNewPositionsOfAnnotations();

ui/org.eclipse.pde.genericeditor.extension/src/org/eclipse/pde/internal/genericeditor/target/extension/reconciler/presentation/GeneralTagRule.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ public IToken evaluate(ICharacterScanner scanner) {
3737
}
3838
if (c == '/') {
3939
int d = scanner.read();
40-
if (d == '>')
40+
if (d == '>') {
4141
return tagToken;
42+
}
4243
scanner.unread();
4344
}
4445
scanner.unread();

ui/org.eclipse.pde.genericeditor.extension/src/org/eclipse/pde/internal/genericeditor/target/extension/reconciler/presentation/TargetPlatformPresentationReconciler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private void setDamageRepairerScanner() {
116116
protected TextPresentation createPresentation(IRegion damage, IDocument document) {
117117
TextPresentation presentation = new TextPresentation(damage, 1000);
118118
IPresentationRepairer repairer = this.getRepairer(IDocument.DEFAULT_CONTENT_TYPE);
119-
if (repairer != null)
119+
if (repairer != null) {
120120
try {
121121
ITypedRegion[] regions = TextUtilities.computePartitioning(document, getDocumentPartitioning(), 0,
122122
document.getLength(), false);
@@ -128,6 +128,7 @@ protected TextPresentation createPresentation(IRegion damage, IDocument document
128128
} catch (BadLocationException e) {
129129
return null;
130130
}
131+
}
131132

132133
return presentation;
133134
}

ui/org.eclipse.pde.genericeditor.extension/src/org/eclipse/pde/internal/genericeditor/target/extension/validator/SyntaxValidatorListener.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ public void documentAboutToBeChanged(DocumentEvent event) {
4141
public void documentChanged(DocumentEvent event) {
4242
IDocument fDocument = event.fDocument;
4343
ITextFileBuffer textFileBuffer = ITextFileBufferManager.DEFAULT.getTextFileBuffer(event.getDocument());
44-
if (textFileBuffer == null)
44+
if (textFileBuffer == null) {
4545
return;
46+
}
4647
IAnnotationModel model = textFileBuffer
4748
.getAnnotationModel();
4849
// clear the "org.eclipse.pde.genericeditor.error" annotations

0 commit comments

Comments
 (0)