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

Xtend compiler plugin 2.0.8 fails under JDK14 #170

Closed
DanySK opened this issue Apr 9, 2020 · 25 comments
Closed

Xtend compiler plugin 2.0.8 fails under JDK14 #170

DanySK opened this issue Apr 9, 2020 · 25 comments

Comments

@DanySK
Copy link

DanySK commented Apr 9, 2020

Plugin at version 2.0.8 does not work with JDK 14. Tested under Windows, Mac, and Linux, using both HotSpot and OpenJ9.
Build example: https://travis-ci.org/github/DanySK/listset/builds/672952779

Failure:

> Task :generateXtext FAILED
2 actionable tasks: 2 executed
resolution of uriFragment '|1' failed.
resource is empty: java:/Objects/java.util.Collection
resolution of uriFragment '|1' failed.
resource is empty: java:/Objects/java.lang.annotation.Target
resolution of uriFragment '|0' failed.
resource is empty: java:/Objects/java.util.List
resolution of uriFragment '|0' failed.
resolution of uriFragment '|4' failed.
resource is empty: java:/Objects/java.util.Comparator
resolution of uriFragment '|4' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|1' failed.
resource is empty: java:/Objects/java.util.Collections
resolution of uriFragment '|1' failed.
resolution of uriFragment '|0' failed.
resource is empty: java:/Objects/java.util.ArrayList
resolution of uriFragment '|0' failed.
resolution of uriFragment '|1' failed.
resolution of uriFragment '|1' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|4' failed.
resolution of uriFragment '|4' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|4' failed.
resolution of uriFragment '|4' failed.
resource is empty: java:/Objects/java.lang.Object
resource is empty: java:/Objects/java.lang.SuppressWarnings
resolution of uriFragment '|0' failed.
resource is empty: java:/Objects/java.util.Set
resolution of uriFragment '|0' failed.
resolution of uriFragment '|1' failed.
resolution of uriFragment '|1' failed.
resolution of uriFragment '|2' failed.
resource is empty: java:/Objects/java.io.Serializable
resolution of uriFragment '|2' failed.
resource is empty: java:/Objects/java.lang.Override
resource is empty: java:/Objects/java.lang.Class
resolution of uriFragment '|0' failed.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generateXtext'.
> java.lang.IllegalStateException: Resource has not been loaded
@cdietrich
Copy link
Member

cdietrich commented Apr 9, 2020

Do You build with or against java 14
Please also note there is no official support for java 14 in Xtext and Xtend

In my Tests I had no problems though

So can you provide a minimal example

@cdietrich
Copy link
Member

See also eclipse-xtext/xtext#1721

@DanySK
Copy link
Author

DanySK commented Apr 9, 2020

Running gradle using JDK 14, targeting Java 8.
It may be related to the Xtext version used, I had to upgrade other projects using Xtext to the latest available version from 2.18.0 in order for them to work under JDK 14.

* What went wrong:
Execution failed for task ':generateTestXtext'.
> org.eclipse.xtext.common.types.access.TypeResource$CannotLoadTypeResourceException: java.lang.IllegalArgumentException: Unsupported class file major version 58

@cdietrich
Copy link
Member

I tested with Xtext 2.21 only

@cdietrich
Copy link
Member

We are also waiting for new asm eclipse-xtext/xtext#1649

@cdietrich
Copy link
Member

Can also provide complete stacktrce

@DanySK
Copy link
Author

DanySK commented Apr 9, 2020

@cdietrich is there any way to force the plugin to use Xtext 2.21? The project being compiled is pure Xtend code, no grammar, no full Xtext.

@cdietrich
Copy link
Member

afaik this one is used to determine version

{code}
compile 'org.eclipse.xtend:org.eclipse.xtend.lib:2.21.0'
{code}

@DanySK
Copy link
Author

DanySK commented Apr 9, 2020

Sure, stacktrace:

$ ./gradlew check --stacktrace

