You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Otávio Gonçalves de Santana <os...@tomitribe.com> on 2019/01/10 14:18:29 UTC

Updates the code using new API facilities

Updates the API

This PR has the goal to update the code using the newest API until Java 8.
These improvements are:

   -

   Use switch instead of multiple if/else: The switch is faster because
   there are special bytecodes that allow efficient switch statement
   evaluation when there are a lot of cases.
   -

   Simplifies code using Objects.equals: It reduces the number of lines of
   code using the Objects.equals
   <https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#equals-java.lang.Object-java.lang.Object->also
   it will be faster considering the JIT factor.
   -

   Simplifies the primitive compare using Integer.compare
   <https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#compare-int-int->
   -

   Reduces code using removeif condition in the collection.
   -

   from the JVM specification it repleaces L instead of l
   <https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10>.

ref: https://github.com/apache/tomee/pull/370

Re: Updates the code using new API facilities

Posted by Jean-Louis Monteiro <jl...@tomitribe.com>.
I will merge it then
--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com


On Thu, Jan 17, 2019 at 12:36 PM Otávio Gonçalves de Santana <
osantana@tomitribe.com> wrote:

> Thank you for the review Bruno.
>
> On Thu, Jan 10, 2019 at 6:29 PM Otávio Gonçalves de Santana <
> osantana@tomitribe.com> wrote:
>
> > Yes, it is Java 8
> >
> > On Thu, Jan 10, 2019 at 6:19 PM Jean-Louis Monteiro <
> > jlmonteiro@tomitribe.com> wrote:
> >
> >> Thanks Otavio.
> >> Make sure you stick with Java 8 though because master is targeting Java
> EE
> >> 8.
> >> --
> >> Jean-Louis Monteiro
> >> http://twitter.com/jlouismonteiro
> >> http://www.tomitribe.com
> >>
> >>
> >> On Thu, Jan 10, 2019 at 3:18 PM Otávio Gonçalves de Santana <
> >> osantana@tomitribe.com> wrote:
> >>
> >> > Updates the API
> >> >
> >> > This PR has the goal to update the code using the newest API until
> Java
> >> 8.
> >> > These improvements are:
> >> >
> >> >    -
> >> >
> >> >    Use switch instead of multiple if/else: The switch is faster
> because
> >> >    there are special bytecodes that allow efficient switch statement
> >> >    evaluation when there are a lot of cases.
> >> >    -
> >> >
> >> >    Simplifies code using Objects.equals: It reduces the number of
> lines
> >> of
> >> >    code using the Objects.equals
> >> >    <
> >> >
> >>
> https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#equals-java.lang.Object-java.lang.Object-
> >> > >also
> >> >    it will be faster considering the JIT factor.
> >> >    -
> >> >
> >> >    Simplifies the primitive compare using Integer.compare
> >> >    <
> >> >
> >>
> https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#compare-int-int-
> >> > >
> >> >    -
> >> >
> >> >    Reduces code using removeif condition in the collection.
> >> >    -
> >> >
> >> >    from the JVM specification it repleaces L instead of l
> >> >    <
> >> https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10
> >> > >.
> >> >
> >> > ref: https://github.com/apache/tomee/pull/370
> >> >
> >>
> >
>

Re: Updates the code using new API facilities

Posted by Otávio Gonçalves de Santana <os...@tomitribe.com>.
Thank you for the review Bruno.

On Thu, Jan 10, 2019 at 6:29 PM Otávio Gonçalves de Santana <
osantana@tomitribe.com> wrote:

> Yes, it is Java 8
>
> On Thu, Jan 10, 2019 at 6:19 PM Jean-Louis Monteiro <
> jlmonteiro@tomitribe.com> wrote:
>
>> Thanks Otavio.
>> Make sure you stick with Java 8 though because master is targeting Java EE
>> 8.
>> --
>> Jean-Louis Monteiro
>> http://twitter.com/jlouismonteiro
>> http://www.tomitribe.com
>>
>>
>> On Thu, Jan 10, 2019 at 3:18 PM Otávio Gonçalves de Santana <
>> osantana@tomitribe.com> wrote:
>>
>> > Updates the API
>> >
>> > This PR has the goal to update the code using the newest API until Java
>> 8.
>> > These improvements are:
>> >
>> >    -
>> >
>> >    Use switch instead of multiple if/else: The switch is faster because
>> >    there are special bytecodes that allow efficient switch statement
>> >    evaluation when there are a lot of cases.
>> >    -
>> >
>> >    Simplifies code using Objects.equals: It reduces the number of lines
>> of
>> >    code using the Objects.equals
>> >    <
>> >
>> https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#equals-java.lang.Object-java.lang.Object-
>> > >also
>> >    it will be faster considering the JIT factor.
>> >    -
>> >
>> >    Simplifies the primitive compare using Integer.compare
>> >    <
>> >
>> https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#compare-int-int-
>> > >
>> >    -
>> >
>> >    Reduces code using removeif condition in the collection.
>> >    -
>> >
>> >    from the JVM specification it repleaces L instead of l
>> >    <
>> https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10
>> > >.
>> >
>> > ref: https://github.com/apache/tomee/pull/370
>> >
>>
>

Re: Updates the code using new API facilities

Posted by Otávio Gonçalves de Santana <os...@tomitribe.com>.
Yes, it is Java 8

On Thu, Jan 10, 2019 at 6:19 PM Jean-Louis Monteiro <
jlmonteiro@tomitribe.com> wrote:

> Thanks Otavio.
> Make sure you stick with Java 8 though because master is targeting Java EE
> 8.
> --
> Jean-Louis Monteiro
> http://twitter.com/jlouismonteiro
> http://www.tomitribe.com
>
>
> On Thu, Jan 10, 2019 at 3:18 PM Otávio Gonçalves de Santana <
> osantana@tomitribe.com> wrote:
>
> > Updates the API
> >
> > This PR has the goal to update the code using the newest API until Java
> 8.
> > These improvements are:
> >
> >    -
> >
> >    Use switch instead of multiple if/else: The switch is faster because
> >    there are special bytecodes that allow efficient switch statement
> >    evaluation when there are a lot of cases.
> >    -
> >
> >    Simplifies code using Objects.equals: It reduces the number of lines
> of
> >    code using the Objects.equals
> >    <
> >
> https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#equals-java.lang.Object-java.lang.Object-
> > >also
> >    it will be faster considering the JIT factor.
> >    -
> >
> >    Simplifies the primitive compare using Integer.compare
> >    <
> >
> https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#compare-int-int-
> > >
> >    -
> >
> >    Reduces code using removeif condition in the collection.
> >    -
> >
> >    from the JVM specification it repleaces L instead of l
> >    <
> https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10
> > >.
> >
> > ref: https://github.com/apache/tomee/pull/370
> >
>

Re: Updates the code using new API facilities

Posted by Jean-Louis Monteiro <jl...@tomitribe.com>.
Thanks Otavio.
Make sure you stick with Java 8 though because master is targeting Java EE
8.
--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com


On Thu, Jan 10, 2019 at 3:18 PM Otávio Gonçalves de Santana <
osantana@tomitribe.com> wrote:

> Updates the API
>
> This PR has the goal to update the code using the newest API until Java 8.
> These improvements are:
>
>    -
>
>    Use switch instead of multiple if/else: The switch is faster because
>    there are special bytecodes that allow efficient switch statement
>    evaluation when there are a lot of cases.
>    -
>
>    Simplifies code using Objects.equals: It reduces the number of lines of
>    code using the Objects.equals
>    <
> https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#equals-java.lang.Object-java.lang.Object-
> >also
>    it will be faster considering the JIT factor.
>    -
>
>    Simplifies the primitive compare using Integer.compare
>    <
> https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#compare-int-int-
> >
>    -
>
>    Reduces code using removeif condition in the collection.
>    -
>
>    from the JVM specification it repleaces L instead of l
>    <https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10
> >.
>
> ref: https://github.com/apache/tomee/pull/370
>