From fcf44452baa25929b0dbd7f4d55b5249fb066a92 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Tue, 31 May 2016 18:52:36 +0200 Subject: [PATCH] DATACMNS-831 - Polishing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Formatting. Fixed copyright header and author. Added missing assertions in AbstractMappingContext.addPersistentEntity(…). Original pull request: #157. --- .../mapping/context/AbstractMappingContext.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java index 249d1e7fb..8bfdb675f 100644 --- a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java +++ b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2015 by the original author(s). + * Copyright 2011-2016 by the original author(s). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,6 +62,7 @@ import org.springframework.util.StringUtils; * @author Michael Hunger * @author Thomas Darimont * @author Tomasz Wysocki + * @author Mikael Klamra */ public abstract class AbstractMappingContext, P extends PersistentProperty

> implements MappingContext, ApplicationEventPublisherAware, InitializingBean { @@ -268,8 +269,8 @@ public abstract class AbstractMappingContext type) { @@ -278,14 +279,18 @@ public abstract class AbstractMappingContext typeInformation) { - + + Assert.notNull(typeInformation, "TypeInformation must not be null!"); + try { + read.lock(); + E persistentEntity = persistentEntities.get(typeInformation); if (persistentEntity != null) {