mkodekar / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter 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

Original issue reported on code.google.com by jens.neh...@gmail.com on 1 Aug 2014 at 6:18

GoogleCodeExporter commented 9 years ago

Original comment by kak@google.com on 1 Aug 2014 at 6:22

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

Original comment by cpov...@google.com on 1 Aug 2014 at 6:23

GoogleCodeExporter commented 9 years ago
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.

Original comment by jens.neh...@gmail.com on 1 Aug 2014 at 6:52

GoogleCodeExporter commented 9 years ago
OK, thanks. Do let us know if you find otherwise.

Original comment by cpov...@google.com on 1 Aug 2014 at 6:54

GoogleCodeExporter commented 9 years ago
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).

Original comment by hillge...@gmail.com on 20 Aug 2014 at 12:47

GoogleCodeExporter commented 9 years ago
What flags do you compile with?

Original comment by cpov...@google.com on 20 Aug 2014 at 5:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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).

Original comment by hillge...@gmail.com on 20 Aug 2014 at 5:41

GoogleCodeExporter commented 9 years ago
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

Original comment by cpov...@google.com on 5 Sep 2014 at 2:58

GoogleCodeExporter commented 9 years ago
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.

Original comment by andrew.m...@threewide.com on 16 Oct 2014 at 9:12

GoogleCodeExporter commented 9 years ago
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?!

Original comment by hillge...@gmail.com on 17 Oct 2014 at 4:05

GoogleCodeExporter commented 9 years ago
I also have Java 8 installed and I am using GWT 2.5.1

Original comment by hillge...@gmail.com on 17 Oct 2014 at 4:11

GoogleCodeExporter commented 9 years ago
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.

Original comment by andrew.m...@threewide.com on 17 Oct 2014 at 5:46

GoogleCodeExporter commented 9 years ago
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.

Original comment by cpov...@google.com on 17 Oct 2014 at 6:41

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:08

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:07