two errors in master

446 views
Skip to first unread message

Stephen Haberman

unread,
Nov 30, 2014, 5:24:21 PM11/30/14
to google-web-tool...@googlegroups.com
Hi,

Given that the reuse-SDM cache patch (+ various Java 8 patches, hot
damn) landed, I tried our app with master. I'm seeing two issues:

1. A transient/only-happened-once ConcurrentModificationException:

https://gist.github.com/stephenh/6e32c3077b67769e46cb

2. Some compile errors related to guava/guava-gwt:

https://gist.github.com/stephenh/92f451858eb9828c199f

[ERROR] Line 1691: The method and(Predicate<capture#83-of ? super K>,
Predicate<capture#84-of ? super K>) is undefined for the type Predicates

[ERROR] com.google.common.collect.Maps.ImprovedAbstractMap cannot be
resolved to a type

Not quite sure what is going on here...I have guava and guava-gwt 18.0
on the classpath and, AFAICT, no other version is shadowing it, e.g.
due to be included-non-rebased in another jar (which is surprising for
once that the problem isn't related to that :-)).

Also, along the old/shadowed version theory, I checked and
Predicates.and seems to have been in Guava for awhile.

This same app runs fine in gwt-2.7.0 final. Has there been a change
recently that might affect this? Anything I can do to help poke around?

(Normally I would have submitted a patch (assuming it's semi-trivial)
for the first issue, but my GWT environment is on another machine.)

Thanks,
Stephen

Stephen Haberman

unread,
Nov 30, 2014, 6:08:16 PM11/30/14
to google-web-tool...@googlegroups.com
Note that in my previous email, both errors came from running (Super)DevMode, but FWIW the Guava errors also occur in a regular production compile (which I was not anticipating).

- Stephen

Jens

unread,
Nov 30, 2014, 6:33:46 PM11/30/14
to google-web-tool...@googlegroups.com
Hm funny. Just wanted to verify the Predicates issue but I can not launch my app anymore for some weird reason. 

Somehow the java compiler has detected a duplicate class in guava-gwt-18.0.jar:
- com.google.common.collect.AbstractIterator
- com.google.common.base.AbstractIterator

They are clearly not duplicates as they have different packages. Strange.

At least I can second your ConcurrentModificationException as I have seen it once as well and then never again.

-- J.

Stephen Haberman

unread,
Nov 30, 2014, 6:45:03 PM11/30/14
to google-web-tool...@googlegroups.com

Note that in my previous email, both errors came from running (Super)DevMode, but FWIW the Guava errors also occur in a regular production compile (which I was not anticipating).

Ah, crap, I had thought checked for this, but I had mistakenly introduced a 2nd variable: source level.

In both devmode/production, GWT master works fine with "-sourceLevel 1.7", but fails with those Guava errors with "-sourceLevel 1.8".

Maybe I'll go try and build a 1.8 version of Guava and see if the issue is in Guava itself? Not sure.

- Stephen



Stephen Haberman

unread,
Nov 30, 2014, 6:50:08 PM11/30/14
to google-web-tool...@googlegroups.com
Okay, okay, sorry for all the emails, but I ditched sourceLevel 1.8 and am now just playing with the new cached-SDM...

Wow. It's awesome. Great work!

I was hesitant to move our app over to 2.7.0, but this, this is nice.

- Stephen
 

John Stalcup

unread,
Dec 1, 2014, 5:21:19 PM12/1/14
to google-web-tool...@googlegroups.com
Glad you like the cache reuse speedup!

Also thanks for pointing out the CME, a fix for it is in review at https://gwt-review.googlesource.com/#/c/10500/
--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/5cfcf422-c969-4a00-8351-fbe34c648958%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephen Haberman

unread,
Dec 1, 2014, 6:00:05 PM12/1/14
to google-web-tool...@googlegroups.com

> Maybe I'll go try and build a 1.8 version of Guava and see if the
> issue is in Guava itself? Not sure.

I was pretty surprised to find that Guava doesn't compile for 1.8:

https://github.com/google/guava/issues/1738

But not at all for the reason/compile errors I was getting (which were
related to, mostly AFAICT, Predicates.and method missing).

The Guava issue is pretty old and doesn't seem very active. Kind of
disturbing, although I understand setting up separate builds for them
is likely a PITA.

- Stephen

Jens

unread,
Dec 2, 2014, 4:30:27 PM12/2/14
to google-web-tool...@googlegroups.com
I was pretty surprised to find that Guava doesn't compile for 1.8:

https://github.com/google/guava/issues/1738

But not at all for the reason/compile errors I was getting (which were
related to, mostly AFAICT, Predicates.and method missing).

The Guava issue is pretty old and doesn't seem very active. Kind of
disturbing, although I understand setting up separate builds for them
is likely a PITA.


I am not sure if the Predicates.and() error is a Guava problem. I checked out guava and fixed the issue you have linked to by implementing the required methods as no-op methods. Once I have done that Guava builds fine with Java 8. So the linked issue is the only thing that prevents compilation of Guava with Java 8.

Predicates.and() itself works fine in GWT with Java 8. Problems start when you use Collections2 or Multimaps in GWT which both use Predicates.and() and Predicates.in() internally. I have taken a look how they used Predicates and tried a bit with the following results:

// also tried explicit anonymous class instead of lambda. No difference.
Predicate<? super String> alwaysTrue = input -> true;

void onModuleLoad() {
  Collection<String> collection = Arrays.asList("a");
  test(collection);
  test2(collection);
  test3(collection);
}

private void test(Collection<?> collection) {
  Predicate<String> and = Predicates.and(alwaysTrue, Predicates.in(collection));
  GWT.log("" + and);
}

private void test2(Collection<? super String> collection) {
  Predicate<String> and = Predicates.and(alwaysTrue, Predicates.in(collection));
  GWT.log("" + and);
}

private void test3(Collection<String> collection) {
  Predicate<String> and = Predicates.and(alwaysTrue, Predicates.in(collection));
  GWT.log("" + and);
}


(only kept one method active while the others are commented) 

test() fails with: 
The method and(Predicate<capture#1-of ? super String>, Predicate<capture#2-of ?>) is undefined for the type Predicates

test2() fails with:

The method and(Predicate<capture#1-of ? super String>, Predicate<capture#2-of ? super String>) is undefined for the type Predicates

test3() works!

The Guava methods itself are defined as

public static <T> Predicate<T> and(Predicate<? super T> first, Predicate<? super T> second)

public static <T> Predicate<T> in(Collection<? extends T> target)


Doing the same in a normal Java Main class everything works with Java8.

So I think we really have a GWT issue. 

-- J.

Stephen Haberman

unread,
Dec 2, 2014, 6:04:32 PM12/2/14
to Jens, google-web-tool...@googlegroups.com

> So I think we really have a GWT issue.

Great detective work, Jens.

I agree, it looks like these type parameters only cause confusion to
the GWT compiler, and not to regular the Java/Eclipse compilers.

Given that GWT embeds JDT, I wonder if it's a bug in the version of JDT
we're currently using? Just guessing, but it looks like there is a
3.11.0 version that I might try as a knee jerk/couldn't hurt first step:

https://repo.eclipse.org/index.html#nexus-search;quick~jdt

(Curious that there are multiple 3.10.0/3.11.0 artifacts in that repo,
but with different date suffixes.)

- Stephen


Jens

unread,
Dec 3, 2014, 3:21:48 PM12/3/14
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
Given that GWT embeds JDT, I wonder if it's a bug in the version of JDT
we're currently using? Just guessing, but it looks like there is a
3.11.0 version that I might try as a knee jerk/couldn't hurt first step:

https://repo.eclipse.org/index.html#nexus-search;quick~jdt

(Curious that there are multiple 3.10.0/3.11.0 artifacts in that repo,
but with different date suffixes.)

Updating JDT did fix it for me locally. I have opened an issue for it:


-- J.

Stephen Haberman

unread,
Dec 3, 2014, 3:31:27 PM12/3/14
to Jens, google-web-tool...@googlegroups.com

Wow, that's great, Jens! Thanks for digging in to this.

- Stephen

confile

unread,
Jan 9, 2015, 5:12:05 PM1/9/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
I tried: 

<inherits name="com.google.common.collect.Collect"/>

with Java 8 and get the following error even with changing the JDT jar in the eclipse plugin folder:

   Tracing compile failure path for type 'com.google.common.collect.Collections2'

      [ERROR] Errors in 'com/google/common/collect/Collections2.java'

         [ERROR] Line 201: The method and(Predicate<capture#14-of ? super E>, Predicate<capture#15-of ?>) is undefined for the type Collections2.FilteredCollection<E>

         [ERROR] Line 206: The method and(Predicate<capture#16-of ? super E>, Predicate<capture#17-of ?>) is undefined for the type Collections2.FilteredCollection<E>

   Tracing compile failure path for type 'com.google.common.collect.Maps'

      [ERROR] Errors in 'com/google/common/collect/super/com/google/common/collect/Maps.java'

         [ERROR] Line 2244: The method and(Predicate<capture#263-of ? super Map.Entry<K,V>>, Predicate<capture#264-of ? super Map.Entry<K,V>>) is undefined for the type Predicates

         [ERROR] Line 2343: The method and(Predicate<capture#265-of ? super Map.Entry<K,V>>, Predicate<capture#266-of ? super Map.Entry<K,V>>) is undefined for the type Predicates

   Tracing compile failure path for type 'com.google.common.collect.Multimaps'

      [ERROR] Errors in 'com/google/common/collect/super/com/google/common/collect/Multimaps.java'

         [ERROR] Line 1691: The method and(Predicate<capture#83-of ? super K>, Predicate<capture#84-of ? super K>) is undefined for the type Predicates

         [ERROR] Line 1954: The method and(Predicate<capture#105-of ? super Map.Entry<K,V>>, Predicate<capture#106-of ? super Map.Entry<K,V>>) is undefined for the type Predicates

         [ERROR] Line 1735: The method and(Predicate<capture#87-of ? super K>, Predicate<capture#88-of ? super K>) is undefined for the type Predicates

         [ERROR] Line 1779: The method and(Predicate<capture#91-of ? super K>, Predicate<capture#92-of ? super K>) is undefined for the type Predicates

         [ERROR] Line 1940: The method and(Predicate<capture#103-of ? super Map.Entry<K,V>>, Predicate<capture#104-of ? super Map.Entry<K,V>>) is undefined for the type Predicates

   [ERROR] Aborting compile due to errors in some input files

confile

unread,
Jan 10, 2015, 5:35:39 PM1/10/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
Hi Jens, 

could you please explain how you did the update of JDT? What and where do I have to change something?

Thank you 
Michael


Am Mittwoch, 3. Dezember 2014 21:21:48 UTC+1 schrieb Jens:

confile

unread,
Jan 10, 2015, 6:41:40 PM1/10/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
Michael

Am Mittwoch, 3. Dezember 2014 21:21:48 UTC+1 schrieb Jens:

Jens

unread,
Jan 10, 2015, 7:39:14 PM1/10/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
There is no sources jar yet in the eclipse repo and the GWT build does not need it. Not sure why it is required by the python script.

What you need to do is:

1.) Follow the instructions in tools/lib/eclipse/README.jdt-upgrade

2.) While the JDT jar file is unpacked you can optionally delete class files that do not match

"org/eclipse/jdt/core/compiler",
"org/eclipse/jdt/internal/compiler",
"org/eclipse/jdt/internal/core/util"

That is what the update-jdt.py script would do for you. However for a local build this is optional. The only thing really required is 1.) and 3.)

3.) Once you have created a jar file again from the unpacked & modified JDT core (just zip the folder and rename to jar) you need to modify <gwt-checkout>/dev/build.xml so it includes your updated JDT library and the extracted jdtCompilerAdapter.jar as library during build.

-- J.

confile

unread,
Jan 11, 2015, 6:23:39 AM1/11/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
Hi Jens, 

in <gwt-checkout>/dev/build.xml I changed

jdtCompilerAdapter-3.10.0  to jdtCompilerAdapter-3.11.0.v20141029-0804

But there is no reference to org.eclipse.jdt.core-....
How do I reference it?

There is another jdt reference to: jdt-3.10.0.jar
What is this do I have to change it? Where do I get it?

Thank you 
Michael

Jens

unread,
Jan 11, 2015, 8:34:43 AM1/11/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
There is another jdt reference to: jdt-3.10.0.jar

There are two references to jdt-3.10.0.jar and two to jdtCompilerAdapter-3.10.0.jar. All four references need to be changed.

-- J. 

confile

unread,
Jan 11, 2015, 8:36:38 AM1/11/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
Am I right that the two references to: 

 jdt-3.10.0.jar should be changed to org.eclipse.jdt.core-3.11.0.v20141029-0804.jar

and 

jdtCompilerAdapter-3.10.0.jar should be changed to jdtCompilerAdapter-3.11.0.v20141029-0804.jar


Michael

Jens

unread,
Jan 11, 2015, 8:39:05 AM1/11/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
Am I right that the two references to: 

 jdt-3.10.0.jar should be changed to org.eclipse.jdt.core-3.11.0.v20141029-0804.jar

and 

jdtCompilerAdapter-3.10.0.jar should be changed to jdtCompilerAdapter-3.11.0.v20141029-0804.jar


Yes.

-- J.

confile

unread,
Jan 11, 2015, 8:43:08 AM1/11/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
It does not compile. Could you please upload the build gwt.zip file somewhere? I also attached my build.xml.



 I get the following errors when doing ant dist-dev

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:131: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.AssertStatement;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:132: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.Assignment;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:133: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.BinaryExpression;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:134: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.Block;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:135: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.BreakStatement;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:136: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.CaseStatement;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:137: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.CastExpression;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:138: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.CharLiteral;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:139: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:140: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.Clinit;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:141: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:142: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.CompoundAssignment;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:143: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.ConditionalExpression;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:144: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:145: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.ContinueStatement;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:146: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.DoStatement;

[gwt.javac]                                             ^

[gwt.javac] /Users/mg/Downloads/GWT/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:147: error: package org.eclipse.jdt.internal.compiler.ast does not exist

[gwt.javac] import org.eclipse.jdt.internal.compiler.ast.DoubleLiteral;

[gwt.javac]                                             ^

[gwt.javac] Note: Some input files use or override a deprecated API.

[gwt.javac] Note: Recompile with -Xlint:deprecation for details.

[gwt.javac] Note: Some input files use unchecked or unsafe operations.

[gwt.javac] Note: Recompile with -Xlint:unchecked for details.

[gwt.javac] 100 errors


BUILD FAILED

/Users/mg/Downloads/GWT/trunk/build.xml:40: The following error occurred while executing this line:

/Users/mg/Downloads/GWT/trunk/build.xml:27: The following error occurred while executing this line:

/Users/mg/Downloads/GWT/trunk/build.xml:59: The following error occurred while executing this line:

/Users/mg/Downloads/GWT/trunk/dev/build.xml:183: Compile failed; see the compiler error output for details.

build.xml

Jens

unread,
Jan 11, 2015, 9:15:28 AM1/11/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
Sounds like you have deleted the classes that you should actually keep.

I said you can optionally delete class files that DO NOT match

"org/eclipse/jdt/core/compiler", 
"org/eclipse/jdt/internal/compiler", 
"org/eclipse/jdt/internal/core/util"

-- J.

confile

unread,
Jan 11, 2015, 11:34:56 AM1/11/15
to google-web-tool...@googlegroups.com, jens.ne...@gmail.com
Actually, there are three positions of jdt-3.10.0.jar in the build file and three positions of jdtCompilerAdapter-3.10.0.jar.

If I change all but the last 

<pathelement location="${gwt.tools.lib}/eclipse/jdt-3.10.0.jar"/>

then I can compile. If I change that to I get an error. I am stuck could you please at least upload your build.xml file.

Thank you
Michael

Jakob Jarosch

unread,
Jan 30, 2015, 6:36:01 PM1/30/15
to google-web-tool...@googlegroups.com
Hi,
I've the same problems compiling the source of gwt.

With the following steps (used the tips from here) I tried to fix it but had no luck:
- Cloned the repository, checked out the tools
- Downloaded the updated jdt jar file
- Moved the jdtCompilerAdapter out of the jar
- Deleted the two files in the META-INF folder of the jdt jar file
- Replaced all three occurrences for the both jar files in the build.xml
- Tried to run ant

After these steps I get a similar error like everyone else:

Would be great when someone contributes a fix. :-)

- Jakob

Julien Dramaix

unread,
Jan 31, 2015, 6:10:15 AM1/31/15
to google-web-tool...@googlegroups.com
Jakob,

It seems that the dependency to the guava-16.0.1-rebased.jar is missing. You can add it manually, it is located in tools/lib/guava/guava-16.0.1/

--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.

Jakob Jarosch

unread,
Jan 31, 2015, 6:39:00 AM1/31/15
to google-web-tool...@googlegroups.com
Hi Julien,

It looks like I've already a dependency to guava-16.0.1-rebased.jar in the trunk/dev/build.xml (did not change anything except the jdt-things).
Did I miss something?
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.

Jens

unread,
Jan 31, 2015, 9:22:46 AM1/31/15
to google-web-tool...@googlegroups.com
It looks like I've already a dependency to guava-16.0.1-rebased.jar in the trunk/dev/build.xml (did not change anything except the jdt-things).
Did I miss something?

Have you updated the SVN tools checkout before building? 

You also have to update the jdtCompilerAdapter.jar dependencies to the new one in the build file. Seems like you only updated JDT itself.

-- J.

Jakob Jarosch

unread,
Jan 31, 2015, 11:54:40 AM1/31/15
to google-web-tool...@googlegroups.com
Thanks Jens, this was the problem. Looks like I missed to change it the second time.

- Jakob

Jens

unread,
Jan 31, 2015, 12:53:52 PM1/31/15
to google-web-tool...@googlegroups.com
Thanks Jens, this was the problem. Looks like I missed to change it the second time.

Reply all
Reply to author
Forward
0 new messages