[GitHub] ant-ivy pull request #48: Generics and Java 7 syntax in osgi and plugins pac...

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy pull request #48: Generics and Java 7 syntax in osgi and plugins pac...

jaikiran
GitHub user twogee opened a pull request:

    https://github.com/apache/ant-ivy/pull/48

    Generics and Java 7 syntax in osgi and plugins packages

    These changes leave only core untouched. Generics are not applied where Java compiler is unhappy (arrays of generics).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/twogee/ant-ivy generics-and-java7-syntax

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ant-ivy/pull/48.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #48
   
----
commit 40fef99f52e896f46d48fc2b2d2726a4f637886a
Author: twogee <[hidden email]>
Date:   2017-06-29T11:43:23Z

    Generics and Java 7 syntax in osgi package

commit 1d22edc509a2e65a53a7a5b15c0cdb768960c497
Author: twogee <[hidden email]>
Date:   2017-06-29T12:36:29Z

    Generics and Java 7 syntax in plugins package

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy pull request #48: Generics and Java 7 syntax in osgi and plugins pac...

jaikiran
Github user jaikiran commented on a diff in the pull request:

    https://github.com/apache/ant-ivy/pull/48#discussion_r125162592
 
    --- Diff: src/java/org/apache/ivy/plugins/signer/bouncycastle/OpenPGPSignatureGenerator.java ---
    @@ -161,7 +159,7 @@ private PGPSecretKey readSecretKey(InputStream in) throws IOException, PGPExcept
                         key = k;
                     }
                     if ((keyId != null)
    -                        && (Long.valueOf(keyId, 16).longValue() == (k.getKeyID() & MASK))) {
    +                        && (Long.valueOf(keyId, 16) == (k.getKeyID() & MASK))) {
    --- End diff --
   
    I haven't yet found an answer to this in some of the docs I quickly checked. I plan to check the Java specification later tonight. But if you can revert this one line from the rest of the PR, then I will go ahead and merge it since the rest of the PR is fine. I can read up about this a bit more without you having to wait for this PR to be merged.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy pull request #48: Generics and Java 7 syntax in osgi and plugins pac...

jaikiran
In reply to this post by jaikiran
Github user jaikiran commented on a diff in the pull request:

    https://github.com/apache/ant-ivy/pull/48#discussion_r125161935
 
    --- Diff: src/java/org/apache/ivy/plugins/signer/bouncycastle/OpenPGPSignatureGenerator.java ---
    @@ -161,7 +159,7 @@ private PGPSecretKey readSecretKey(InputStream in) throws IOException, PGPExcept
                         key = k;
                     }
                     if ((keyId != null)
    -                        && (Long.valueOf(keyId, 16).longValue() == (k.getKeyID() & MASK))) {
    +                        && (Long.valueOf(keyId, 16) == (k.getKeyID() & MASK))) {
    --- End diff --
   
    I'm not 100% sure how Java autoboxing/unboxing deals in this case. Does it autobox the primitive to a wrapper `Long` and do a `==` check or does it do a unboxing of the `Long` to a primitive and do a `==` check?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [GitHub] ant-ivy pull request #48: Generics and Java 7 syntax in osgi and plugins pac...

Gintautas Grigelionis
I believe stackoverflow has an answer [1]

Gintas

[1]
https://stackoverflow.com/questions/30454635/when-using-for-a-primitive-and-a-boxed-value-is-autoboxing-done-or-is-unbox

2017-07-01 15:56 GMT+02:00 jaikiran <[hidden email]>:

> Github user jaikiran commented on a diff in the pull request:
>
>     https://github.com/apache/ant-ivy/pull/48#discussion_r125161935
>
>     --- Diff: src/java/org/apache/ivy/plugins/signer/bouncycastle/OpenPGPSignatureGenerator.java
> ---
>     @@ -161,7 +159,7 @@ private PGPSecretKey readSecretKey(InputStream in)
> throws IOException, PGPExcept
>                          key = k;
>                      }
>                      if ((keyId != null)
>     -                        && (Long.valueOf(keyId, 16).longValue() ==
> (k.getKeyID() & MASK))) {
>     +                        && (Long.valueOf(keyId, 16) == (k.getKeyID()
> & MASK))) {
>     --- End diff --
>
>     I'm not 100% sure how Java autoboxing/unboxing deals in this case.
> Does it autobox the primitive to a wrapper `Long` and do a `==` check or
> does it do a unboxing of the `Long` to a primitive and do a `==` check?
>
>
> ---
> If your project is set up for it, you can reply to this email and have your
> reply appear on GitHub as well. If your project does not have this feature
> enabled and wishes so, or if the feature is enabled but not working, please
> contact infrastructure at [hidden email] or file a JIRA ticket
> with INFRA.
> ---
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #48: Generics and Java 7 syntax in osgi and plugins packages

jaikiran
In reply to this post by jaikiran
Github user jaikiran commented on the issue:

    https://github.com/apache/ant-ivy/pull/48
 
    >> https://stackoverflow.com/questions/30454635/when-using-for-a-primitive-and-a-boxed-value-is-autoboxing-done-or-is-unbox
   
    Thanks - the JLS sections[1][2] mentioned in there answers my questions. I have now merged this PR.
   
    Unfortunately, my attempt at triggering the auto closure of the PR by adding a trigger message to the commit hasn't succeeded this time. So please go ahead and manually close this PR for now.
   
    [1] https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.21.1
    [2] https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.6.2


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #48: Generics and Java 7 syntax in osgi and plugins packages

jaikiran
In reply to this post by jaikiran
Github user twogee commented on the issue:

    https://github.com/apache/ant-ivy/pull/48
 
    Thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy pull request #48: Generics and Java 7 syntax in osgi and plugins pac...

jaikiran
In reply to this post by jaikiran
Github user twogee closed the pull request at:

    https://github.com/apache/ant-ivy/pull/48


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...