AtomicReference

150 views
Skip to first unread message

Jaroslav Záruba

unread,
Jun 17, 2016, 5:13:26 AM6/17/16
to GWT Users
Hello

I am using GWT with Lombok and one of Lombok's neat features makes it believe it needs AtomicReference. In GWT context this is not actually true but still the GWT compiler is complaining.

To deal with this I add "fake" AtomicReference to a separate Lombok.gwt.xml module.
With permission from its author, Dávid Karnok, I copied this one, as it does not import any other classes/packages and is under Apache 2.0 license.

Before even creating a pull request, I'm wondering if the maintainers would be OK with adding this class (in its own module) into GWT...?

Cheers
  Jarda Z.

Jens

unread,
Jun 17, 2016, 5:32:49 AM6/17/16
to GWT Users
I can't speak for an official maintainer but I would be fine with it to increase code compatibility. Also the emulation code is pretty straight forward. Its likely that GWT will contain a bit more java.util.concurrent.* emulation in the future as long as it makes sense (e.g. CompletableFuture + what Guava currently provides)

But you can not do Github pull requests. You must sign a CLA and then push your patch to Gerrit, GWT's code review tool.


-- J.

Jaroslav Záruba

unread,
Jun 17, 2016, 5:38:23 AM6/17/16
to GWT Users
Dne pátek 17. června 2016 11:32:49 UTC+2 Jens napsal(a):
I can't speak for an official maintainer but I would be fine with it to increase code compatibility. Also the emulation code is pretty straight forward. Its likely that GWT will contain a bit more java.util.concurrent.* emulation in the future as long as it makes sense (e.g. CompletableFuture + what Guava currently provides)

But you can not do Github pull requests. You must sign a CLA and then push your patch to Gerrit, GWT's code review tool.

Thank you, that actually sounds better.

I will look into the process and will try to deliver! :P

Andrei Korzhevskii

unread,
Jun 17, 2016, 5:43:27 AM6/17/16
to GWT Users
If you use Guava in your project, I'd send this PR to Guava since they have much frequent releases than GWT does and they accept PRs quite fast.
They currently have atomic references for primitive values but not AtomicReference.

Jaroslav Záruba

unread,
Jun 17, 2016, 6:23:59 AM6/17/16
to GWT Users
I don't use Guava in this very project.
I am completely clueless about what you are suggesting. What I wish to add to GWT is AtomicReference class (as simple as possible) and one or two *.gwt.xml files. How would Guava be involved in that?

Dne pátek 17. června 2016 11:43:27 UTC+2 Andrei Korzhevskii napsal(a):

Andrei Korzhevskii

unread,
Jun 17, 2016, 6:59:47 AM6/17/16
to GWT Users

That was just a suggestion.
Guava is involved in the way that it already provides gwt emulation for java.util.concurrent.* classes, e.g. it has emulation of AtomicBoolean, AtomicInteger and AtomicLong. 
It will be easier to merge your PR to Guava because they have more frequent release cycles than GWT has and since GWT 2.8 is about to hit rc1, there is a chance that your PR might get stalled.
But again, that's just my suggestion.
Message has been deleted

Jaroslav Záruba

unread,
Jun 17, 2016, 7:51:54 AM6/17/16
to GWT Users
Oh, I had no idea Guava provides anything related to GWT.

I would personally prefer to wait a bit longer and have this out-of-the-box in GWT, rasther than be dependant on another library.
But I do understand GWT maintainers/gurus may have different opinion.

Regards
  JZ

Dne pátek 17. června 2016 12:59:47 UTC+2 Andrei Korzhevskii napsal(a):
Reply all
Reply to author
Forward
0 new messages