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

Wildcard types not supported exception: Multiple constructors + guava ImmutableList + Linux #58

Open
Borginator opened this issue Nov 7, 2019 · 0 comments

Comments

@Borginator
Copy link

Borginator commented Nov 7, 2019

Given the example minimal project at https://github.com/Borginator/exampleJFixtureIssue

This project has a single test which fixtures a single class which throws "Wildcard types not supported" only under Linux (explicitly tested under centos 7 Linux local-dev 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux, and also seen on the docker maven 3.5.0 "docker pull maven:3.5.0").

The same code does not throw this exception under Windows.

Both the CentOS and the Windows systems were using OpenJDK jdk8u212-b04

The class I am trying to fixture is here:

import com.google.common.collect.ImmutableList;

public class SomeClass {

  private final String aString;

  public SomeClass(String path) {
    this.aString = "";
  }

  // Delete *any combination* of the below constructors and the test passes
  public SomeClass(String alias, String... path) {
    this("");
  }

  public SomeClass(String alias, ImmutableList<String> path) {
    this("");
  }

  public SomeClass(ImmutableList<String> path) {
    this("");
  }

}

As specified in the comment, the issue only occurs when all 4 constructors are defined, removing any one (or more) of the specified constructors allows the class to be fixtured. Also, (and this may not be specifically relevant) but using Java List instead of Guava ImmutableList allows the class to be fixtured too.

I can work around this problem, but it's weird to have different behaviours on Linux and Windows.

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

1 participant