Skip to content

fix toString() method in configuration implementations (apache#3599) #3658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.net.URI;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -1187,6 +1188,12 @@ private Object createPluginObject(final PluginType<?> type, final Node node, fin
return map;
}

@Override
public String toString() {
return getClass().getSimpleName() + "[location=" + getConfigurationSource() + ", lastModified="
+ Instant.ofEpochMilli(getConfigurationSource().getLastModified()) + "]";
}

private static Collection<?> createPluginCollection(final Node node) {
final List<Node> children = node.getChildren();
final Collection<Object> list = new ArrayList<>(children.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,4 @@ private void printNodes(final String indent, final Node node, final StringBuilde
printNodes(indent + " ", child, sb);
}
}

@Override
public String toString() {
return getClass().getName() + "@" + Integer.toHexString(hashCode()) + " [configurations=" + configurations
+ ", mergeStrategy=" + mergeStrategy + ", rootNode=" + rootNode + ", listeners=" + listeners
+ ", pluginPackages=" + pluginPackages + ", pluginManager=" + pluginManager + ", isShutdownHookEnabled="
+ isShutdownHookEnabled + ", shutdownTimeoutMillis=" + shutdownTimeoutMillis + ", scriptManager="
+ scriptManager + "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@ private void processAttributes(final Node parent, final JsonNode node) {
}
}

@Override
public String toString() {
return getClass().getSimpleName() + "[location=" + getConfigurationSource() + "]";
}

/**
* The error that occurred.
*/
Expand All @@ -261,10 +256,5 @@ public Status(final String name, final JsonNode node, final ErrorType errorType)
this.node = node;
this.errorType = errorType;
}

@Override
public String toString() {
return "Status [name=" + name + ", errorType=" + errorType + ", node=" + node + "]";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -336,12 +335,6 @@ private Map<String, String> processAttributes(final Node node, final Element ele
return attributes;
}

@Override
public String toString() {
return getClass().getSimpleName() + "[location=" + getConfigurationSource() + ", lastModified="
+ Instant.ofEpochMilli(getConfigurationSource().getLastModified()) + "]";
}

/**
* The error that occurred.
*/
Expand All @@ -362,10 +355,5 @@ public Status(final String name, final Element element, final ErrorType errorTyp
this.element = element;
this.errorType = errorType;
}

@Override
public String toString() {
return "Status [name=" + name + ", element=" + element + ", errorType=" + errorType + "]";
}
}
}