Skip to content

Commit

Permalink
Undo formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dbmalkovsky committed Jan 25, 2024
1 parent fdf42ed commit 8a6cbce
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,16 @@ protected void assertDatabaseEmpty(FrameworkMethod method) {
cmmnEngineConfiguration,
TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK,
true,
new Command<>() {

@Override
public Void execute(CommandContext commandContext) {
SchemaManager schemaManager = CommandContextUtil.getCmmnEngineConfiguration(commandContext).getSchemaManager();
schemaManager.schemaDrop();
schemaManager.schemaCreate();
return null;
}
new Command<>() {

@Override
public Void execute(CommandContext commandContext) {
SchemaManager schemaManager = CommandContextUtil.getCmmnEngineConfiguration(commandContext).getSchemaManager();
schemaManager.schemaDrop();
schemaManager.schemaCreate();
return null;
}
}

);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,19 @@ public DefaultDeploymentCache() {
* Cache which has a hard limit: no more elements will be cached than the limit.
*/
public DefaultDeploymentCache(final int limit) {
this.cache = Collections.synchronizedMap(
new LinkedHashMap<>(limit + 1, 0.75f, true) { // +1 is needed, because the entry is inserted first, before it is removed

// 0.75 is the default (see javadocs)
// true will keep the 'access-order', which is needed to have a real LRU cache
private static final long serialVersionUID = 1L;

@Override
protected boolean removeEldestEntry(Map.Entry<String, T> eldest) {
boolean removeEldest = size() > limit;
if (removeEldest && LOGGER.isTraceEnabled()) {
LOGGER.trace("Cache limit is reached, {} will be evicted", eldest.getKey());
}
return removeEldest;
}
this.cache = Collections.synchronizedMap(new LinkedHashMap<>(limit + 1, 0.75f, true) { // +1 is needed, because the entry is inserted first, before it is removed
// 0.75 is the default (see javadocs)
// true will keep the 'access-order', which is needed to have a real LRU cache
private static final long serialVersionUID = 1L;

@Override
protected boolean removeEldestEntry(Map.Entry<String, T> eldest) {
boolean removeEldest = size() > limit;
if (removeEldest && LOGGER.isTraceEnabled()) {
LOGGER.trace("Cache limit is reached, {} will be evicted", eldest.getKey());
}
return removeEldest;
}

});
}
Expand Down

0 comments on commit 8a6cbce

Please sign in to comment.