Skip to content

Commit dccb5d9

Browse files
committed
cleanup - uppercasing static loggers
1 parent ddefab0 commit dccb5d9

60 files changed

Lines changed: 103 additions & 163 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build-tools/cayenne-test-utilities/src/main/java/org/apache/cayenne/test/jdbc/UtilityLogger.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
class UtilityLogger {
2525

26-
private static Logger logger = LoggerFactory.getLogger(UtilityLogger.class);
26+
private static Logger LOGGER = LoggerFactory.getLogger(UtilityLogger.class);
2727

2828
static void log(String sql) {
29-
logger.info(sql);
29+
LOGGER.info(sql);
3030
}
3131
}

cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/DefaultValueTransformerFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*/
4646
public class DefaultValueTransformerFactory implements ValueTransformerFactory {
4747

48-
private static final Logger logger = LoggerFactory.getLogger(DefaultValueTransformerFactory.class);
48+
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultValueTransformerFactory.class);
4949

5050
public static final String DB_TO_BYTE_CONVERTERS_KEY =
5151
"org.apache.cayenne.crypto.transformer.value.DefaultValueTransformerFactory.dbToBytes";
@@ -171,7 +171,7 @@ protected String getJavaType(DbAttribute a) {
171171
String attributeName = dbEntity.getName() + "." + a.getName();
172172
String msg = javaTypes.size() > 1 ? "ObjAttributes with different java types" : "No ObjAttributes";
173173
// Warn user about this problem as there is nothing else we can do
174-
logger.warn(msg + " bound to DbAttribute '" + attributeName + "', " + javaType + " type will be used.");
174+
LOGGER.warn(msg + " bound to DbAttribute '" + attributeName + "', " + javaType + " type will be used.");
175175
return javaType;
176176
}
177177

cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/CayenneGeneratorMojo.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public class CayenneGeneratorMojo extends AbstractMojo {
250250

251251
private transient Injector injector;
252252

253-
private static final Logger logger = LoggerFactory.getLogger(CayenneGeneratorMojo.class);
253+
private static final Logger LOGGER = LoggerFactory.getLogger(CayenneGeneratorMojo.class);
254254

255255
private boolean useConfigFromDataMap;
256256

@@ -338,14 +338,14 @@ private List<ClassGenerationAction> createGenerators(DataMap dataMap) {
338338
List<CgenConfiguration> buildConfigurations(DataMap dataMap) {
339339
CgenConfigList cgenConfigList = injector.getInstance(DataChannelMetaData.class).get(dataMap, CgenConfigList.class);
340340
if (hasConfig()) {
341-
logger.info("Using cgen config from pom.xml");
341+
LOGGER.info("Using cgen config from pom.xml");
342342
return Collections.singletonList(cgenConfigFromPom(dataMap));
343343
} else if (cgenConfigList != null) {
344-
logger.info("Using cgen config from dataMap");
344+
LOGGER.info("Using cgen config from dataMap");
345345
useConfigFromDataMap = true;
346346
return cgenConfigList.getAll();
347347
} else {
348-
logger.info("Using default cgen config.");
348+
LOGGER.info("Using default cgen config.");
349349
CgenConfiguration cgenConfiguration = new CgenConfiguration();
350350
cgenConfiguration.setDataMap(dataMap);
351351
cgenConfiguration.updateOutputPath(defaultDir.toPath());

cayenne-project-compatibility/src/main/java/org/apache/cayenne/project/compatibility/configuration/CompatibilityDataChannelDescriptorLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
*/
5555
public class CompatibilityDataChannelDescriptorLoader extends XMLDataChannelDescriptorLoader {
5656

57-
private static final Logger logger = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
57+
private static final Logger LOGGER = LoggerFactory.getLogger(XMLDataChannelDescriptorLoader.class);
5858

5959
@Inject
6060
Provider<UpgradeService> upgradeServiceProvider;
@@ -97,7 +97,7 @@ public ConfigurationTree<DataChannelDescriptor> load(Resource configurationResou
9797
throw new ConfigurationException("Unable to upgrade " + configurationURL);
9898
}
9999

100-
logger.info("Loading XML configuration resource from " + configurationURL);
100+
LOGGER.info("Loading XML configuration resource from " + configurationURL);
101101

102102
final DataChannelDescriptor descriptor = new DataChannelDescriptor();
103103
descriptor.setConfigurationSource(configurationResource);

cayenne-project/src/main/java/org/apache/cayenne/project/extension/info/PropertyHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class PropertyHandler extends NamespaceAwareNestedTagHandler {
4343

4444
static final String PROPERTY_TAG = "property";
4545

46-
private static final Logger logger = LoggerFactory.getLogger(PropertyHandler.class);
46+
private static final Logger LOGGER = LoggerFactory.getLogger(PropertyHandler.class);
4747

4848
private DataChannelMetaData metaData;
4949

@@ -67,7 +67,7 @@ protected boolean processElement(String namespaceURI, String localName, Attribut
6767
}
6868
String oldValue = info.put(name, attributes.getValue("value"));
6969
if(oldValue != null) {
70-
logger.warn("Duplicated property {} for object {}", name, parentObject);
70+
LOGGER.warn("Duplicated property {} for object {}", name, parentObject);
7171
}
7272
}
7373
return true;

cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/DefaultUpgradeService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
*/
8888
public class DefaultUpgradeService implements UpgradeService {
8989

90-
private static final Logger logger = LoggerFactory.getLogger(DefaultUpgradeService.class);
90+
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultUpgradeService.class);
9191

9292
public static final String UNKNOWN_VERSION = "0";
9393
public static final String MIN_SUPPORTED_VERSION = "6";
@@ -242,7 +242,7 @@ List<Resource> getAdditionalDatamapResources(UpgradeUnit upgradeUnit) {
242242
resources.add(mapResource);
243243
}
244244
} catch (Exception ex) {
245-
logger.warn("Can't get additional dataMap resources: ", ex);
245+
LOGGER.warn("Can't get additional dataMap resources: ", ex);
246246
}
247247
return resources;
248248
}
@@ -255,7 +255,7 @@ protected void saveDocument(UpgradeUnit upgradeUnit) {
255255
Transformer transformer = TransformerFactory.newInstance().newTransformer();
256256
transformer.transform(input, output);
257257
} catch (Exception ex) {
258-
logger.warn("Can't save the document: ", ex);
258+
LOGGER.warn("Can't save the document: ", ex);
259259
}
260260
}
261261

cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V11.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
*/
5050
public class UpgradeHandler_V11 implements UpgradeHandler {
5151

52-
private static final Logger logger = LoggerFactory.getLogger(UpgradeHandler_V11.class);
52+
private static final Logger LOGGER = LoggerFactory.getLogger(UpgradeHandler_V11.class);
5353

5454
private static final List<String> defaultTemplatePaths = List.of(
5555
"templates/v4_1/singleclass.vm",
@@ -289,7 +289,7 @@ private String readTemplateFile(String path, String dataMapPath) {
289289
} catch (NoSuchFileException e) {
290290
return "The template " + path + " was not found during the project upgrade. Use the template editor in Cayenne modeler to set the template";
291291
} catch (IOException e) {
292-
logger.warn("Can't read the file: " + path, e);
292+
LOGGER.warn("Can't read the file: " + path, e);
293293
return "Can't read the file: " + path + e.getMessage();
294294
}
295295
} else {

cayenne-project/src/main/java/org/apache/cayenne/project/upgrade/handlers/UpgradeHandler_V9.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838
public class UpgradeHandler_V9 implements UpgradeHandler {
3939

40-
private static final Logger logger = LoggerFactory.getLogger(UpgradeHandler_V9.class);
40+
private static final Logger LOGGER = LoggerFactory.getLogger(UpgradeHandler_V9.class);
4141

4242
@Override
4343
public String getVersion() {
@@ -67,13 +67,13 @@ public void processDataMapDom(UpgradeUnit upgradeUnit) {
6767
File file = new File(directoryPath + "/" + reFileName);
6868
if (file.exists()) {
6969
if(!file.delete()) {
70-
logger.warn("Can't delete file " + file);
70+
LOGGER.warn("Can't delete file " + file);
7171
}
7272
}
7373
dataMap.removeChild(reNode);
7474
}
7575
} catch (Exception ex) {
76-
logger.warn("Can't process dataMap DOM: ", ex);
76+
LOGGER.warn("Can't process dataMap DOM: ", ex);
7777
}
7878
}
7979
}

cayenne/src/main/java/org/apache/cayenne/access/DataRowStore.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
*/
5252
public class DataRowStore implements Serializable {
5353

54-
private static final Logger logger = LoggerFactory.getLogger(DataRowStore.class);
54+
private static final Logger LOGGER = LoggerFactory.getLogger(DataRowStore.class);
5555

5656
// default property values
5757

@@ -101,8 +101,8 @@ protected void initWithProperties(RuntimeProperties properties) {
101101
// expiration time is never used actually
102102
maxSize = properties.getInt(Constants.SNAPSHOT_CACHE_SIZE_PROPERTY, SNAPSHOT_CACHE_SIZE_DEFAULT);
103103

104-
if (logger.isDebugEnabled()) {
105-
logger.debug("DataRowStore property " + Constants.SNAPSHOT_CACHE_SIZE_PROPERTY + " = " + maxSize);
104+
if (LOGGER.isDebugEnabled()) {
105+
LOGGER.debug("DataRowStore property " + Constants.SNAPSHOT_CACHE_SIZE_PROPERTY + " = " + maxSize);
106106
}
107107

108108
this.snapshots = new ConcurrentLinkedHashMap.Builder<ObjectId, DataRow>()
@@ -290,8 +290,8 @@ public void processRemoteEvent(SnapshotEvent event) {
290290
return;
291291
}
292292

293-
if (logger.isDebugEnabled()) {
294-
logger.debug("remote event: " + event);
293+
if (LOGGER.isDebugEnabled()) {
294+
LOGGER.debug("remote event: " + event);
295295
}
296296

297297
Collection<ObjectId> deletedSnapshotIds = event.getDeletedIds();
@@ -303,7 +303,7 @@ public void processRemoteEvent(SnapshotEvent event) {
303303
&& invalidatedSnapshotIds.isEmpty()
304304
&& diffs.isEmpty()
305305
&& indirectlyModifiedIds.isEmpty()) {
306-
logger.warn("processRemoteEvent.. bogus call... no changes.");
306+
LOGGER.warn("processRemoteEvent.. bogus call... no changes.");
307307
return;
308308
}
309309

@@ -335,7 +335,7 @@ public void processSnapshotChanges(
335335
&& invalidatedSnapshotIds.isEmpty()
336336
&& updatedSnapshots.isEmpty()
337337
&& (indirectlyModifiedIds == null || indirectlyModifiedIds.isEmpty())) {
338-
logger.warn("postSnapshotsChangeEvent.. bogus call... no changes.");
338+
LOGGER.warn("postSnapshotsChangeEvent.. bogus call... no changes.");
339339
return;
340340
}
341341

@@ -403,8 +403,8 @@ private Map<ObjectId, DataRow> processUpdatedSnapshots(Map<ObjectId, DataRow> up
403403

404404
// snapshots can be huge potentially.. so print them only if the
405405
// user is expecting them to be printed
406-
if (logger.isDebugEnabled()) {
407-
logger
406+
if (LOGGER.isDebugEnabled()) {
407+
LOGGER
408408
.debug("snapshot version changed, don't know what to do... Old: "
409409
+ oldSnapshot
410410
+ ", New: "
@@ -469,8 +469,8 @@ private void sendUpdateNotification(
469469
invalidatedSnapshotIDs,
470470
indirectlyModifiedIds);
471471

472-
if (logger.isDebugEnabled()) {
473-
logger.debug("postSnapshotsChangeEvent: " + event);
472+
if (LOGGER.isDebugEnabled()) {
473+
LOGGER.debug("postSnapshotsChangeEvent: " + event);
474474
}
475475

476476
// synchronously notify listeners; leaving it up to the listeners to
@@ -498,7 +498,7 @@ void stopListeners() {
498498
try {
499499
remoteNotificationsHandler.shutdown();
500500
} catch (Exception ex) {
501-
logger.info("Exception shutting down EventBridge.", ex);
501+
LOGGER.info("Exception shutting down EventBridge.", ex);
502502
}
503503
remoteNotificationsHandler = null;
504504
}

cayenne/src/main/java/org/apache/cayenne/access/event/SnapshotEventListener.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
import java.util.EventListener;
2323

24-
/**
25-
*/
2624
public interface SnapshotEventListener extends EventListener {
2725
public void snapshotsChanged(SnapshotEvent event);
2826
}

0 commit comments

Comments
 (0)