Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-20 Thread robert engels
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-20 Thread Ethan McCue
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-20 Thread Ethan McCue
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-20 Thread robert engels
On Sat, 15 Jun 2024 03:33:23 GMT, robert engels wrote: >> robert engels has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Merge remote-tracking branch 'robaho/HttpExchange-api-change' into >> HttpExchange-api-change >> >># Confl

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-20 Thread Ethan McCue
On Thu, 20 Jun 2024 09:27:55 GMT, Michael McMahon wrote: > That would force the developer to read further @Michael-Mc-Mahon I don't think any force in this life or the next will force a developer to read. - PR Comment: https://git.openjdk.org/jdk/pull/18955#issuecomment-2180930937

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-20 Thread Ethan McCue
On Sat, 15 Jun 2024 03:33:23 GMT, robert engels wrote: >> robert engels has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Merge remote-tracking branch 'robaho/HttpExchange-api-change' into >> HttpExchange-api-change >> >># Confl

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-20 Thread Michael McMahon
On Sat, 15 Jun 2024 03:22:47 GMT, Ethan McCue wrote: > To reiterate, I'm still not the biggest fan of the constant names given > > * The parameter name they are being used for is `responseLength`. "The > responseLength is CHUNKED_CONTENT" feels jank and `lengthOrChunked` doesn't > inspire

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-20 Thread Michael McMahon
On Sat, 15 Jun 2024 03:22:47 GMT, Ethan McCue wrote: > To reiterate, I'm still not the biggest fan of the constant names given > > * The parameter name they are being used for is `responseLength`. "The > responseLength is CHUNKED_CONTENT" feels jank and `lengthOrChunked` doesn't > inspire

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-14 Thread robert engels
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-14 Thread Ethan McCue
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-14 Thread Michael McMahon
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-14 Thread Daniel Fuchs
On Fri, 14 Jun 2024 02:54:53 GMT, robert engels wrote: >> robert engels has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Merge remote-tracking branch 'robaho/HttpExchange-api-change' into >> HttpExchange-api-change >> >># Confl

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-06-13 Thread robert engels
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-03 Thread robert engels
On Fri, 3 May 2024 13:53:39 GMT, Ethan McCue wrote: >> I think the solution is to document that the length must be greater than 0 >> or BBC an IllegalArgumentException is thrown. >> >> As I mention in the other comment - there is only really a single use for >> this - streaming a file of know

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-03 Thread Ethan McCue
On Fri, 3 May 2024 13:38:10 GMT, robert engels wrote: > and people have made do I think there is cause for this level of analysis. Specifically * This API, while part of the JDK, is not in widespread professional use * The intended use-case of the API is now "reducing the "getting startup" eff

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-03 Thread robert engels
On Fri, 3 May 2024 13:23:59 GMT, robert engels wrote: >> src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java >> line 82: >> >>> 80: * @see #sendResponseHeaders(int, long) >>> 81: * */ >>> 82: public static final long CHUNKED_CONTENT = 0L; >> >> I feel a lit

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-03 Thread Ethan McCue
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-03 Thread robert engels
On Fri, 3 May 2024 13:17:43 GMT, Ethan McCue wrote: >> robert engels has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Merge remote-tracking branch 'robaho/HttpExchange-api-change' into >> HttpExchange-api-change >> >># Conflict

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-03 Thread Ethan McCue
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-01 Thread robert engels
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-01 Thread robert engels
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread Mark Sheppard
On Wed, 1 May 2024 20:42:22 GMT, robert engels wrote: > But on the point above is not correct. If you follow the code path, you will > see that setting a length of 0 - which is what that method defers to - will > cause a chunked response to be sent - when it is written to the OutputStream. > I

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-01 Thread Ethan McCue
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-01 Thread Ethan McCue
On Wed, 1 May 2024 21:12:05 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge remot

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread robert engels
On Fri, 26 Apr 2024 15:37:13 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with one additional > commit since the last revision: > > Update > sr

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v4]

2024-05-01 Thread robert engels
> improve the HttpExchange api with documented constants and convenience > methods to avoid common bugs robert engels has updated the pull request incrementally with two additional commits since the last revision: - Merge remote-tracking branch 'robaho/HttpExchange-api-change' into HttpExchan

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread robert engels
On Wed, 1 May 2024 15:10:22 GMT, Mark Sheppard wrote: > It is not sending a chunked response, nor is it setting the Transfer-Encoding > header to chunked for a chunked response The javadoc was just a starting point - the method name is pretty clear imo opinion what it does - but there are othe

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread Mark Sheppard
On Fri, 26 Apr 2024 15:37:13 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with one additional > commit since the last revision: > > Update > sr

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread Daniel Fuchs
On Wed, 1 May 2024 13:26:39 GMT, robert engels wrote: > I might prefer `OS beginChunkedResponse()` and `OS beginFixedResponse()`. That's not a bad suggestion (whether startXxxx or beginXxxx). My gripe with `OS sendResponseHeadersX` is that the existing `void sendResponseHeaders` returns `v

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread robert engels
On Wed, 1 May 2024 13:13:44 GMT, Bernd wrote: > I agree that the sendResponse(NoContent) methods are good. > > I don’t think the “Headers” is particular clear - maybe “OS > startChunkedResponse(int)” (but only if it actually encodes it chunked) and > “OS startResponse(int status, long length)”

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread robert engels
On Wed, 1 May 2024 13:06:02 GMT, Daniel Fuchs wrote: > Maybe the lesser of the two evil would be to return `void`. If you return void you prevent the linter from trapping the improper use of the OutputStream. If you use these methods - or even the existing similar structure - you must get and

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread robert engels
On Fri, 26 Apr 2024 15:37:13 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with one additional > commit since the last revision: > > Update > sr

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread Bernd
On Fri, 26 Apr 2024 15:37:13 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with one additional > commit since the last revision: > > Update > sr

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread Daniel Fuchs
On Wed, 1 May 2024 12:40:52 GMT, robert engels wrote: > OutputStream sendResponseHeadersChunked(int code); > OutputStream sendResponseHeadersFixed(int code,long length); I still think that these methods should either return `void` or be renamed, though I have been struggling to find a name that

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread robert engels
On Wed, 1 May 2024 11:21:59 GMT, Mark Sheppard wrote: > sendResponseHeaderChunked The description implies that this method is sending > a chunked response, but the method is not doing that. ... I don't think it is implying that. The methods: OutputStream sendResponseHeadersChunked(int code);

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-05-01 Thread Mark Sheppard
On Fri, 26 Apr 2024 15:37:13 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with one additional > commit since the last revision: > > Update > sr

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-04-30 Thread robert engels
On Tue, 30 Apr 2024 16:04:25 GMT, Daniel Fuchs wrote: >> The purpose was that if you state you are sending a chunked response, you >> must close the output stream. By returning it - the linter will catch that >> it is closed, or used in a try-with-resources. > > I understand - but in this case

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-04-30 Thread Daniel Fuchs
On Tue, 30 Apr 2024 15:55:05 GMT, robert engels wrote: >> src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java >> line 237: >> >>> 235: */ >>> 236: public final OutputStream sendResponseHeadersChunked(int code) >>> throws IOException { >>> 237: sendRespons

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-04-30 Thread robert engels
On Tue, 30 Apr 2024 15:35:10 GMT, Daniel Fuchs wrote: >> src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java >> line 246: >> >>> 244: * @see HttpExchange#sendResponseHeaders(int, long) >>> 245: */ >>> 246: public final void sendResponseHeaders(int code,byte[]

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-04-30 Thread robert engels
On Tue, 30 Apr 2024 15:40:20 GMT, Daniel Fuchs wrote: >> robert engels has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update >> src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java >> >> Co-authored-by: Michae

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-04-30 Thread Daniel Fuchs
On Fri, 26 Apr 2024 15:37:13 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with one additional > commit since the last revision: > > Update > sr

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-04-30 Thread Daniel Fuchs
On Fri, 26 Apr 2024 14:54:30 GMT, Michael McMahon wrote: >> robert engels has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update >> src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java >> >> Co-authored-by: Mic

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-04-30 Thread Daniel Fuchs
On Fri, 26 Apr 2024 15:37:13 GMT, robert engels wrote: >> improve the HttpExchange api with documented constants and convenience >> methods to avoid common bugs > > robert engels has updated the pull request incrementally with one additional > commit since the last revision: > > Update > sr

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-04-26 Thread robert engels
On Fri, 26 Apr 2024 14:54:30 GMT, Michael McMahon wrote: >> robert engels has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update >> src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java >> >> Co-authored-by: Mic

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v3]

2024-04-26 Thread robert engels
> improve the HttpExchange api with documented constants and convenience > methods to avoid common bugs robert engels has updated the pull request incrementally with one additional commit since the last revision: Update src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.jav

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v2]

2024-04-26 Thread robert engels
> improve the HttpExchange api with documented constants and convenience > methods to avoid common bugs robert engels has updated the pull request incrementally with four additional commits since the last revision: - Update src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.

Re: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability

2024-04-26 Thread Michael McMahon
On Thu, 25 Apr 2024 15:49:54 GMT, robert engels wrote: > improve the HttpExchange api with documented constants and convenience > methods to avoid common bugs Changes requested by michaelm (Reviewer). src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java line 74: > 72: pu

RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability

2024-04-26 Thread robert engels
improve the HttpExchange api with documented constants and convenience methods to avoid common bugs - Commit messages: - improve HttpExchange response api Changes: https://git.openjdk.org/jdk/pull/18955/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18955&range=00 Issue