| Summary: | [gradle] Validation fails with gradle | ||
|---|---|---|---|
| Product: | [Tools] Xtend | Reporter: | Roland Spatzenegger <c> |
| Component: | Core | Assignee: | Project Inbox <xtend-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | christian.dietrich.opensource |
| Version: | 2.9.1 | Keywords: | triaged |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | v2.11 | ||
still and issue with 2.11 here is a reproducing unit test (XtendIncrementalBuilderTest)
@Test def void testXXX() {
val buildRequest = newBuildRequest [
dirtyFiles = #[
'src/test/BaseException.java' - '''
package test;
public class BaseException extends java.lang.Exception {
private static final long serialVersionUID = 1L;
public BaseException() {
super();
}
}
''',
'src/test/ClientGame.java' - '''
package test;
public interface ClientGame extends Game<ClientPlayer> {
}''',
'src/test/ClientPlayer.java' - '''
package test;
public interface ClientPlayer extends Player {
}''',
'src/test/Game.java' - '''
package test;
import java.util.Collection;
public interface Game<P extends Player> extends IDElement {
Collection<P> getPlayers();
void addPlayer(P player) throws BaseException;
}''',
'src/test/IDElement.java' - '''
package test;
public interface IDElement {
public int getId();
}''',
'src/test/Player.java' - '''
package test;
public interface Player extends IDElement {
}''',
'src/test/BoardUpdateCommandProcessor.xtend' - '''
package test
class BoardUpdateCommandProcessor {
new(ClientGame game) {
var player = game.players.findFirst[it.id == 343]
player = null
}
}'''
]
]
build(buildRequest)
assertTrue(issues.toString, issues.isEmpty)
}
here is the exception from jdt that got lost inside the JvmTypesBuilder stuff COMPILED type(s) - test/Game 1 PROBLEM(s) detected - Pb(320) No exception of type BaseException can be thrown; an exception type must be a subclass of Throwable can no longer be reproduced with final Xtext 2.11 |
If I run ./gradlew build I get the following error: ERROR:The method or field id is undefined for the type Object (file:.../xtend-error/src/test/BoardUpdateCommandProcessor.xtend line : 6 column : 42) The failing code is: new(ClientGame game) { var player = game.players.findFirst[it.id == 343] If I remove the Exception from line 27 in Game.java: void addPlayer(P player) throws BaseException; gradle builds the project without error. In Eclipse Mars I get no error. The source code can be found at: https://github.com/CymricNPG/xtend-error The discussion at google: https://groups.google.com/forum/#!topic/xtend-lang/lYBLFGCUlM8 Two more observations: - If the Exception is removed and add again, the build works (except a full clean is done, by removing all temp data) - If the gradle classpath points to the classes build by Eclipse it works without an error.