From 55be70d911092613132f4f55c6e46e9813f89483 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Wed, 23 Oct 2013 01:34:12 +0200 Subject: [PATCH] DATACMNS-90 - Support old EnableXXXRepository annotations that do not yet allow to configure the handling of nested repositories. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously a call to attributes.getBoolean(…) resulted in a NPE if a EnableXXXRepository annotation of a store (Neo4J in that case ) did not have the required property yet. With the added check we are safe again. --- .../config/AnnotationRepositoryConfigurationSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java b/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java index 04c34da14..f23185554 100644 --- a/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java +++ b/src/main/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSource.java @@ -231,6 +231,6 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura */ @Override public boolean shouldConsiderNestedRepositories() { - return attributes.getBoolean(CONSIDER_NESTED_REPOSITORIES); + return attributes.containsKey(CONSIDER_NESTED_REPOSITORIES) && attributes.getBoolean(CONSIDER_NESTED_REPOSITORIES); } }