Skip to content

Commit 82f1e48

Browse files
authored
InternetHeaders.InternetHeader toString() #810 (#816)
Signed-off-by: Jorge Bescos Gascon <[email protected]>
1 parent d8aa319 commit 82f1e48

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

api/src/main/java/jakarta/mail/internet/InternetHeaders.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2025 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -143,6 +143,17 @@ public String getValue() {
143143
}
144144
return line.substring(j);
145145
}
146+
147+
@Override
148+
public String toString() {
149+
// super.value in this class is not meaningful
150+
String value = line == null ? null : getValue();
151+
return "InternetHeader{" +
152+
"name='" + name + '\'' +
153+
", value='" + value + '\'' +
154+
'}';
155+
}
156+
146157
}
147158

148159
/*

doc/release/CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ E 720 finalize() in java.lang.Object has been deprecated
2626
E 744 Remove SecurityManager reference from API
2727
E 758 Improve MimeMessage UTF8 handling
2828
E 804 Restore streamProvider fields for backwards compatibility
29+
E 810 InternetHeaders.InternetHeader toString()
2930

3031
CHANGES IN THE 2.1.5 RELEASE
3132
----------------------------

0 commit comments

Comments
 (0)