Re: RFR: 8294241: Deprecate URL public constructors [v5]

2022-11-03 Thread Daniel Fuchs
> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` > to parse or construct any URL. > > The `java.net.URL` class does not itself encode or decode any URL components > according to the escaping mechanism defined in RFC2396. It is the > responsibility of the caller to e

Re: RFR: 8294241: Deprecate URL public constructors [v4]

2022-11-03 Thread Michael McMahon
On Thu, 3 Nov 2022 11:20:03 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism define

Re: RFR: 8294241: Deprecate URL public constructors [v4]

2022-11-03 Thread Aleksei Efimov
On Thu, 3 Nov 2022 11:20:03 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism define

Re: RFR: 8294241: Deprecate URL public constructors [v3]

2022-11-03 Thread Daniel Fuchs
On Thu, 3 Nov 2022 07:42:44 GMT, ExE Boss wrote: >> Daniel Fuchs has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains six additional >> commits since

Re: RFR: 8294241: Deprecate URL public constructors [v4]

2022-11-03 Thread Daniel Fuchs
On Thu, 3 Nov 2022 10:56:28 GMT, Michael McMahon wrote: >> Daniel Fuchs has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - Update src/java.base/share/classes/java/net/URL.java >> >>Co-authored-by: ExE Boss <3889017+exe-b...@user

Re: RFR: 8294241: Deprecate URL public constructors [v4]

2022-11-03 Thread Michael McMahon
On Thu, 3 Nov 2022 10:56:28 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism define

Re: RFR: 8294241: Deprecate URL public constructors [v4]

2022-11-03 Thread Daniel Fuchs
> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` > to parse or construct any URL. > > The `java.net.URL` class does not itself encode or decode any URL components > according to the escaping mechanism defined in RFC2396. It is the > responsibility of the caller to e

Re: RFR: 8294241: Deprecate URL public constructors [v3]

2022-11-03 Thread ExE Boss
On Tue, 1 Nov 2022 16:14:20 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism define

Re: RFR: 8294241: Deprecate URL public constructors [v3]

2022-11-02 Thread Alan Bateman
On Tue, 1 Nov 2022 16:14:20 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism define

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-11-01 Thread Daniel Fuchs
On Tue, 1 Nov 2022 14:47:49 GMT, Alan Bateman wrote: >> Actually... Maybe I could move up the paragraph that says that URL >> constructors are deprecated up here, just after the

title? Would >> that be better? > > Try it, it might be better. I think the main thing is that link brings the


Re: RFR: 8294241: Deprecate URL public constructors [v3]

2022-11-01 Thread Phil Race
On Tue, 1 Nov 2022 16:10:47 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism define

Re: RFR: 8294241: Deprecate URL public constructors [v3]

