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

Something broken with 1.13.4 compilation #64

Open
cstamas opened this issue Feb 15, 2018 · 4 comments
Open

Something broken with 1.13.4 compilation #64

cstamas opened this issue Feb 15, 2018 · 4 comments

Comments

@cstamas
Copy link
Member

cstamas commented Feb 15, 2018

Env:
OS: MacOS 10.12.6
Java version: 1.8.0_161 Oracle
Maven: 3.5.2
Lifecycle config:

      <plugin>
        <groupId>io.takari.maven.plugins</groupId>
        <artifactId>takari-lifecycle-plugin</artifactId>
        <version>1.13.3</version>
        <extensions>true</extensions>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <sourceJar>true</sourceJar>
          <accessRulesViolation>error</accessRulesViolation>
          <compilerId>jdt</compilerId>
          <proc>proc</proc>
          <!-- Generated TP3 DSL classes are full of warnings, nothing we can do about -->
          <showWarnings>false</showWarnings>
        </configuration>
        <executions>
          <execution>
            <id>sisu-index</id>
            <goals>
              <goal>sisu-index</goal>
            </goals>
          </execution>
          <execution>
            <id>sisu-test-index</id>
            <goals>
              <goal>sisu-test-index</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Symptom:
Justby updating from lifecycle 1.13.3 to 1.13.4 (no other change!) the project fails to build w/ compilation error. Downgrading back to 1.13.3 makes project build just fine again.

This might be related to new compiler? As there is no source/target nor Java version change, merely the lifecycle plugin version is changed between builds. Or is there some language level mishap? Or just compiler configuration mishap? Please help where to look more.

The classes in question are these:

public class GraphTraversalSource implements TraversalSource {
  ...
  @Override
  @SuppressWarnings({"unchecked"})
  public GraphTraversalSource withoutStrategies(final Class<? extends TraversalStrategy>... traversalStrategyClasses) {
      return (GraphTraversalSource) TraversalSource.super.withoutStrategies(traversalStrategyClasses);
  }
  ...
}

public class MingTraversalSourceDsl extends GraphTraversalSource
{
  ...
  ...
}

public class MingTraversalSource extends MingTraversalSourceDsl {
  ...
  @Override
  public MingTraversalSource withoutStrategies(Class<? extends TraversalStrategy>... traversalStrategyClasses) {
    return (MingTraversalSource) super.withoutStrategies(traversalStrategyClasses);
  }
  ...
}

Where GraphTraversalSource comes from gremlin-core:3.3.1, MingTraversalSourceDsl is in src/main/java and MingTraversalSource is generated. I verified that 1.13.3 and 1.13.4 generates equal source files, no change there. Note: TraversalStrategy is raw class.

This is the most I can get out from build (w/ -X -e):

--- takari-lifecycle-plugin:1.13.4:compile (default-compile) @ tinkerpop-dsl ---
Configuring mojo io.takari.maven.plugins:takari-lifecycle-plugin:1.13.4:compile from plugin realm ClassRealm[extension>io.takari.maven.plugins:takari-lifecycle-plugin:1.13.4, parent: sun.misc.Launcher$AppClassLoader@3d4eac69]
Previous incremental build state does not exist, performing full build
Configuring mojo 'io.takari.maven.plugins:takari-lifecycle-plugin:1.13.4:compile' with takari configurator -->
  (f) basedir = /Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl
  (f) buildDirectory = /Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/target
  (f) compileArtifacts = [org.slf4j:slf4j-api:jar:1.7.25:compile, org.apache.tinkerpop:gremlin-core:jar:3.3.1:compile, org.apache.tinkerpop:gremlin-shaded:jar:3.3.1:compile, commons-configuration:commons-configuration:jar:1.10:compile, commons-lang:commons-lang:jar:2.6:compile, org.yaml:snakeyaml:jar:1.15:compile, org.javatuples:javatuples:jar:1.2:compile, com.carrotsearch:hppc:jar:0.7.3:compile, com.jcabi:jcabi-manifests:jar:1.1:compile, com.jcabi:jcabi-log:jar:0.14:compile, com.squareup:javapoet:jar:1.8.0:compile, net.objecthunter:exp4j:jar:0.4.8:compile, org.slf4j:jcl-over-slf4j:jar:1.7.25:compile, com.google.code.findbugs:jsr305:jar:3.0.2:provided]
  (f) compileSourceRoots = [/Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/src/main/java]
  (f) compilerId = jdt
  (f) debug = all
  (f) directDependencies = [org.slf4j:slf4j-api:jar:1.7.25:compile, org.apache.tinkerpop:gremlin-core:jar:3.3.1:compile, com.walmart.ming.test:support:jar:1.0.0-SNAPSHOT:test, com.google.code.findbugs:jsr305:jar:3.0.2:provided]
  (f) encoding = UTF-8
  (f) generatedSourcesDirectory = /Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/target/generated-sources/annotations
  (f) outputDirectory = /Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/target/classes
  (f) parameters = false
  (f) pluginArtifact = io.takari.maven.plugins:takari-lifecycle-plugin:maven-plugin:1.13.4
  (f) pom = /Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/pom.xml
  (f) privatePackageReference = ignore
  (f) proc = proc
  (f) project = MavenProject: com.walmart.ming.dsl:tinkerpop-dsl:1.0.0-SNAPSHOT @ /Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/pom.xml
  (f) repositorySession = org.eclipse.aether.DefaultRepositorySystemSession@159a48a6
  (f) showWarnings = false
  (f) source = 1.8
  (f) target = 1.8
  (f) transitiveDependencyReference = ignore
  (f) verbose = false
