Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generics and Java 7 syntax in osgi and plugins packages #48

Closed
wants to merge 2 commits into from

Conversation

twogee
Copy link
Contributor

@twogee twogee commented Jun 30, 2017

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

@@ -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))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@asfbot
Copy link

asfbot commented Jul 1, 2017

Gintautas Grigelionis on dev@ant.apache.org replies:
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:

asfgit pushed a commit that referenced this pull request Jul 1, 2017
This closes github.com/apache/ant-ivy PR #48
@jaikiran
Copy link
Member

jaikiran commented Jul 1, 2017

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

@twogee
Copy link
Contributor Author

twogee commented Jul 3, 2017

Thank you!

@twogee twogee closed this Jul 3, 2017
@twogee twogee deleted the generics-and-java7-syntax branch July 18, 2017 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants