-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8360575: java.util.Properties.list() methods trim each value to 37 characters in the listed output #26018
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
base: master
Are you sure you want to change the base?
8360575: java.util.Properties.list() methods trim each value to 37 characters in the listed output #26018
Changes from 2 commits
c898609
d276ad0
049e43e
df9c7ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved. | ||
* Copyright (c) 1995, 2025, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
|
@@ -1211,10 +1211,22 @@ public Set<String> stringPropertyNames() { | |
} | ||
|
||
/** | ||
* Prints this property list out to the specified output stream. | ||
* Prints this property list out to the specified {@link PrintStream}. | ||
* This method is useful for debugging. | ||
* | ||
* @param out an output stream. | ||
* @implNote If any property's value is greater than 40 characters then | ||
* this method writes only the first 37 characters of that value | ||
* followed by 3 dot characters. | ||
* <p> | ||
* An alternative for listing the {@code Properties} to a {@code PrintStream} is: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. I've now updated the PR with this text. |
||
* {@snippet lang=java : | ||
* Properties p = ... | ||
* PrintStream out = ... | ||
* // list the properties to PrintStream | ||
* p.forEach((k, v) -> out.println(k + "=" + v)); | ||
* } | ||
* | ||
* @param out a PrintStream | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: (here and L1263) "the output PrintStream" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
* @throws ClassCastException if any key in this property list | ||
* is not a string. | ||
*/ | ||
|
@@ -1233,10 +1245,22 @@ public void list(PrintStream out) { | |
} | ||
|
||
/** | ||
* Prints this property list out to the specified output stream. | ||
* Prints this property list out to the specified {@link PrintWriter}. | ||
* This method is useful for debugging. | ||
* | ||
* @param out an output stream. | ||
* @implNote If any property's value is greater than 40 characters then | ||
* this method writes only the first 37 characters of that value | ||
* followed by 3 dot characters. | ||
* <p> | ||
* An alternative for listing the {@code Properties} to a {@code PrintWriter} is: | ||
* {@snippet lang=java : | ||
* Properties p = ... | ||
* PrintWriter out = ... | ||
* // list the properties to PrintWriter | ||
* p.forEach((k, v) -> out.println(k + "=" + v)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should our example recommend using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
* } | ||
* | ||
* @param out a PrintWriter | ||
* @throws ClassCastException if any key in this property list | ||
* is not a string. | ||
* @since 1.1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the note needs to that specific. I think it need only say that the implementation truncates the output for very long property values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Alan, I think not noting the character count which determines the truncation would lead to questions about what "very long property values" are. However, this is a method which is specified to be for debug purposes only and I see that there's a suggestion to deprecate these methods. So I have gone ahead and updated this text to follow your suggestion. I'll respond to the deprecation proposal separately in this PR.