-- end configuration --
Compile source roots:
/Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/src/main/java
   includes=[**/*.java] excludes=[] matched=4
Compile classpath: 14 entries
   /Users/tcserve/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar
   /Users/tcserve/.m2/repository/org/apache/tinkerpop/gremlin-core/3.3.1/gremlin-core-3.3.1.jar
   /Users/tcserve/.m2/repository/org/apache/tinkerpop/gremlin-shaded/3.3.1/gremlin-shaded-3.3.1.jar
   /Users/tcserve/.m2/repository/commons-configuration/commons-configuration/1.10/commons-configuration-1.10.jar
   /Users/tcserve/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
   /Users/tcserve/.m2/repository/org/yaml/snakeyaml/1.15/snakeyaml-1.15.jar
   /Users/tcserve/.m2/repository/org/javatuples/javatuples/1.2/javatuples-1.2.jar
   /Users/tcserve/.m2/repository/com/carrotsearch/hppc/0.7.3/hppc-0.7.3.jar
   /Users/tcserve/.m2/repository/com/jcabi/jcabi-manifests/1.1/jcabi-manifests-1.1.jar
   /Users/tcserve/.m2/repository/com/jcabi/jcabi-log/0.14/jcabi-log-0.14.jar
   /Users/tcserve/.m2/repository/com/squareup/javapoet/1.8.0/javapoet-1.8.0.jar
   /Users/tcserve/.m2/repository/net/objecthunter/exp4j/0.4.8/exp4j-0.4.8.jar
   /Users/tcserve/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.jar
   /Users/tcserve/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar
Analyzed 14 classpath dependencies (0 ms)
Digested 0 types and 0 packages in 0 ms
Analyzed 0 classpath dependencies (0 ms)
New or changed classpath entry /Users/tcserve/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar
New or changed classpath entry /Users/tcserve/.m2/repository/org/apache/tinkerpop/gremlin-core/3.3.1/gremlin-core-3.3.1.jar
New or changed classpath entry /Users/tcserve/.m2/repository/org/apache/tinkerpop/gremlin-shaded/3.3.1/gremlin-shaded-3.3.1.jar
New or changed classpath entry /Users/tcserve/.m2/repository/commons-configuration/commons-configuration/1.10/commons-configuration-1.10.jar
New or changed classpath entry /Users/tcserve/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
New or changed classpath entry /Users/tcserve/.m2/repository/org/yaml/snakeyaml/1.15/snakeyaml-1.15.jar
New or changed classpath entry /Users/tcserve/.m2/repository/org/javatuples/javatuples/1.2/javatuples-1.2.jar
New or changed classpath entry /Users/tcserve/.m2/repository/com/carrotsearch/hppc/0.7.3/hppc-0.7.3.jar
New or changed classpath entry /Users/tcserve/.m2/repository/com/jcabi/jcabi-manifests/1.1/jcabi-manifests-1.1.jar
New or changed classpath entry /Users/tcserve/.m2/repository/com/jcabi/jcabi-log/0.14/jcabi-log-0.14.jar
New or changed classpath entry /Users/tcserve/.m2/repository/com/squareup/javapoet/1.8.0/javapoet-1.8.0.jar
New or changed classpath entry /Users/tcserve/.m2/repository/net/objecthunter/exp4j/0.4.8/exp4j-0.4.8.jar
New or changed classpath entry /Users/tcserve/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.jar
New or changed classpath entry /Users/tcserve/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar
Analyzed 14 classpath dependencies (1 ms)
Annotation processor path changed, recompiling all sources
Compiling 4 sources to /Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/target/classes
[ERROR] /Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/target/generated-sources/annotations/com/walmart/ming/dsl/tinkerpop3/MingTraversalSource.java:[152,30] Name clash: The method withoutStrategies(Class<? extends TraversalStrategy>...) of type MingTraversalSource has the same erasure as withoutStrategies(Class<? extends TraversalStrategy>...) of type GraphTraversalSource but does not override it
[ERROR] /Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/target/generated-sources/annotations/com/walmart/ming/dsl/tinkerpop3/MingTraversalSource.java:[152,30] The method withoutStrategies(Class<? extends TraversalStrategy>...) of type MingTraversalSource must override or implement a supertype method
Compiled 4 out of 4 sources (605 ms)
Stored incremental build state /Users/tcserve/Worx/walmart/ming/dsl/tinkerpop-dsl/target/incremental/io.takari.maven.plugins_takari-lifecycle-plugin_compile_default-compile (8 ms)
@cstamas
Copy link
Member Author

cstamas commented Feb 15, 2018

Demo project reproducing this behaviour https://github.com/cstamas/lifecycle-1-13-4-compiler

@ifedorenko
Copy link
Contributor

Does the project build in the latest Eclipse 4.8 milestone? Eclipse JDT developers stated on several occasions they do not consider raw type support a priority, so I would not be too surprised there was a change in behaviour between Eclipse 4.7 used by lifecycle 0.13.3 or 4.8 used by lifecycle 0.13.4.

@cstamas
Copy link
Member Author

cstamas commented Mar 3, 2018

Tested Eclipse 4.8M5 with https://github.com/cstamas/lifecycle-1-13-4-compiler (having takari lifecycle set to 1.13.3 to make build pass), and same compilation error is reported.

http://take.ms/Jn06m

@ifedorenko
Copy link
Contributor

Guess you can petition eclipse jdt devs to improve raw type support. Keeping this issue open for future references, but there is not much we can do from takari lifecycle side of things.

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