Skip to content

Commit 6d87f26

Browse files
eclipse-platform-botHeikoKlare
authored andcommitted
Perform clean code of ua/org.eclipse.ui.intro
1 parent 05cb6ef commit 6d87f26

File tree

61 files changed

+1218
-659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1218
-659
lines changed

ua/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/FontSelection.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public static final int getScalePercentage() {
6868
}
6969

7070
private static String getFontSizeDeclaration(String element, int baseSize, int percentage, int scale) {
71-
if (scale > 75) scale = 75;
71+
if (scale > 75) {
72+
scale = 75;
73+
}
7274
int newSize = (int) ((baseSize * percentage *1.25) / (100 - scale));
7375
return " body " + element + "{ font-size : " + newSize + "px; } "; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
7476
}

ua/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/IntroPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ public static boolean closeIntro() {
170170
public void start(BundleContext context) throws Exception {
171171
super.start(context);
172172
inst = this;
173-
if (Log.logInfo)
173+
if (Log.logInfo) {
174174
Log.info("IntroPlugin - calling start on Intro bundle"); //$NON-NLS-1$
175+
}
175176
// Setup debugging options
176177
DEBUG = isDebugging();
177178
if (DEBUG) {

ua/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/FormattedHTMLElement.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ public String toString() {
117117
element.append(content);
118118
}
119119
// indent the end tag if we're on a new line
120-
if (indentLevel > 0 && spanMultipleLines)
120+
if (indentLevel > 0 && spanMultipleLines) {
121121
element.append(getIndent(indentLevel));
122+
}
122123
// include an end tag
123124
element.append(HTMLUtil.createHTMLEndTag(getElementName(), true));
124125
return element.toString();

ua/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/HTMLElement.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ public HTMLElement(String name, Map<String, String> attributes, Vector<Object> c
5050
* Add an attribute with the given name and value to this HTMLElement
5151
*/
5252
public void addAttribute(String attributeName, String attributeValue) {
53-
if(attributeName != null && attributeValue != null)
53+
if(attributeName != null && attributeValue != null) {
5454
getElementAttributes().put(attributeName, attributeValue);
55+
}
5556
}
5657

5758
/**
@@ -68,8 +69,9 @@ public void addContent(Object content) {
6869
* @return Returns the elementAttributes.
6970
*/
7071
public Map<String, String> getElementAttributes() {
71-
if (elementAttributes == null)
72+
if (elementAttributes == null) {
7273
elementAttributes = new HashMap<>();
74+
}
7375

7476
return elementAttributes;
7577
}
@@ -90,8 +92,9 @@ public void setElementAttributes(Map<String, String> elementAttributes) {
9092
* @return Returns the elementContent.
9193
*/
9294
public Vector<Object> getElementContent() {
93-
if (elementContent == null)
95+
if (elementContent == null) {
9496
elementContent = new Vector<>();
97+
}
9598

9699
return elementContent;
97100
}

ua/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/HTMLUtil.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ public static StringBuilder createHTMLStartTag(String elementName,
4343
// open the start tag
4444
element.append(openHTMLStartTag(elementName));
4545
// add the attributes, if there are any
46-
if (elementAttributes != null && !(elementAttributes.isEmpty()))
46+
if (elementAttributes != null && !(elementAttributes.isEmpty())) {
4747
element.append(IIntroHTMLConstants.SPACE).append(
4848
createAttributeList(elementAttributes));
49+
}
4950
// close the start tag
5051
element.append(closeHTMLTag(insertLineBreak));
5152
}
@@ -96,10 +97,11 @@ public static StringBuilder createHTMLStartTag(String elementName) {
9697
public static StringBuilder createHTMLEndTag(String elementName,
9798
boolean addNewLine) {
9899
StringBuilder closingElement = new StringBuilder();
99-
if (elementName != null)
100+
if (elementName != null) {
100101
closingElement.append(IIntroHTMLConstants.LT).append(
101102
IIntroHTMLConstants.FORWARD_SLASH).append(elementName)
102103
.append(closeHTMLTag(addNewLine));
104+
}
103105
return closingElement;
104106
}
105107

@@ -112,8 +114,9 @@ public static StringBuilder createHTMLEndTag(String elementName,
112114
* the attributes to be converted into a String list
113115
*/
114116
public static String createAttributeList(Map attributes) {
115-
if (attributes == null)
117+
if (attributes == null) {
116118
return null;
119+
}
117120
StringBuilder attributeList = new StringBuilder();
118121
Set attrNames = attributes.keySet();
119122
for (Iterator it = attrNames.iterator(); it.hasNext();) {
@@ -160,20 +163,23 @@ public static StringBuilder closeHTMLTag() {
160163
public static StringBuilder closeHTMLTag(boolean newLine) {
161164
StringBuilder closing = new StringBuilder()
162165
.append(IIntroHTMLConstants.GT);
163-
if (newLine)
166+
if (newLine) {
164167
closing.append(IIntroHTMLConstants.NEW_LINE);
168+
}
165169
return closing;
166170
}
167171

168172
/**
169173
* Determine if the contents of two character arrays are equal
170174
*/
171175
public static boolean equalCharArrayContent(char[] a, char[] b) {
172-
if (a.length != b.length)
176+
if (a.length != b.length) {
173177
return false;
178+
}
174179
for (int i = 0; i < a.length; i++) {
175-
if (a[i] != b[i])
180+
if (a[i] != b[i]) {
176181
return false;
182+
}
177183
}
178184
return true;
179185
}

0 commit comments

Comments
 (0)