> Configure project :
No username provided for logging in Maven Central. Please set MAVEN_CENTRAL_USERNAME
No password provided for logging in Maven Central. Please set MAVEN_CENTRAL_PASSWORD

> Task :generateXtext FAILED
resolution of uriFragment '|0' failed.
resource is empty: java:/Objects/java.util.List
resolution of uriFragment '|0' failed.
resolution of uriFragment '|1' failed.
resource is empty: java:/Objects/java.util.Collections
resolution of uriFragment '|1' failed.
resource is empty: java:/Objects/java.lang.annotation.Target
resolution of uriFragment '|0' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|4' failed.
resource is empty: java:/Objects/java.util.Comparator
resolution of uriFragment '|4' failed.
resolution of uriFragment '|1' failed.
resource is empty: java:/Objects/java.util.Collection
resolution of uriFragment '|1' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|1' failed.
resource is empty: java:/Objects/java.util.LinkedList
resolution of uriFragment '|1' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|4' failed.
resolution of uriFragment '|4' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|0' failed.
resolution of uriFragment '|4' failed.
resolution of uriFragment '|4' failed.
resource is empty: java:/Objects/java.lang.Object
resource is empty: java:/Objects/java.lang.SuppressWarnings
resolution of uriFragment '|0' failed.
resource is empty: java:/Objects/java.util.Set
resolution of uriFragment '|0' failed.
resolution of uriFragment '|1' failed.
resolution of uriFragment '|1' failed.
resolution of uriFragment '|2' failed.
resource is empty: java:/Objects/java.io.Serializable
resolution of uriFragment '|2' failed.
resource is empty: java:/Objects/java.lang.Override
resource is empty: java:/Objects/java.lang.Class
resolution of uriFragment '|0' failed.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateXtext'.
> java.lang.IllegalStateException: Resource has not been loaded

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':generateXtext'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:205)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:203)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.IllegalStateException: Resource has not been loaded
        at org.eclipse.xtext.xbase.resource.BatchLinkableResource.getEObject(BatchLinkableResource.java:131)
        at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doResolveLazyCrossReference(LazyLinkingResource.java:203)
        at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:162)
        at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:148)
        at org.eclipse.xtext.xbase.resource.BatchLinkableResource.resolveLazyCrossReferences(BatchLinkableResource.java:168)
        at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:504)
        at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.lambda$launch$6(IncrementalBuilder.java:283)
        at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.lambda$executeClustered$1(ClusteringStorageAwareResourceLoader.java:75)
        at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
        at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:612)
        at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
        at com.google.common.collect.Iterables.addAll(Iterables.java:318)
        at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.executeClustered(ClusteringStorageAwareResourceLoader.java:78)
        at org.eclipse.xtext.build.BuildContext.executeClustered(BuildContext.java:55)
        at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.launch(IncrementalBuilder.java:298)
        at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:418)
        at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:403)
        at org.xtext.gradle.builder.XtextGradleBuilder.doBuild(XtextGradleBuilder.java:319)
        at org.xtext.gradle.builder.XtextGradleBuilder.build(XtextGradleBuilder.java:192)
        at org.xtext.gradle.tasks.XtextGenerate.generate(XtextGenerate.java:166)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.api.internal.project.taskfactory.IncrementalTaskInputsTaskAction.doExecute(IncrementalTaskInputsTaskAction.java:47)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
        at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:568)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:553)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:536)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:276)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:265)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$0(ExecuteStep.java:32)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:32)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
        at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
        at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:159)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:72)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:43)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:192)
        ... 30 more
