Skip to content

Commit a224943

Browse files
committed
DATAMONGO-1337 - Reverted making some of the loggers static.
The logger instance in AbstractMonitor is supposed to pick up the type of the actual implementation class and thus cannot be static. Related pull request: #336.
1 parent 9d4c79e commit a224943

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

spring-data-mongodb-cross-store/src/main/java/org/springframework/data/mongodb/crossstore/MongoChangeSetPersister.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2014 the original author or authors.
2+
* Copyright 2011-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ public class MongoChangeSetPersister implements ChangeSetPersister<Object> {
4545
private static final String ENTITY_FIELD_NAME = "_entity_field_name";
4646
private static final String ENTITY_FIELD_CLASS = "_entity_field_class";
4747

48-
private static final Logger log = LoggerFactory.getLogger(getClass());
48+
private final Logger log = LoggerFactory.getLogger(getClass());
4949

5050
private MongoTemplate mongoTemplate;
5151
private EntityManagerFactory entityManagerFactory;
@@ -88,8 +88,8 @@ public Object doInCollection(DBCollection collection) throws MongoException, Dat
8888
if (!changeSet.getValues().containsKey(key)) {
8989
String className = (String) dbo.get(ENTITY_FIELD_CLASS);
9090
if (className == null) {
91-
throw new DataIntegrityViolationException("Unble to convert property " + key + ": Invalid metadata, "
92-
+ ENTITY_FIELD_CLASS + " not available");
91+
throw new DataIntegrityViolationException(
92+
"Unble to convert property " + key + ": Invalid metadata, " + ENTITY_FIELD_CLASS + " not available");
9393
}
9494
Class<?> clazz = ClassUtils.resolveClassName(className, ClassUtils.getDefaultClassLoader());
9595
Object value = mongoTemplate.getConverter().read(clazz, dbo);

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/monitor/AbstractMonitor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,10 +29,11 @@
2929
* Base class to encapsulate common configuration settings when connecting to a database
3030
*
3131
* @author Mark Pollack
32+
* @author Oliver Gierke
3233
*/
3334
public abstract class AbstractMonitor {
3435

35-
private static final Logger logger = LoggerFactory.getLogger(getClass());
36+
private final Logger logger = LoggerFactory.getLogger(getClass());
3637

3738
protected Mongo mongo;
3839
private String username;

0 commit comments

Comments
 (0)