migrator / guava-libraries-2

Guava: Google Core Libraries for Java 1.6+
0 stars 0 forks source link

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

Open migrator opened 9 years ago

migrator commented 9 years ago

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

relevance: 5

migrator commented 9 years ago

summary: Not Defined (No comment was entered for this change.)

status Not Defined creator: kak@google.com created at: Aug 1, 2014

migrator commented 9 years ago

summary: Not Defined

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

status Not Defined creator: cpov...@google.com created at: Aug 1, 2014

migrator commented 9 years ago

summary: Not Defined

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.

status Not Defined creator: jens.neh...@gmail.com created at: Aug 1, 2014

migrator commented 9 years ago

summary: Not Defined

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

status Not Defined creator: cpov...@google.com created at: Aug 1, 2014

migrator commented 9 years ago

summary: Not Defined

We have same problem here. We are using:

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

status Not Defined creator: hillge...@gmail.com created at: Aug 20, 2014

migrator commented 9 years ago

summary: Not Defined

What flags do you compile with?

status Not Defined creator: cpov...@google.com created at: Aug 20, 2014

migrator commented 9 years ago

summary: Not Defined

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).

status Not Defined creator: hillge...@gmail.com created at: Aug 20, 2014

migrator commented 9 years ago

summary: Not Defined

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 Not Defined creator: cpov...@google.com created at: Sep 5, 2014

migrator commented 9 years ago

summary: Not Defined

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.

status Not Defined creator: andrew.m...@threewide.com created at: Oct 16, 2014

migrator commented 9 years ago

summary: Not Defined

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?!

status Not Defined creator: hillge...@gmail.com created at: Oct 16, 2014

migrator commented 9 years ago

summary: Not Defined

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

status Not Defined creator: hillge...@gmail.com created at: Oct 16, 2014

migrator commented 9 years ago

summary: Not Defined

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.

status Not Defined creator: andrew.m...@threewide.com created at: Oct 17, 2014

migrator commented 9 years ago

summary: Not Defined

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.

status Not Defined creator: cpov...@google.com created at: Oct 17, 2014