Caused by: java.lang.IllegalStateException: Resource has not been loaded
        at org.eclipse.xtext.common.types.access.impl.ClasspathTypeProvider.findTypeByClass(ClasspathTypeProvider.java:299)
        at org.eclipse.xtext.common.types.access.impl.ClasspathTypeProvider.findTypeByClass(ClasspathTypeProvider.java:247)
        at org.eclipse.xtext.common.types.access.impl.ClasspathTypeProvider.doFindTypeByName(ClasspathTypeProvider.java:221)
        at org.eclipse.xtext.common.types.access.impl.ClasspathTypeProvider.findTypeByName(ClasspathTypeProvider.java:213)
        at org.eclipse.xtext.common.types.xtext.AbstractTypeScope.getSingleElement(AbstractTypeScope.java:59)
        at org.eclipse.xtext.common.types.xtext.AbstractTypeScope.getSingleElement(AbstractTypeScope.java:54)
        at org.eclipse.xtend.core.scoping.LocalResourceFilteringTypeScope.getSingleElement(LocalResourceFilteringTypeScope.java:42)
        at org.eclipse.xtend.core.scoping.RecordingTypeScope.getSingleElement(RecordingTypeScope.java:51)
        at org.eclipse.xtext.scoping.impl.AbstractScope.getSingleElement(AbstractScope.java:108)
        at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:114)
        at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:265)
        at org.eclipse.xtext.xbase.resource.BatchLinkableResource.getEObject(BatchLinkableResource.java:119)
        ... 113 more


* Get more help at https://help.gradle.org

BUILD FAILED in 476ms
2 actionable tasks: 1 executed, 1 up-to-date

@cdietrich
Copy link
Member

hmm unfortunately this one does not print where the class version error is thrown
(asm, jdt, xtext)

@DanySK
Copy link
Author

DanySK commented Apr 9, 2020

I believe the error might be ASM. Anyway, my compileClasspath is using the latest Xtext:

$ ./gradlew dependencyInsight --dependency xtend --configuration compileClasspath

> Configure project :
No username provided for logging in Maven Central. Please set MAVEN_CENTRAL_USERNAME
No password provided for logging in Maven Central. Please set MAVEN_CENTRAL_PASSWORD

> Task :dependencyInsight
org.eclipse.xtend:org.eclipse.xtend.lib:2.21.0
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 8
   ]

org.eclipse.xtend:org.eclipse.xtend.lib:{require 2.21.0; reject _} -> 2.21.0
\--- compileClasspath

org.eclipse.xtend:org.eclipse.xtend.lib.macro:2.21.0
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 8
   ]

org.eclipse.xtend:org.eclipse.xtend.lib.macro:2.21.0
\--- org.eclipse.xtend:org.eclipse.xtend.lib:2.21.0
     \--- compileClasspath (requested org.eclipse.xtend:org.eclipse.xtend.lib:{require 2.21.0; reject _})

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 357ms
1 actionable task: 1 executed

@cdietrich
Copy link
Member

yes but i wonder why i did not see this in my tests

@DanySK
Copy link
Author

DanySK commented Apr 9, 2020

My build env classpath seems instead to be including old Xtext libraries.
How does exactly the plugin determine the version to use?

$ ./gradlew buildEnv

> Configure project :
No username provided for logging in Maven Central. Please set MAVEN_CENTRAL_USERNAME
No password provided for logging in Maven Central. Please set MAVEN_CENTRAL_PASSWORD

> Task :buildEnvironment

------------------------------------------------------------
Root project
------------------------------------------------------------

