ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gintautas Grigelionis <g.grigelio...@gmail.com>
Subject Re: [GitHub] ant-ivy pull request #48: Generics and Java 7 syntax in osgi and plugins pac...
Date Sat, 01 Jul 2017 14:39:02 GMT
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 <git@git.apache.org>:

> 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 infrastructure@apache.org or file a JIRA ticket
> with INFRA.
> ---
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message