Skip to content

Commit

Permalink
add curly brackets (formatting)
Browse files Browse the repository at this point in the history
- add curly brackets around single line conditional statements
- place finally statement on same line as closing catch bracket
  • Loading branch information
sdutry committed Jan 3, 2018
1 parent 0713da4 commit 1d0b375
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/src/main/java/org/apache/struts2/components/Anchor.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,17 @@ public boolean usesBody() {
protected void evaluateExtraParams() {
super.evaluateExtraParams();

if (href != null)
if (href != null) {
addParameter("href", ensureAttributeSafelyNotEscaped(findString(href)));
else {
} else {
//no href, build it from URL attributes
StringWriter sw = new StringWriter();
urlRenderer.beforeRenderUrl(urlProvider);
urlRenderer.renderUrl(sw, urlProvider);
String builtHref = sw.toString();
if (StringUtils.isNotEmpty(builtHref))
if (StringUtils.isNotEmpty(builtHref)) {
addParameter("href", ensureAttributeSafelyNotEscaped(builtHref));
}
}
}

Expand Down Expand Up @@ -147,8 +148,7 @@ public boolean end(Writer writer, String body) {
mergeTemplate(writer, buildTemplateName(template, getDefaultTemplate()));
} catch (Exception e) {
LOG.error("error when rendering", e);
}
finally {
} finally {
popComponentStack();
}

Expand All @@ -164,8 +164,9 @@ public void addParameter(String key, Object value) {
*/
if (processingTagBody) {
this.urlParameters.put(key, value);
} else
} else {
super.addParameter(key, value);
}
}

@Override
Expand All @@ -177,8 +178,9 @@ public void addAllParameters(Map params) {
*/
if (processingTagBody) {
this.urlParameters.putAll(params);
} else
} else {
super.addAllParameters(params);
}
}

public UrlProvider getUrlProvider() {
Expand Down

0 comments on commit 1d0b375

Please sign in to comment.