classpath
+--- com.github.spotbugs:com.github.spotbugs.gradle.plugin:4.0.5
|    \--- gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.0.5
+--- org.danilopianini.git-sensitive-semantic-versioning:org.danilopianini.git-sensitive-semantic-versioning.gradle.plugin:0.1.0
|    \--- org.danilopianini:git-sensitive-semantic-versioning:0.1.0
|         +--- com.palantir.gradle.gitversion:gradle-git-version:0.12.0-rc2
|         |    +--- org.eclipse.jgit:org.eclipse.jgit:4.5.4.201711221230-r
|         |    |    +--- com.jcraft:jsch:0.1.53
|         |    |    +--- com.googlecode.javaewah:JavaEWAH:0.7.9
|         |    |    +--- org.apache.httpcomponents:httpclient:4.3.6
|         |    |    |    +--- org.apache.httpcomponents:httpcore:4.3.3
|         |    |    |    +--- commons-logging:commons-logging:1.1.3
|         |    |    |    \--- commons-codec:commons-codec:1.6
|         |    |    \--- org.slf4j:slf4j-api:1.7.2
|         |    \--- com.google.guava:guava:20.0 -> 27.1-jre
|         |         +--- com.google.guava:failureaccess:1.0.1
|         |         +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|         |         +--- com.google.code.findbugs:jsr305:3.0.2
|         |         +--- org.checkerframework:checker-qual:2.5.2
|         |         +--- com.google.errorprone:error_prone_annotations:2.2.0
|         |         +--- com.google.j2objc:j2objc-annotations:1.1
|         |         \--- org.codehaus.mojo:animal-sniffer-annotations:1.17
|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.21 -> 1.3.70
|              +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.70
|              \--- org.jetbrains:annotations:13.0
+--- org.danilopianini.javadoc.io-linker:org.danilopianini.javadoc.io-linker.gradle.plugin:0.1.4
|    \--- gradle.plugin.org.danilopianini:javadoc.io-linker:0.1.4
+--- org.danilopianini.publish-on-central:org.danilopianini.publish-on-central.gradle.plugin:0.2.0
|    \--- org.danilopianini:publish-on-central:0.2.0
|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.3.70 (*)
+--- org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:9.0.0
|    \--- org.jlleitschuh.gradle:ktlint-gradle:9.0.0
|         \--- net.swiftzer.semver:semver:1.1.1
+--- org.xtext.xtend:org.xtext.xtend.gradle.plugin:2.0.8
|    \--- org.xtext:xtext-gradle-plugin:2.0.8
|         +--- com.google.guava:guava:27.1-jre (*)
|         +--- org.eclipse.xtend:org.eclipse.xtend.lib:2.9.0
|         |    +--- org.eclipse.xtext:org.eclipse.xtext.xbase.lib:2.9.0
|         |    |    \--- com.google.guava:guava:[10.0.1,14.0.1] -> 27.1-jre (*)
|         |    \--- org.eclipse.xtend:org.eclipse.xtend.lib.macro:2.9.0
|         |         +--- org.eclipse.xtext:org.eclipse.xtext.xbase.lib:2.9.0 (*)
|         |         \--- com.google.guava:guava:[10.0.1,14.0.1] -> 27.1-jre (*)
|         +--- org.eclipse.core:org.eclipse.core.runtime:3.7.0
|         |    +--- org.eclipse.osgi:org.eclipse.osgi:3.7.1
|         |    +--- org.eclipse.equinox:org.eclipse.equinox.common:3.6.0
|         |    +--- org.eclipse.core:org.eclipse.core.jobs:3.5.100
|         |    |    \--- org.eclipse.equinox:org.eclipse.equinox.common:3.6.0
|         |    +--- org.eclipse.equinox:org.eclipse.equinox.registry:3.5.101
|         |    |    \--- org.eclipse.equinox:org.eclipse.equinox.common:3.6.0
|         |    +--- org.eclipse.equinox:org.eclipse.equinox.preferences:3.4.1
|         |    |    \--- org.eclipse.equinox:org.eclipse.equinox.common:3.6.0
|         |    +--- org.eclipse.core:org.eclipse.core.contenttype:3.4.100
|         |    |    +--- org.eclipse.equinox:org.eclipse.equinox.preferences:3.4.1 (*)
|         |    |    +--- org.eclipse.equinox:org.eclipse.equinox.registry:3.5.101 (*)
|         |    |    \--- org.eclipse.equinox:org.eclipse.equinox.common:3.6.0
|         |    \--- org.eclipse.equinox:org.eclipse.equinox.app:1.3.100
|         \--- org.xtext:xtext-gradle-protocol:2.0.8
|              \--- com.google.guava:guava:27.1-jre (*)
+--- org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.3.70} -> 1.3.70 (c)
+--- org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.3.70} -> 1.3.70 (c)
\--- org.jetbrains:annotations:{strictly 13.0} -> 13.0 (c)

