Browse Source

DATACMNS-831 - Polishing.

Formatting. Fixed copyright header and author. Added missing assertions in AbstractMappingContext.addPersistentEntity(…).

Original pull request: #157.
pull/172/head
Oliver Gierke 10 years ago
parent
commit
fcf44452ba
  1. 17
      src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java

17
src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java

@ -1,5 +1,5 @@ @@ -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; @@ -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<E extends MutablePersistentEntity<?, P>, P extends PersistentProperty<P>>
implements MappingContext<E, P>, ApplicationEventPublisherAware, InitializingBean {
@ -268,8 +269,8 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<? @@ -268,8 +269,8 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
/**
* Adds the given type to the {@link MappingContext}.
*
* @param type
*
* @param type must not be {@literal null}.
* @return
*/
protected E addPersistentEntity(Class<?> type) {
@ -278,14 +279,18 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<? @@ -278,14 +279,18 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
/**
* Adds the given {@link TypeInformation} to the {@link MappingContext}.
*
* @param typeInformation
*
* @param typeInformation must not be {@literal null}.
* @return
*/
protected E addPersistentEntity(TypeInformation<?> typeInformation) {
Assert.notNull(typeInformation, "TypeInformation must not be null!");
try {
read.lock();
E persistentEntity = persistentEntities.get(typeInformation);
if (persistentEntity != null) {

Loading…
Cancel
Save