parent
9e7ab4d308
commit
6add7b4dec
|
|
@ -87,7 +87,7 @@ public class TrickyAspectJPointcutExpressionTests {
|
|||
testAdvice(new DefaultPointcutAdvisor(pointcut, logAdvice), logAdvice, new TestServiceImpl(), "TestServiceImpl");
|
||||
|
||||
// Then try again with a different class loader on the target...
|
||||
SimpleThrowawayClassLoader loader = new SimpleThrowawayClassLoader(new TestServiceImpl().getClass().getClassLoader());
|
||||
SimpleThrowawayClassLoader loader = new SimpleThrowawayClassLoader(TestServiceImpl.class.getClassLoader());
|
||||
// Make sure the interface is loaded from the parent class loader
|
||||
loader.excludeClass(TestService.class.getName());
|
||||
loader.excludeClass(TestException.class.getName());
|
||||
|
|
|
|||
|
|
@ -70,11 +70,7 @@ public class CollectingReaderEventListener implements ReaderEventListener {
|
|||
|
||||
@Override
|
||||
public void aliasRegistered(AliasDefinition aliasDefinition) {
|
||||
List<AliasDefinition> aliases = this.aliasMap.get(aliasDefinition.getBeanName());
|
||||
if (aliases == null) {
|
||||
aliases = new ArrayList<>();
|
||||
this.aliasMap.put(aliasDefinition.getBeanName(), aliases);
|
||||
}
|
||||
List<AliasDefinition> aliases = this.aliasMap.computeIfAbsent(aliasDefinition.getBeanName(), k -> new ArrayList<>());
|
||||
aliases.add(aliasDefinition);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,11 +113,7 @@ class CacheAdviceParser extends AbstractSingleBeanDefinitionParser {
|
|||
builder.setUnless(getAttributeValue(opElement, "unless", ""));
|
||||
builder.setSync(Boolean.parseBoolean(getAttributeValue(opElement, "sync", "false")));
|
||||
|
||||
Collection<CacheOperation> col = cacheOpMap.get(nameHolder);
|
||||
if (col == null) {
|
||||
col = new ArrayList<>(2);
|
||||
cacheOpMap.put(nameHolder, col);
|
||||
}
|
||||
Collection<CacheOperation> col = cacheOpMap.computeIfAbsent(nameHolder, k -> new ArrayList<>(2));
|
||||
col.add(builder.build());
|
||||
}
|
||||
|
||||
|
|
@ -140,11 +136,7 @@ class CacheAdviceParser extends AbstractSingleBeanDefinitionParser {
|
|||
builder.setBeforeInvocation(Boolean.parseBoolean(after.trim()));
|
||||
}
|
||||
|
||||
Collection<CacheOperation> col = cacheOpMap.get(nameHolder);
|
||||
if (col == null) {
|
||||
col = new ArrayList<>(2);
|
||||
cacheOpMap.put(nameHolder, col);
|
||||
}
|
||||
Collection<CacheOperation> col = cacheOpMap.computeIfAbsent(nameHolder, k -> new ArrayList<>(2));
|
||||
col.add(builder.build());
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +150,7 @@ class CacheAdviceParser extends AbstractSingleBeanDefinitionParser {
|
|||
parserContext.getReaderContext(), new CachePutOperation.Builder());
|
||||
builder.setUnless(getAttributeValue(opElement, "unless", ""));
|
||||
|
||||
Collection<CacheOperation> col = cacheOpMap.get(nameHolder);
|
||||
if (col == null) {
|
||||
col = new ArrayList<>(2);
|
||||
cacheOpMap.put(nameHolder, col);
|
||||
}
|
||||
Collection<CacheOperation> col = cacheOpMap.computeIfAbsent(nameHolder, k -> new ArrayList<>(2));
|
||||
col.add(builder.build());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,8 +85,7 @@ public class ConcurrentMapCacheTests
|
|||
assertThat(serializeCache.isStoreByValue()).isTrue();
|
||||
|
||||
Object key = createRandomKey();
|
||||
List<String> content = new ArrayList<>();
|
||||
content.addAll(Arrays.asList("one", "two", "three"));
|
||||
List<String> content = new ArrayList<>(Arrays.asList("one", "two", "three"));
|
||||
serializeCache.put(key, content);
|
||||
content.remove(0);
|
||||
List<String> entry = (List<String>) serializeCache.get(key).get();
|
||||
|
|
|
|||
Loading…
Reference in New Issue