(c) - dependency constraint
(*) - dependencies omitted (listed previously)

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 346ms
1 actionable task: 1 executed

@cdietrich
Copy link
Member

using explicit xbase.lib version gives different error

@DanySK
Copy link
Author

DanySK commented Apr 9, 2020

Update: forcing a newer Xtext version in the buildscript seems to have some effect:

buildscript {
    dependencies {
        classpath("org.eclipse.xtend:org.eclipse.xtend.lib:2.21.0")
    }
}
$ ./gradlew buildEnv

> Configure project :
No username provided for logging in Maven Central. Please set MAVEN_CENTRAL_USERNAME
No password provided for logging in Maven Central. Please set MAVEN_CENTRAL_PASSWORD

> Task :buildEnvironment

------------------------------------------------------------
Root project
------------------------------------------------------------

classpath
+--- org.eclipse.xtend:org.eclipse.xtend.lib:2.21.0
|    +--- org.eclipse.xtext:org.eclipse.xtext.xbase.lib:2.21.0
|    |    \--- com.google.guava:guava:27.1-jre
|    |         +--- com.google.guava:failureaccess:1.0.1
|    |         +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|    |         +--- com.google.code.findbugs:jsr305:3.0.2
|    |         +--- org.checkerframework:checker-qual:2.5.2
|    |         +--- com.google.errorprone:error_prone_annotations:2.2.0
|    |         +--- com.google.j2objc:j2objc-annotations:1.1
|    |         \--- org.codehaus.mojo:animal-sniffer-annotations:1.17
|    \--- org.eclipse.xtend:org.eclipse.xtend.lib.macro:2.21.0
|         \--- org.eclipse.xtext:org.eclipse.xtext.xbase.lib:2.21.0 (*)
+--- com.github.spotbugs:com.github.spotbugs.gradle.plugin:4.0.5
|    \--- gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.0.5
+--- org.danilopianini.git-sensitive-semantic-versioning:org.danilopianini.git-sensitive-semantic-versioning.gradle.plugin:0.1.0
|    \--- org.danilopianini:git-sensitive-semantic-versioning:0.1.0
|         +--- com.palantir.gradle.gitversion:gradle-git-version:0.12.0-rc2
|         |    +--- org.eclipse.jgit:org.eclipse.jgit:4.5.4.201711221230-r
|         |    |    +--- com.jcraft:jsch:0.1.53
|         |    |    +--- com.googlecode.javaewah:JavaEWAH:0.7.9
|         |    |    +--- org.apache.httpcomponents:httpclient:4.3.6
|         |    |    |    +--- org.apache.httpcomponents:httpcore:4.3.3
|         |    |    |    +--- commons-logging:commons-logging:1.1.3
|         |    |    |    \--- commons-codec:commons-codec:1.6
|         |    |    \--- org.slf4j:slf4j-api:1.7.2
|         |    \--- com.google.guava:guava:20.0 -> 27.1-jre (*)
|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.21 -> 1.3.70
|              +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.70
|              \--- org.jetbrains:annotations:13.0
+--- org.danilopianini.javadoc.io-linker:org.danilopianini.javadoc.io-linker.gradle.plugin:0.1.4
|    \--- gradle.plugin.org.danilopianini:javadoc.io-linker:0.1.4
+--- org.danilopianini.publish-on-central:org.danilopianini.publish-on-central.gradle.plugin:0.2.0
|    \--- org.danilopianini:publish-on-central:0.2.0
|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.3.70 (*)
+--- org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:9.0.0
|    \--- org.jlleitschuh.gradle:ktlint-gradle:9.0.0
|         \--- net.swiftzer.semver:semver:1.1.1
+--- org.xtext.xtend:org.xtext.xtend.gradle.plugin:2.0.8
|    \--- org.xtext:xtext-gradle-plugin:2.0.8
|         +--- com.google.guava:guava:27.1-jre (*)
|         +--- org.eclipse.xtend:org.eclipse.xtend.lib:2.9.0 -> 2.21.0 (*)
|         +--- org.eclipse.core:org.eclipse.core.runtime:3.7.0
|         |    +--- org.eclipse.osgi:org.eclipse.osgi:3.7.1
|         |    +--- org.eclipse.equinox:org.eclipse.equinox.common:3.6.0
|         |    +--- org.eclipse.core:org.eclipse.core.jobs:3.5.100
|         |    |    \--- org.eclipse.equinox:org.eclipse.equinox.common:3.6.0
|         |    +--- org.eclipse.equinox:org.eclipse.equinox.registry:3.5.101
|         |    |    \--- org.eclipse.equinox:org.eclipse.equinox.common:3.6.0
|         |    +--- org.eclipse.equinox:org.eclipse.equinox.preferences:3.4.1
|         |    |    \--- org.eclipse.equinox:org.eclipse.equinox.common:3.6.0
|         |    +--- org.eclipse.core:org.eclipse.core.contenttype:3.4.100
|         |    |    +--- org.eclipse.equinox:org.eclipse.equinox.preferences:3.4.1 (*)
|         |    |    +--- org.eclipse.equinox:org.eclipse.equinox.registry:3.5.101 (*)
|         |    |    \--- org.eclipse.equinox:org.eclipse.equinox.common:3.6.0
|         |    \--- org.eclipse.equinox:org.eclipse.equinox.app:1.3.100
|         \--- org.xtext:xtext-gradle-protocol:2.0.8
|              \--- com.google.guava:guava:27.1-jre (*)
+--- org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.3.70} -> 1.3.70 (c)
+--- org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.3.70} -> 1.3.70 (c)
\--- org.jetbrains:annotations:{strictly 13.0} -> 13.0 (c)

(c) - dependency constraint
(*) - dependencies omitted (listed previously)

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 446ms
1 actionable task: 1 executed
$ ./gradlew check 

> Configure project :
No username provided for logging in Maven Central. Please set MAVEN_CENTRAL_USERNAME
No password provided for logging in Maven Central. Please set MAVEN_CENTRAL_PASSWORD

> Task :generateXtext FAILED
ERROR:The type UnmodifiableListSet inherits multiple implementations of the method of() from Set and List. (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/UnmodifiableListSet.xtend line : 7 column : 7)
WARNING:The def modifier is unnecessary on method toString (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/UnmodifiableListSet.xtend line : 15 column : 11)
WARNING:The def modifier is unnecessary on method hashCode (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/UnmodifiableListSet.xtend line : 19 column : 11)
WARNING:The def modifier is unnecessary on method equals (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/UnmodifiableListSet.xtend line : 23 column : 11)
ERROR:Type mismatch: cannot convert from Set<Object> to ImmutableListSet<?> (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ListSets.xtend line : 8 column : 41)
ERROR:The type ListSet inherits multiple implementations of the method of() from Set and List. (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ListSet.xtend line : 14 column : 11)
ERROR:The type ListBackedSet inherits multiple implementations of the method of() from Set and List. (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ListBackedSet.xtend line : 10 column : 7)
WARNING:The def modifier is unnecessary on method sort (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ListBackedSet.xtend line : 20 column : 11)
WARNING:The def modifier is unnecessary on method toString (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ListBackedSet.xtend line : 24 column : 11)
WARNING:The def modifier is unnecessary on method hashCode (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ListBackedSet.xtend line : 28 column : 11)
WARNING:The def modifier is unnecessary on method equals (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ListBackedSet.xtend line : 32 column : 11)
ERROR:The type ImmutableListSet inherits multiple implementations of the method of() from Set and List. (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 7 column : 7)
ERROR:Name clash: The method copyOf(Collection<E>) of type ImmutableListSet has the same erasure as copyOf(Collection<? extends E>) of type List but does not override it. (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 17 column : 47)
WARNING:The public modifier is unnecessary on method of (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 13 column : 9)
WARNING:The public modifier is unnecessary on method copyOf (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 17 column : 9)
WARNING:The public modifier is unnecessary on method copyOf (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 21 column : 9)
WARNING:The public modifier is unnecessary on method newBuilder (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 25 column : 9)
WARNING:The def modifier is unnecessary on method toString (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 29 column : 14)
WARNING:The def modifier is unnecessary on method hashCode (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 33 column : 14)
WARNING:The def modifier is unnecessary on method equals (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 37 column : 14)
WARNING:The public modifier is unnecessary on class Builder (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 41 column : 5)
WARNING:The public modifier is unnecessary on type Builder (file:/home/danysk/Dropbox/Workspaces/SingleProjects/listset/src/main/java/org/danilopianini/util/ImmutableListSet.xtend line : 43 column : 9)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateXtext'.
> Xtext validation failed, see build log for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 624ms
2 actionable tasks: 1 executed, 1 up-to-date

Now I believe it's just my code being problematic, but the plugin is running.
You might want to release a new version declaring a dependency on a more recent Xtext than 2.9.0, or allow for version selection/detection.

@cdietrich
Copy link
Member

not to the buildscript.
to the build

dependencies {
    implementation("com.google.guava:guava:27.1-jre")
    implementation("org.eclipse.xtend:org.eclipse.xtend.lib:2.21.0")

@cdietrich
Copy link
Member

The type ListSet inherits multiple implementations of the method copyOf(Collection<? extends E>) from Set and List.`

seems to be a xtend bug with static IF methods

@cdietrich
Copy link
Member

yes

public interface IX {
	
	public static int getTheNumber() {
		return 42;
	}

}
public interface IY {
	
	public static int getTheNumber() {
		return 42;
	}

}
class Both implements IX, IY {
	
}

gives

Description	Resource	Path	Location	Type
The type Both inherits multiple implementations of the method getTheNumber() from IX and IY.	Both.xtend	/a/src/a	line: 3 /a/src/a/Both.xtend	Xtend Problem

can you please create an xtend bug for that

@DanySK
Copy link
Author

DanySK commented Apr 9, 2020

@cdietrich I can open a report, but why is it a bug? Doesn't Xtend search static methods into superinterfaces? I believe in this very case it is my code that is broken with newer JDKs, as the compiler can't figure out what to call, and I can't either :)

In your case as well, you should disambiguate. Make IY return 0: if you call Both.getTheNumber would you expect 42 or 0? Unless you give some priority semantics to implementation ordering, this is a multiple inheritance problem, and I believe the Xtend compiler is correct at asking to disambiguate.

Am I wrong?

@cdietrich
Copy link
Member

cdietrich commented Apr 9, 2020

the problem is on override check.
if you have two interface methods or default methods you have to override them
but for static methods you dont.
(at least not in pure java - static methods are visible on if only, not implementors)
this is a bug even back to java 8.

@DanySK
Copy link
Author

DanySK commented Apr 9, 2020

Yeah, but in pure Java AFAIK you cannot call YourClass.staticMethod() and expect the compiler to bind YourSuperClass.staticMethod(), while Xtend does, hence the need for disambiguation of static methods. Am I wrong?

@cdietrich
Copy link
Member

hmmmm i would consider this a second bug.

@cdietrich
Copy link
Member

if you open an issue we can discuss with @szarnekow
maybe he remembers/can judge

@DanySK
Copy link
Author

DanySK commented Apr 9, 2020

opened

@DanySK
Copy link
Author

DanySK commented Apr 9, 2020

I set up the build on CI: https://travis-ci.org/github/DanySK/listset/builds/673056427
It confirms that by depending explicitly by a newer version of Xtext the issue gets resolved.

I wonder why my local machine still has issues, but at this point must be some cache corruption, as it works as expected on all environments on CI. Closing.

@DanySK DanySK closed this as completed Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants