Skip to content

Commit 25ee9d6

Browse files
committed
Rename for clarity
1 parent 70fb1f3 commit 25ee9d6

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/DebugDataDumper.java

+12-11
Original file line numberDiff line numberDiff line change
@@ -90,30 +90,30 @@ public void saveInvalidBlockToFile(
9090

9191
@VisibleForTesting
9292
protected void saveBytesToFile(
93-
final String object, final Path relativeFilePath, final Bytes bytes) {
93+
final String description, final Path relativeFilePath, final Bytes bytes) {
9494
final Path path = directory.resolve(relativeFilePath);
9595
try {
9696
Files.write(path, bytes.toArray());
97-
LOG.info("Saved {} bytes to file. Location: {}", object, relativeFilePath);
97+
LOG.info("Saved {} bytes to file. Location: {}", description, relativeFilePath);
9898
} catch (NoSuchFileException e) {
9999
if (!path.getParent().toFile().mkdirs()) {
100-
LOG.error("Failed to save {} bytes to file.", object, e);
100+
LOG.error("Failed to save {} bytes to file.", description, e);
101101
return;
102102
}
103-
saveAfterCreatingTopicDirectory(object, relativeFilePath, bytes);
103+
saveAfterCreatingTopicDirectory(description, relativeFilePath, bytes);
104104
} catch (IOException e) {
105-
LOG.error("Failed to save {} bytes to file.", object, e);
105+
LOG.error("Failed to save {} bytes to file.", description, e);
106106
}
107107
}
108108

109109
private void saveAfterCreatingTopicDirectory(
110-
final String object, final Path relativeFilePath, final Bytes bytes) {
110+
final String description, final Path relativeFilePath, final Bytes bytes) {
111111
final Path path = directory.resolve(relativeFilePath);
112112
try {
113113
Files.write(path, bytes.toArray());
114-
LOG.info("Saved {} bytes to file. Location: {}", object, relativeFilePath);
114+
LOG.info("Saved {} bytes to file. Location: {}", description, relativeFilePath);
115115
} catch (IOException e) {
116-
LOG.error("Failed to save {} bytes to file.", object, e);
116+
LOG.error("Failed to save {} bytes to file.", description, e);
117117
if (!path.getParent().toFile().exists()) {
118118
LOG.error(
119119
"{} directory does not exist. Disabling saving debug data to file.",
@@ -122,19 +122,20 @@ private void saveAfterCreatingTopicDirectory(
122122
}
123123
}
124124

125-
private void createDirectory(final Path path, final String directoryName, final String object) {
125+
private void createDirectory(
126+
final Path path, final String directoryName, final String description) {
126127
if (!enabled) {
127128
return;
128129
}
129130
if (path.toFile().mkdirs()) {
130-
LOG.debug("{} directory has been created to save {}.", directoryName, object);
131+
LOG.debug("{} directory has been created to save {}.", directoryName, description);
131132
} else {
132133
if (!path.toFile().exists()) {
133134
this.enabled = false;
134135
LOG.error(
135136
"Unable to create {} directory to save {}. Disabling saving debug data to file.",
136137
directoryName,
137-
object);
138+
description);
138139
}
139140
}
140141
}

0 commit comments

Comments
 (0)