Skip to content

Commit 46e957b

Browse files
committed
checkstyle upgrade
1 parent c3e28cf commit 46e957b

File tree

23 files changed

+72
-105
lines changed

23 files changed

+72
-105
lines changed

handlebars-helpers/src/main/java/com/github/jknack/handlebars/helper/JodaHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ public Object apply(final ReadableInstant time, final Options options) throws IO
9696
* Any formatting options, such as the Pattern, Style, or ISO format.
9797
* @return The String result.
9898
*/
99-
protected abstract CharSequence safeApply(final ReadableInstant time, final Options options);
99+
protected abstract CharSequence safeApply(ReadableInstant time, Options options);
100100

101101
}

handlebars-helpers/src/main/java/com/github/jknack/handlebars/helper/NumberHelper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ public Object apply(final Object context, final Options options)
101101
* The options object.
102102
* @return A string result.
103103
*/
104-
protected abstract CharSequence safeApply(final Number value,
105-
final Options options);
104+
protected abstract CharSequence safeApply(Number value, Options options);
106105

107106
/**
108107
* Apply the helper to the context.

handlebars-proto/src/main/java/com/github/jknack/handlebars/server/HbsServlet.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,17 +296,16 @@ private void fancyError(final Object error, final int firstLine, final String la
296296

297297
Template template = handlebars.compile("/error-pages/error");
298298

299-
PrintWriter writer = null;
300-
writer = response.getWriter();
299+
PrintWriter writer = response.getWriter();
301300
template.apply(
302301
Context
303302
.newBuilder(error)
304303
.resolver(MapValueResolver.INSTANCE, FieldValueResolver.INSTANCE,
305304
JavaBeanValueResolver.INSTANCE)
306305
.combine("lang", lang)
307306
.combine("version", HbsServer.version)
308-
.combine("firstLine", firstLine).build()
309-
, writer);
307+
.combine("firstLine", firstLine).build(),
308+
writer);
310309

311310
IOUtils.closeQuietly(writer);
312311
}

handlebars/src/main/java/com/github/jknack/handlebars/Context.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private static class CompositeValueResolver implements ValueResolver {
188188
*
189189
* @param resolvers The value resolvers.
190190
*/
191-
public CompositeValueResolver(final ValueResolver... resolvers) {
191+
CompositeValueResolver(final ValueResolver... resolvers) {
192192
this.resolvers = resolvers;
193193
}
194194

@@ -350,7 +350,7 @@ private static class PathExpressionChain implements PathExpression.Chain {
350350
*
351351
* @param path Expression path.
352352
*/
353-
public PathExpressionChain(final List<PathExpression> path) {
353+
PathExpressionChain(final List<PathExpression> path) {
354354
this.path = path;
355355
}
356356

handlebars/src/main/java/com/github/jknack/handlebars/HelperRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public interface HelperRegistry {
8686
* @param helper The helper object. Required.
8787
* @return This handlebars.
8888
*/
89-
<H> HelperRegistry registerHelperMissing(final Helper<H> helper);
89+
<H> HelperRegistry registerHelperMissing(Helper<H> helper);
9090

9191
/**
9292
* <p>

handlebars/src/main/java/com/github/jknack/handlebars/ParserFactory.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,5 @@ public interface ParserFactory {
3333
* @param endDelimiter The end delimiter.
3434
* @return A new {@link Parser}.
3535
*/
36-
Parser create(final Handlebars handlebars, final String startDelimiter,
37-
final String endDelimiter);
36+
Parser create(Handlebars handlebars, String startDelimiter, String endDelimiter);
3837
}

handlebars/src/main/java/com/github/jknack/handlebars/Template.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public List<String> collectReferenceParameters() {
167167
* @param <S> The template type.
168168
* @return A new {@link TypeSafeTemplate}.
169169
*/
170-
<T, S extends TypeSafeTemplate<T>> S as(final Class<S> type);
170+
<T, S extends TypeSafeTemplate<T>> S as(Class<S> type);
171171

172172
/**
173173
* Creates a new {@link TypeSafeTemplate}.

handlebars/src/main/java/com/github/jknack/handlebars/context/FieldValueResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private static class FieldMember extends AccessibleObject implements FieldWrappe
106106
/**
107107
* @param field The field object.
108108
*/
109-
public FieldMember(final Field field) {
109+
FieldMember(final Field field) {
110110
this.field = field;
111111
}
112112

handlebars/src/main/java/com/github/jknack/handlebars/helper/I18nHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public static class UTF8Control extends ResourceBundle.Control {
368368
*
369369
* @param charset Charset.
370370
*/
371-
public UTF8Control(final Charset charset) {
371+
UTF8Control(final Charset charset) {
372372
this.charset = charset;
373373
}
374374
@Override
@@ -402,7 +402,7 @@ public ResourceBundle newBundle(final String baseName, final Locale locale, fina
402402
* @param locale The locale.
403403
* @param classLoader The classloader.
404404
*/
405-
public DefI18nSource(final Charset charset, final String baseName, final Locale locale,
405+
DefI18nSource(final Charset charset, final String baseName, final Locale locale,
406406
final ClassLoader classLoader) {
407407
bundle = ResourceBundle.getBundle(baseName, locale, classLoader, new UTF8Control(charset));
408408
}

handlebars/src/main/java/com/github/jknack/handlebars/helper/StringHelpers.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@
1717
*/
1818
package com.github.jknack.handlebars.helper;
1919

20-
import static org.apache.commons.lang3.Validate.isTrue;
21-
import static org.apache.commons.lang3.Validate.notNull;
22-
import static org.apache.commons.lang3.Validate.validIndex;
20+
import com.github.jknack.handlebars.Handlebars;
21+
import com.github.jknack.handlebars.Helper;
22+
import com.github.jknack.handlebars.Options;
23+
import org.apache.commons.lang3.LocaleUtils;
24+
import org.apache.commons.lang3.StringUtils;
25+
import org.apache.commons.text.WordUtils;
2326

2427
import java.io.IOException;
2528
import java.math.RoundingMode;
@@ -37,13 +40,9 @@
3740
import java.util.regex.Matcher;
3841
import java.util.regex.Pattern;
3942

40-
import org.apache.commons.lang3.LocaleUtils;
41-
import org.apache.commons.lang3.StringUtils;
42-
43-
import com.github.jknack.handlebars.Handlebars;
44-
import com.github.jknack.handlebars.Helper;
45-
import com.github.jknack.handlebars.Options;
46-
import org.apache.commons.text.WordUtils;
43+
import static org.apache.commons.lang3.Validate.isTrue;
44+
import static org.apache.commons.lang3.Validate.notNull;
45+
import static org.apache.commons.lang3.Validate.validIndex;
4746

4847
/**
4948
* Commons string function helpers.
@@ -521,8 +520,7 @@ protected CharSequence safeApply(final Object context, final Options options) {
521520
* The default date styles.
522521
*/
523522
@SuppressWarnings("serial")
524-
private Map<String, Integer> styles = new HashMap<String, Integer>()
525-
{
523+
private Map<String, Integer> styles = new HashMap<String, Integer>() {
526524
{
527525
put("full", DateFormat.FULL);
528526
put("long", DateFormat.LONG);
@@ -718,7 +716,7 @@ public Object apply(final Object context, final Options options) throws IOExcept
718716
* @param options The options object.
719717
* @return A string result.
720718
*/
721-
protected abstract CharSequence safeApply(final Object context, final Options options);
719+
protected abstract CharSequence safeApply(Object context, Options options);
722720

723721
/**
724722
* Register the helper in a handlebars instance.

0 commit comments

Comments
 (0)