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

Booleans is marked as @GwtCompatible but imports java.util.BitSet which is not emulated by GWT #1824

Closed
gissuebot opened this issue Oct 31, 2014 · 17 comments

Comments

@gissuebot
Copy link

Original issue created by jens.nehlmeier on 2014-08-01 at 06:18 PM


The summary pretty much sums it up.

Actually Booleans does only use BitSet in JavaDoc @link references and not in code, however the import is enough for GWT to fail during compilation. Using full qualified @link references should probably fix the problem.

[java] [ERROR] Errors in 'jar:file:/..../guava-gwt.jar!/com/google/common/primitives/Booleans.java'
[java] [ERROR] Line 29: The import java.util.BitSet cannot be resolved
[java] [ERROR] Aborting compile due to errors in some input files

@gissuebot
Copy link
Author

Original comment posted by kak@google.com on 2014-08-01 at 06:22 PM


(No comment entered for this change.)


Labels: Package-Primitives, Type-Defect

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2014-08-01 at 06:23 PM


Huh. Apparently our tests don't care. What version of GWT is this, and what compilation flags do you pass?

@gissuebot
Copy link
Author

Original comment posted by jens.nehlmeier on 2014-08-01 at 06:52 PM


It was not me who had the problem, I just reported it. After a bit more talk with the guy who has the problem it seems he uses a custom GWT build so I would blame that build.

Actually I just tried it myself with official GWT 2.5.0 and 2.6.1 and I can't produce the error.

I think you can close this issue.

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2014-08-01 at 06:54 PM


OK, thanks. Do let us know if you find otherwise.


Status: Invalid

@gissuebot
Copy link
Author

Original comment posted by hillger.t on 2014-08-20 at 12:47 PM


We have same problem here. We are using:

  • Windows 8
  • Java 7 (src/target version 1.6)
  • GXT 2.5.1
  • GWT 2.5.1

Apparently this seems not to make a problem with Windows 7 (like my local machine).

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2014-08-20 at 05:33 PM


What flags do you compile with?

@gissuebot
Copy link
Author

Original comment posted by hillger.t on 2014-08-20 at 05:41 PM


Currently not at office. But I think there are no special settings activated for the GWT build with Maven. Just Java 1.6 for source and target. As said: Does not work on a Window 8 machine. Works fine on Windows 7 or Debian Linux (build server).

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2014-09-05 at 02:58 PM


We might as well fix this, though it's hard to promise that it won't creep back in, since we can't reproduce the problem.

In the long term, the problem might solve itself:
https://code.google.com/p/google-web-toolkit/issues/detail?id=3279


Status: Accepted

@gissuebot
Copy link
Author

gissuebot commented Nov 1, 2014

Original comment posted by andrew.m...@threewide.com on 2014-10-16 at 09:12 PM


I started experiencing this same problem when I switched to jdk8 with GWT 2.5.0 / Guava 15.0.

I took the OPs suggestion of using fully qualified @link references but that didn't seem to help.

@gissuebot
Copy link
Author

Original comment posted by hillger.t on 2014-10-17 at 04:05 AM


My temporary workaround is to copy the source code into sources folder und remove that import. GWT compilation succeeds in my case. But why isn't it just possible to remove that import. In my opinion importing a class that is not really use is a code smell. Or?!

@gissuebot
Copy link
Author

Original comment posted by hillger.t on 2014-10-17 at 04:11 AM


I also have Java 8 installed and I am using GWT 2.5.1

@gissuebot
Copy link
Author

gissuebot commented Nov 1, 2014

Original comment posted by andrew.m...@threewide.com on 2014-10-17 at 05:46 PM


I was wrong earlier when I stated that the OPs suggestion did not work. When I was testing it I changed the references to be fully-qualified but I forgot to remove the import. With both fully-qualified javadoc references and the removal of the import, our GWT compile is now succeeding.

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2014-10-17 at 06:41 PM


I've submitted the fix internally. It will be mirrored out shortly. I didn't find an easy way to test for the problem (short of hardcoding a check for "import java.util.BitSet" for Booleans.java specifically), so I'll hope that we don't reintroduce it in the future. Please let us know if we do.


Labels: Milestone-Release19

@cpovirk
Copy link
Member

cpovirk commented Jan 9, 2015

As noted above, this fixed was submitted (and has now been mirrored out), and it will be in Guava 19.

I also managed to reproduce it by accident while investigating issue 1939. I'm not sure how to turn the bitset-failure-in-strict-mode-copied-from-GuavaGWT-Java8-Test Eclipse project into a failing Guava test (using JDK8 doesn't seem to be enough), but I'll post again if I figure it out.

@cpovirk
Copy link
Member

cpovirk commented Jan 12, 2015

Reproducing the problem continue to be a tangled mess.

I seem to be able to start reproducing it only by compiling in Eclipse before compiling from the command-line. Once I compile in Eclipse, the gwt-unitCache directory is "poisoned" in a way that makes command-line builds also fail. If I then delete gwt-unitCache and compile from the command line, the compile succeeds. And after that, the compile succeeds in Eclipse, too... until I remove gwt-unitCache and compile from Eclipse again, restarting the cycle.

In both cases, I am using the same copy of GWT 2.5.1.

@cpovirk
Copy link
Member

cpovirk commented Jan 12, 2015

Ah, and I also need to switch to JDK8. With JDK, I get the problem from the command line, too.

@cpovirk
Copy link
Member

cpovirk commented Jan 12, 2015

OK, with a combination of JDK8 and GWT 2.5.1, the Guava tests fail as expected. That explains the difficulty in reproducing the issue.

hillger.t reported the problem with JDK6 and JDK7. While I haven't been able to reproduce it there, I could believe that the behavior differs even across different versions of JDK6 and different versions of JDK7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants