Skip to content

Commit 5256f36

Browse files
authored
Properly make MessageFormatter and FormattingTuple public (#12763)
Motivation: _Taken from #12761_ Classes `io.netty.util.internal.logging.FormattingTuple` and `io.netty.util.internal.logging.MessageFormatter` are public classes, but the latters's format methods are package-private while the former's constructor is package-private making their use in custom in InternalLoggerFactory implementations impossible. Modification: Make necessary methods public Result: Fixes #12761.
1 parent 9f10a28 commit 5256f36

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

common/src/main/java/io/netty/util/internal/logging/FormattingTuple.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public final class FormattingTuple {
4747
private final String message;
4848
private final Throwable throwable;
4949

50-
FormattingTuple(String message, Throwable throwable) {
50+
public FormattingTuple(String message, Throwable throwable) {
5151
this.message = message;
5252
this.throwable = throwable;
5353
}

common/src/main/java/io/netty/util/internal/logging/MessageFormatter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public final class MessageFormatter {
129129
* @param arg The argument to be substituted in place of the formatting anchor
130130
* @return The formatted message
131131
*/
132-
static FormattingTuple format(String messagePattern, Object arg) {
132+
public static FormattingTuple format(String messagePattern, Object arg) {
133133
return arrayFormat(messagePattern, new Object[]{arg});
134134
}
135135

@@ -152,7 +152,7 @@ static FormattingTuple format(String messagePattern, Object arg) {
152152
* anchor
153153
* @return The formatted message
154154
*/
155-
static FormattingTuple format(final String messagePattern,
155+
public static FormattingTuple format(final String messagePattern,
156156
Object argA, Object argB) {
157157
return arrayFormat(messagePattern, new Object[]{argA, argB});
158158
}
@@ -167,7 +167,7 @@ static FormattingTuple format(final String messagePattern,
167167
* anchors
168168
* @return The formatted message
169169
*/
170-
static FormattingTuple arrayFormat(final String messagePattern,
170+
public static FormattingTuple arrayFormat(final String messagePattern,
171171
final Object[] argArray) {
172172
if (argArray == null || argArray.length == 0) {
173173
return new FormattingTuple(messagePattern, null);

0 commit comments

Comments
 (0)