Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit dfe17e3

Browse files
feffijknack
authored andcommitted
fixed minor code issues (jooby-project#1154)
1 parent 88dec53 commit dfe17e3

File tree

3 files changed

+19
-27
lines changed

3 files changed

+19
-27
lines changed

modules/jooby-ehcache/src/main/java/org/jooby/ehcache/EhSessionStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
*/
236236
public class EhSessionStore implements Session.Store {
237237

238-
private Ehcache cache;
238+
private final Ehcache cache;
239239

240240
@Inject
241241
public EhSessionStore(@Named("session") final Ehcache cache) {

modules/jooby-ehcache/src/main/java/org/jooby/internal/ehcache/CacheConfigurationBuilder.java

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222

223223
public class CacheConfigurationBuilder extends EhCacheBuilder {
224224

225-
private String path;
225+
private final String path;
226226

227227
private CacheConfiguration cache;
228228

@@ -320,12 +320,10 @@ private void cacheLoaderFactory(final Config conf) {
320320
cache.addCacheLoaderFactory(newFactory(path + ".cacheLoaderFactory", conf,
321321
CacheLoaderFactoryConfiguration::new));
322322
} else {
323-
each(conf, (name, c) -> {
324-
cache.addCacheLoaderFactory(
325-
newFactory(path + ".cacheLoaderFactory." + name, c,
326-
CacheLoaderFactoryConfiguration::new)
327-
);
328-
});
323+
each(conf, (name, c) -> cache.addCacheLoaderFactory(
324+
newFactory(path + ".cacheLoaderFactory." + name, c,
325+
CacheLoaderFactoryConfiguration::new)
326+
));
329327
}
330328
}
331329

@@ -352,12 +350,10 @@ private void cacheDecoratorFactory(final Config conf) {
352350
CacheDecoratorFactoryConfiguration::new)
353351
);
354352
} else {
355-
each(conf, (name, decoconf) -> {
356-
cache.addCacheDecoratorFactory(
357-
newFactory(path + ".cacheDecoratorFactory." + name, decoconf,
358-
CacheDecoratorFactoryConfiguration::new)
359-
);
360-
});
353+
each(conf, (name, decoconf) -> cache.addCacheDecoratorFactory(
354+
newFactory(path + ".cacheDecoratorFactory." + name, decoconf,
355+
CacheDecoratorFactoryConfiguration::new)
356+
));
361357
}
362358
}
363359

@@ -370,12 +366,10 @@ private void cacheExtensionFactory(final Config conf) {
370366
cache.addCacheExtensionFactory(newFactory(path + ".cacheExtensionFactory", conf,
371367
CacheExtensionFactoryConfiguration::new));
372368
} else {
373-
each(conf, (name, decoconf) -> {
374-
cache.addCacheExtensionFactory(
375-
newFactory(path + ".cacheExtensionFactory." + name, decoconf,
376-
CacheExtensionFactoryConfiguration::new)
377-
);
378-
});
369+
each(conf, (name, decoconf) -> cache.addCacheExtensionFactory(
370+
newFactory(path + ".cacheExtensionFactory." + name, decoconf,
371+
CacheExtensionFactoryConfiguration::new)
372+
));
379373
}
380374
}
381375

modules/jooby-ehcache/src/main/java/org/jooby/internal/ehcache/ConfigurationBuilder.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213

214214
public class ConfigurationBuilder extends EhCacheBuilder {
215215

216-
private Configuration eh;
216+
private final Configuration eh;
217217

218218
public ConfigurationBuilder() {
219219
this.eh = new Configuration();
@@ -288,12 +288,10 @@ private void cacheManagerPeerProviderFactory(final Config conf) {
288288
newFactory("ehcache.cacheManagerPeerProviderFactory", conf, FactoryConfiguration::new)
289289
);
290290
} else {
291-
each(conf, (name, c) -> {
292-
eh.addCacheManagerPeerProviderFactory(
293-
newFactory("ehcache.cacheManagerPeerProviderFactory." + name, c,
294-
FactoryConfiguration::new)
295-
);
296-
});
291+
each(conf, (name, c) -> eh.addCacheManagerPeerProviderFactory(
292+
newFactory("ehcache.cacheManagerPeerProviderFactory." + name, c,
293+
FactoryConfiguration::new)
294+
));
297295
}
298296
}
299297

0 commit comments

Comments
 (0)