Updates the code using new API facilities

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Updates the code using new API facilities

Otávio Gonçalves de Santana
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
Reply | Threaded
Open this post in threaded view
|

Re: Updates the code using new API facilities

Jean-Louis MONTEIRO
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 <
[hidden email]> 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
>
   --
    Jean-Louis Monteiro
    http://twitter.com/jlouismonteiro
    http://www.tomitribe.com
Reply | Threaded
Open this post in threaded view
|

Re: Updates the code using new API facilities

Otávio Gonçalves de Santana
Yes, it is Java 8

On Thu, Jan 10, 2019 at 6:19 PM Jean-Louis Monteiro <
[hidden email]> 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 <
> [hidden email]> 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
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Updates the code using new API facilities

Otávio Gonçalves de Santana
Thank you for the review Bruno.

On Thu, Jan 10, 2019 at 6:29 PM Otávio Gonçalves de Santana <
[hidden email]> wrote:

> Yes, it is Java 8
>
> On Thu, Jan 10, 2019 at 6:19 PM Jean-Louis Monteiro <
> [hidden email]> 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 <
>> [hidden email]> 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
>> >
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Updates the code using new API facilities

Jean-Louis MONTEIRO
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 <
[hidden email]> wrote:

> Thank you for the review Bruno.
>
> On Thu, Jan 10, 2019 at 6:29 PM Otávio Gonçalves de Santana <
> [hidden email]> wrote:
>
> > Yes, it is Java 8
> >
> > On Thu, Jan 10, 2019 at 6:19 PM Jean-Louis Monteiro <
> > [hidden email]> 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 <
> >> [hidden email]> 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
> >> >
> >>
> >
>
   --
    Jean-Louis Monteiro
    http://twitter.com/jlouismonteiro
    http://www.tomitribe.com