2022-11-01 Thread Daniel Fuchs
> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` > to parse or construct any URL. > > The `java.net.URL` class does not itself encode or decode any URL components > according to the escaping mechanism defined in RFC2396. It is the > responsibility of the caller to e

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-11-01 Thread Alan Bateman
On Tue, 1 Nov 2022 14:22:18 GMT, Daniel Fuchs wrote: >> To be discussed: I actually wanted the deprecation link ( the link from >> `@deprecated` ) to lead here because I find that the whole section is >> relevant for developers who might want to decide whether to actually move >> away from usi

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-11-01 Thread Daniel Fuchs
On Tue, 1 Nov 2022 14:10:01 GMT, Daniel Fuchs wrote: >> src/java.base/share/classes/java/net/URL.java line 133: >> >>> 131: * specified. The optional fragment is not inherited. >>> 132: * >>> 133: * Constructing instances of >>> {@code URL} >> >> Would it be better to move the anchor to lin

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-11-01 Thread Daniel Fuchs
On Sat, 29 Oct 2022 14:24:09 GMT, Alan Bateman wrote: >> Daniel Fuchs has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains four additional >> commits

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-11-01 Thread Daniel Fuchs
On Sat, 29 Oct 2022 14:17:12 GMT, Alan Bateman wrote: >> Daniel Fuchs has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains four additional >> commits

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-11-01 Thread Daniel Fuchs
On Sat, 29 Oct 2022 14:16:24 GMT, Alan Bateman wrote: >> Daniel Fuchs has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains four additional >> commits

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-11-01 Thread Daniel Fuchs
On Sat, 29 Oct 2022 14:14:22 GMT, Alan Bateman wrote: >> Daniel Fuchs has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains four additional >> commits

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-11-01 Thread Daniel Fuchs
On Mon, 31 Oct 2022 22:00:01 GMT, Phil Race wrote: > Deprecate URL constructors. Developers are encouraged to use java.net.URI to > parse or construct any URL. ... To construct a URL, using URI::toURL should > be preferred. > > You have jumped through some refactoring hoops to be able to apply

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-11-01 Thread Peter Firmstone
On 1/11/2022 5:52 pm, Alan Bateman wrote: On Mon, 31 Oct 2022 22:00:01 GMT, Phil Race wrote: You have jumped through some refactoring hoops to be able to apply the deprecation suppression to as little code as possible .. having made such changes, then why didn't you just make the recommended

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-10-31 Thread Alan Bateman
On Mon, 31 Oct 2022 22:00:01 GMT, Phil Race wrote: > You have jumped through some refactoring hoops to be able to apply the > deprecation suppression to as little code as possible .. having made such > changes, then why didn't you just make the recommended change instead ? > > Should I presume

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-10-31 Thread Phil Race
On Fri, 28 Oct 2022 14:54:26 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism defin

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-10-29 Thread Alan Bateman
On Fri, 28 Oct 2022 14:54:26 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism defin

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-10-29 Thread Jaikiran Pai
On Wed, 26 Oct 2022 17:51:31 GMT, Daniel Fuchs wrote: >> I see your point. It may be more appropriate if URI.toURL was designed as >> URL.fromURL. >> >> I was wondering to have application developers a consistent way to get an >> URL instance. Now there are two methods in different classes U

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-10-29 Thread Jaikiran Pai
On Thu, 27 Oct 2022 11:24:32 GMT, Daniel Fuchs wrote: >> How about `_unused` or `_unused1`, `_unused2` then in the meantime? > > I'd be happy to make the change. Let's wait to see if anybody has a better > naming suggestion. Hello Daniel, I think calling it `unused` is fine. I did a quick searc

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-10-28 Thread Jonathan Gibbons
On Fri, 28 Oct 2022 14:54:26 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism defin

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-10-28 Thread Joe Wang
On Fri, 28 Oct 2022 14:54:26 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism defin

Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-10-28 Thread Daniel Fuchs
> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` > to parse or construct any URL. > > The `java.net.URL` class does not itself encode or decode any URL components > according to the escaping mechanism defined in RFC2396. It is the > responsibility of the caller to e

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Rob Leland
On Wed, 26 Oct 2022 16:00:56 GMT, Daniel Fuchs wrote: > Deprecate URL constructors. Developers are encouraged to use `java.net.URI` > to parse or construct any URL. > > The `java.net.URL` class does not itself encode or decode any URL components > according to the escaping mechanism defined in

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Daniel Fuchs
On Thu, 27 Oct 2022 17:50:37 GMT, Andrey Turbanov wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism de

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Andrey Turbanov
On Wed, 26 Oct 2022 16:00:56 GMT, Daniel Fuchs wrote: > Deprecate URL constructors. Developers are encouraged to use `java.net.URI` > to parse or construct any URL. > > The `java.net.URL` class does not itself encode or decode any URL components > according to the escaping mechanism defined in

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Daniel Fuchs
On Thu, 27 Oct 2022 17:20:04 GMT, Joe Wang wrote: > Hi Daniel, if it's not a major improvement, we'd like to keep the java.xml > module at the JDK 8 code level. Can we remove the 'var' usage in a few > java.xml classes? No problem - I will make this change when we have settled on a name for th

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Joe Wang
On Wed, 26 Oct 2022 16:00:56 GMT, Daniel Fuchs wrote: > Deprecate URL constructors. Developers are encouraged to use `java.net.URI` > to parse or construct any URL. > > The `java.net.URL` class does not itself encode or decode any URL components > according to the escaping mechanism defined in

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Peter Firmstone
I'm considering using one of the non parsing constructors, as Alan points out we're currently double parsing.  By the time the constructor is removed, I'm guessing there will be a RFC3986 URI implementation in the JDK, so we'll change to that when it happens.   Or if you decide to not deprecate

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Daniel Fuchs
On 27/10/2022 07:26, Alan Bateman wrote: We have a strict URI 3986 implementation, which we use to create all URL instances from. Note also that though this change proposes to deprecate these constructors in order to provide a stronger warning against their potential misuse, it does not depreca

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Daniel Fuchs
On Thu, 27 Oct 2022 09:17:29 GMT, Michael McMahon wrote: >> Having unnamed local variables[^1] would probably be best for this. >> >> [^1]: https://openjdk.org/jeps/8294349 > > How about `_unused` or `_unused1`, `_unused2` then in the meantime? I'd be happy to make the change. Let's wait to see

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Michael McMahon
On Thu, 27 Oct 2022 05:14:19 GMT, ExE Boss wrote: >> src/java.base/share/classes/java/net/JarURLConnection.java line 177: >> >>> 175: @SuppressWarnings("deprecation") >>> 176: var tmp = jarFileURL = new URL(spec.substring(0, separator++)); >>> 177: >> >> I realise that @Suppres

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Peter Firmstone
On 27/10/2022 4:26 pm, Alan Bateman wrote: On 26/10/2022 23:53, Peter Firmstone wrote: The change will have some performance impact, by requiring redundant parsing. Just thought I'd mention it, in case it hasn't been thought of. If you do an internet search there are other implementations o

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread Alan Bateman
On 26/10/2022 23:53, Peter Firmstone wrote: The change will have some performance impact, by requiring redundant parsing. Just thought I'd mention it, in case it hasn't been thought of. If you do an internet search there are other implementations of RFC3986 in java also. https://github.com/

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread ExE Boss
On Wed, 26 Oct 2022 16:41:29 GMT, Michael McMahon wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism de

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread Peter Firmstone
Interesting.  Is this RFR a done deal? While I like the concept and and understand the reasoning of URL not having a public constructor, I think this may have been thought of in isolation, I'm not sure how a custom URI, that strictly complies with RFC 3986 will behave, if it must also be parse

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread Daniel Fuchs
On Wed, 26 Oct 2022 17:39:56 GMT, Xue-Lei Andrew Fan wrote: >> `URLStreamHandler` really belongs to `java.net.URL`, and is an >> implementation detail of the infrastructure/SPI that makes it possible to >> eventually call `URL::openConnection`. I do not think it would be >> appropriate to have

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread Xue-Lei Andrew Fan
On Wed, 26 Oct 2022 17:24:59 GMT, Daniel Fuchs wrote: >> src/java.base/share/classes/java/net/URL.java line 852: >> >>> 850: * @since 20 >>> 851: */ >>> 852: public static URL fromURI(URI uri, URLStreamHandler streamHandler) >> >> What do you think to have this method in URI inste

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread Daniel Fuchs
On Wed, 26 Oct 2022 17:09:20 GMT, Xue-Lei Andrew Fan wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread Xue-Lei Andrew Fan
On Wed, 26 Oct 2022 16:00:56 GMT, Daniel Fuchs wrote: > Deprecate URL constructors. Developers are encouraged to use `java.net.URI` > to parse or construct any URL. > > The `java.net.URL` class does not itself encode or decode any URL components > according to the escaping mechanism defined in

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread Weijun Wang
On Wed, 26 Oct 2022 16:00:56 GMT, Daniel Fuchs wrote: > Deprecate URL constructors. Developers are encouraged to use `java.net.URI` > to parse or construct any URL. > > The `java.net.URL` class does not itself encode or decode any URL components > according to the escaping mechanism defined in

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread Michael McMahon
On Wed, 26 Oct 2022 16:00:56 GMT, Daniel Fuchs wrote: > Deprecate URL constructors. Developers are encouraged to use `java.net.URI` > to parse or construct any URL. > > The `java.net.URL` class does not itself encode or decode any URL components > according to the escaping mechanism defined in

RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread Daniel Fuchs
Deprecate URL constructors. Developers are encouraged to use `java.net.URI` to parse or construct any URL. The `java.net.URL` class does not itself encode or decode any URL components according to the escaping mechanism defined in RFC2396. It is the responsibility of the caller to encode any fi