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

guava-gwt-13.0 contains testlib classes #1097

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

guava-gwt-13.0 contains testlib classes #1097

gissuebot opened this issue Oct 31, 2014 · 12 comments
Assignees
Milestone

Comments

@gissuebot
Copy link

Original issue created by david.nouls on 2012-08-07 at 07:35 AM


Detected with: guava R13

When compiling my GWT application that is depending on guava-gwt I get the following errors with guava 13:
compile:
     [echo] Invoking GWT JavaScript compiler. Style=PRETTY Workers:2
     [java] Compiling module com.swift.gwt.platform.Platform
     [java] Validating newly compiled units
     [java] [ERROR] Errors in 'jar:file:/scm/vobs/rlsCOTS5/guava/JAVA/lib/guava-gwt.jar!/com/google/common/collect/testing/google/super/com/google/common/collect/testing/google/SetGenerators.ja
va'
     [java] [ERROR] Line 17: The declared package "com.google.common.collect.testing.google" does not match the expected package "com.google.common.collect.testing.google.super.com.google.co
mmon.collect.testing.google"
     [java] [ERROR] Line 22: The import com.google.common.collect.testing.SampleElements cannot be resolved
     [java] [ERROR] Line 23: The import com.google.common.collect.testing.SampleElements cannot be resolved
     [java] [ERROR] Line 24: The import com.google.common.collect.testing.SampleElements cannot be resolved
     [java] [ERROR] Line 25: The import com.google.common.collect.testing.SampleElements cannot be resolved
     [java] [ERROR] Line 26: The import junit cannot be resolved
     [java] [ERROR] Line 38: The import com.google.common.collect.testing.TestCollectionGenerator cannot be resolved
     [java] [ERROR] Line 39: The import com.google.common.collect.testing.TestCollidingSetGenerator cannot be resolved
     [java] [ERROR] Line 40: The import com.google.common.collect.testing.TestIntegerSortedSetGenerator cannot be resolved
     [java] [ERROR] Line 41: The import com.google.common.collect.testing.TestSetGenerator cannot be resolved
     [java] [ERROR] Line 42: The import com.google.common.collect.testing.TestStringListGenerator cannot be resolved
     [java] [ERROR] Line 43: The import com.google.common.collect.testing.TestStringSetGenerator cannot be resolved
     [java] [ERROR] Line 44: The import com.google.common.collect.testing.TestStringSortedSetGenerator cannot be resolved
     [java] [ERROR] Line 45: The import com.google.common.collect.testing.TestUnhashableCollectionGenerator cannot be resolved
     [java] [ERROR] Line 46: The import com.google.common.collect.testing.UnhashableObject cannot be resolved
     [java] [ERROR] Line 65: TestStringSetGenerator cannot be resolved to a type
     [java] [ERROR] Line 66: The method create(String[]) of type SetGenerators.ImmutableSetCopyOfGenerator must override or implement a supertype method
     [java] [ERROR] Line 72: TestCollidingSetGenerator cannot be resolved to a type
     [java] [ERROR] Line 76: TestCollectionGenerator cannot be resolved to a type
     [java] [ERROR] Line 78: The method create(Object...) of type SetGenerators.ImmutableSetWithBadHashesGenerator must override or implement a supertype method
     [java] [ERROR] Line 84: TestStringSetGenerator cannot be resolved to a type
     [java] [ERROR] Line 88: The method create(String[]) of type SetGenerators.DegeneratedImmutableSetGenerator must override or implement a supertype method
     [java] [ERROR] Line 95: TestStringSortedSetGenerator cannot be resolved to a type
     [java] [ERROR] Line 96: The method create(String[]) of type SetGenerators.ImmutableSortedSetCopyOfGenerator must override or implement a supertype method
     [java] [ERROR] Line 102: TestStringSortedSetGenerator cannot be resolved to a type
     [java] [ERROR] Line 103: The method create(String[]) of type SetGenerators.ImmutableSortedSetHeadsetGenerator must override or implement a supertype method
     [java] [ERROR] Line 112: TestStringSortedSetGenerator cannot be resolved to a type
     [java] [ERROR] Line 113: The method create(String[]) of type SetGenerators.ImmutableSortedSetTailsetGenerator must override or implement a supertype method
     [java] [ERROR] Line 122: TestStringSortedSetGenerator cannot be resolved to a type
     [java] [ERROR] Line 123: The method create(String[]) of type SetGenerators.ImmutableSortedSetSubsetGenerator must override or implement a supertype method
     [java] [ERROR] Line 133: TestStringSetGenerator cannot be resolved to a type
     [java] [ERROR] Line 138: The method create(String[]) of type SetGenerators.ImmutableSortedSetExplicitComparator must override or implement a supertype method
     [java] [ERROR] Line 144: The method order(List<String>) of type SetGenerators.ImmutableSortedSetExplicitComparator must override or implement a supertype method
     [java] [ERROR] Line 151: TestStringSetGenerator cannot be resolved to a type
     [java] [ERROR] Line 156: The method create(String[]) of type SetGenerators.ImmutableSortedSetExplicitSuperclassComparatorGenerator must override or implement a supertype method
     [java] [ERROR] Line 162: The method order(List<String>) of type SetGenerators.ImmutableSortedSetExplicitSuperclassComparatorGenerator must override or implement a supertype method
     [java] [ERROR] Line 169: TestStringSetGenerator cannot be resolved to a type
     [java] [ERROR] Line 171: The method create(String[]) of type SetGenerators.ImmutableSortedSetReversedOrderGenerator must override or implement a supertype method
     [java] [ERROR] Line 177: The method order(List<String>) of type SetGenerators.ImmutableSortedSetReversedOrderGenerator must override or implement a supertype method
     [java] [ERROR] Line 183: The hierarchy of the type ImmutableSortedSetUnhashableGenerator is inconsistent
     [java] [ERROR] Line 185: UnhashableObject cannot be resolved to a type
     [java] [ERROR] Line 185: The method create(UnhashableObject[]) of type SetGenerators.ImmutableSortedSetUnhashableGenerator must override or implement a supertype method
     [java] [ERROR] Line 186: UnhashableObject cannot be resolved to a type
     [java] [ERROR] Line 192: TestStringListGenerator cannot be resolved to a type
     [java] [ERROR] Line 193: The method create(String[]) of type SetGenerators.ImmutableSetAsListGenerator must override or implement a supertype method
