You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by name name2 <an...@gmail.com> on 2023/02/07 17:59:29 UTC
Usage of DateTimeFormatter forbidden
Hello
https://github.com/apache/netbeans/pull/5445
SDT deprecated by fact of existing new java.time
SDT isnt thread safe and required ThreadLocal. The most part of code is
without TL or created new objects every request. Its doesnt effective and
right way. Also TL required a lot of memory as i know and are not desirable
because they complicate the logic.
Re: Usage of DateTimeFormatter forbidden
Posted by Matthias Bläsing <mb...@doppel-helix.eu.INVALID>.
Hi,
Am Dienstag, dem 07.02.2023 um 20:59 +0300 schrieb name name2:
> Hello
>
> https://github.com/apache/netbeans/pull/5445
>
> SDT deprecated by fact of existing new java.time
> SDT isnt thread safe and required ThreadLocal. The most part of code is
> without TL or created new objects every request. Its doesnt effective and
> right way. Also TL required a lot of memory as i know and are not desirable
> because they complicate the logic.
SimpleDateFormat is perfectly fine when you deal with java.util.Date.
The formatter is also save if only accessed from a single thread.
I would agree to switch if you'd need to introduce a ThreadLocal, but
there is no evidence to suggest this.
So i agree, that the referenced PR introduces noice without much
benefit.
Greetings
Matthias
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: Usage of DateTimeFormatter forbidden
Posted by Antonio <an...@vieiro.net.INVALID>.
Hi name name2,
The statement that "Usage of DateTimeFormatter forbidden" is not correct.
On 7/2/23 18:59, name name2 wrote:
> Hello
>
> https://github.com/apache/netbeans/pull/5445
>
> SDT deprecated by fact of existing new java.time
By SDT I understand that you mean SimpleDateFormat. The fact that you
don't like SimpleDateFormat does not mean it's deprecated (nor that we
"forbid" the usage of DateTimeFormatter, nor that we're going to change
it everywhere in such a huge codebase).
> SDT isnt thread safe and required ThreadLocal. The most part of code is
The fact that you've seen a "static SimpleDateFormat" somewhere does not
mean that there's a thread issue. The static field can be used in a
thread safe manner (on a single thread, for instance). Your evaluation
of the problem is non existing.
> without TL or created new objects every request. Its doesnt effective and
> right way. Also TL required a lot of memory as i know and are not desirable
> because they complicate the logic.
>
As explained in other threads, NetBeans is both an IDE and a platform.
You can't change public APIs happily. All PRs that change the public
NetBeans API (including the one you refer to) without previous
discussion on the mailing list will be rejected.
Also, as explained by other people in some other PRs, the advice to you
is to discuss potential problems in the mailing list _before_ actually
submitting PRs. By discussing I mean explaining a potential problem, not
complaining because your PRs have been closed.
Finally note that this is an open source project, not a programming
contest where you're expected to show the world how well you program in
Java. We're happy to have good Java programmers submitting PRs, but we
also expect contributions to contribute value, to solve problems and to
improve NetBeans, understanding what the problem is dinamically (more
than statically), and not changing things because of personal preferences.
Cheers,
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists