This repository was archived by the owner on Mar 3, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-12
lines changed
modules/jooby-hbs/src/main/java/org/jooby Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 205205
206206import static java .util .Objects .requireNonNull ;
207207
208- import java .util .Deque ;
209- import java .util .HashSet ;
210- import java .util .LinkedList ;
211- import java .util .Set ;
208+ import java .util .*;
212209import java .util .function .BiConsumer ;
213210import java .util .function .Consumer ;
211+ import java .util .Collections ;
214212
215213import org .jooby .Env ;
216214import org .jooby .Jooby ;
@@ -353,9 +351,9 @@ public class Hbs implements Jooby.Module {
353351
354352 private BiConsumer <Handlebars , Config > callback ;
355353
356- private Set <Class <?>> helpers = new HashSet <>();
354+ private final Set <Class <?>> helpers = new HashSet <>();
357355
358- private Deque <ValueResolver > resolvers = new LinkedList <>();
356+ private final Deque <ValueResolver > resolvers = new LinkedList <>();
359357
360358 /**
361359 * Creates a new {@link Hbs} module.
@@ -440,9 +438,7 @@ public Hbs doWith(final Consumer<Handlebars> callback) {
440438 * @return This module.
441439 */
442440 public Hbs with (final Class <?>... helper ) {
443- for (Class <?> h : helper ) {
444- helpers .add (h );
445- }
441+ Collections .addAll (helpers , helper );
446442 return this ;
447443 }
448444
Original file line number Diff line number Diff line change 219219
220220public class HbsEngine implements View .Engine {
221221
222- private Handlebars handlebars ;
222+ private final Handlebars handlebars ;
223223
224- private ValueResolver [] resolvers ;
224+ private final ValueResolver [] resolvers ;
225225
226226 public HbsEngine (final Handlebars handlebars , final ValueResolver [] resolvers ) {
227227 this .handlebars = requireNonNull (handlebars , "Handlebars is required." );
Original file line number Diff line number Diff line change @@ -214,6 +214,6 @@ public class HbsHelpers {
214214
215215 @ Inject
216216 public HbsHelpers (final Handlebars hbs , @ Named ("hbs.helpers" ) final Set <Object > helpers ) {
217- helpers .forEach (h -> hbs . registerHelpers ( h ) );
217+ helpers .forEach (hbs :: registerHelpers );
218218 }
219219}
You can’t perform that action at this time.
0 commit comments