(the list goes on).

I tend to always compile in strict mode so for me it is blocking.

Workaround:
Do not use -strict when gwt compiling.

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2012-08-07 at 04:23 PM


Thanks. As discussed on the previous thread, testlib isn't GWT compatible. We intend to fix this but not for r13. We've got an internal bug filed, but I'll close it in favor of this one.

https://groups.google.com/d/topic/guava-discuss/LV0oLNFpnAU/discussion


Status: Accepted
Labels: Type-Enhancement, Package-General

@gissuebot
Copy link
Author

Original comment posted by kurt.kluever on 2012-08-07 at 05:13 PM


We might end up with guava and guava testlib with gwt as a supplementary artifact (so we have fewer projects).


Owner: cpovirk@google.com
Labels: Milestone-Release14
CC: cgruber@google.com

@gissuebot
Copy link
Author

Original comment posted by david.nouls on 2012-08-07 at 07:07 PM


There is one thing that maybe I need to press a little more: I am NOT using any testlib class... so I don't understand why I get these compilation errors. I guess anybody who uses guava in GWT will face this problem.

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2012-08-07 at 07:23 PM


Ah. I hadn't seen a response to my admittedly very, very late question about that on the 13.0-rc1 thread. Additionally, looking at the error message again, I now see that the error refers to guava-gwt.jar, not guava-testlib, so I should have been able to figure that part out on my own. Sorry.

I shifted some things between guava-gwt and guava-testlib in a recent CL (though it hasn't been mirrored out yet), but I don't think it will be enough to fix this. I'll investigate further.

(We have an issue filed to compile Guava under GWT, and we keep putting it off, since we have tests that compile against our internal copy, but we keep finding these problems that have to do with how we translate that code into Guava....)


Labels: -Milestone-Release14, Milestone-Release13

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2012-08-07 at 08:27 PM


This broke when we introduced emulated classes into testlib, e.g.,

84f2f1c
c9547ca

The problem is that there should be 4 outputs -- guava, guava-gwt, guava-testlib, guava-testlib-gwt -- but that we have only 3, so guava-testlib-gwt code is in the wrong place no matter where we put it. We're going to reorganize things to fix this.

@gissuebot
Copy link
Author

Original comment posted by david.nouls on 2012-08-08 at 07:26 AM


That's OK, I did not see your question since I was on holiday at that time.

@gissuebot
Copy link
Author

Original comment posted by david.nouls on 2012-08-27 at 02:26 PM


No chance that this get's released in some intermediatly release ? R13.0 is not GWT compatible, it breaks compilation for me (even though I don't use the testlib classes at all - I did not even know they existed in the first place :-)

@gissuebot
Copy link
Author

Original comment posted by cgruber@google.com on 2012-08-27 at 03:27 PM


I'll talk it over with kurt and chris and see if we can't resolve it. But we can't replace the artifacts, that's for sure. Maven central repository is write-once, by design. But I'll talk it over and see if a patch release is warranted.

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2012-08-27 at 09:25 PM


Yeah, we've been working on 13.0.1, as promised on https://groups.google.com/d/msg/guava-discuss/6DpGpxfiYdQ/lNJ26eQ-0JIJ

It had been taking longer than hoped, but Christian pointed out a better solution to me earlier today, and I think I have it working. Can you try out the attached jar and let me know if it helps?

@gissuebot
Copy link
Author

Original comment posted by david.nouls on 2012-08-28 at 07:55 AM


I just tried it out, compiled without any warning or error! Great work!

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2012-08-28 at 09:39 PM


Fixed: 4b8158d

I uploaded 13.0.1 this afternoon, and I'll announce it shortly.

Thanks very much for the report. Thanks also to Christian for the suggestion of this easier fix.


Status: Fixed
Labels: -Type-Enhancement, Type-Defect

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2012-12-05 at 09:59 PM


To catch this kind of problem in the future, we've added a GWT compilation test that runs against public Guava. 133ffd3

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