Generator appears to skip some classes in jars

Open
#61 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
devtools

Research direction

Start at the org.assertj.assertions.generator.cli.AssertionGeneratorLauncher entry point and reproduce the two commands using schemas-d6cc80d.jar as a jar and as an unpacked directory. Compare class discovery and generated-file counts; done means the jar form discovers the same classes as the unpacked form, or the limitation is clearly identified.

Written by the indexing model from the issue text.

Description

Hopefully reproducible with the following:

> wget -O assertj-assertions-generator-2.0.0-unix.zip https://search.maven.org/remotecontent?filepath=org/assertj/assertj-assertions-generator/2.0.0/assertj-assertions-generator-2.0.0-unix.zip
> unzip assertj-assertions-generator-2.0.0-unix.zip
> cd assertion-generator/
assertion-generator> mkdir tmp
assertion-generator> cd tmp
tmp> wget https://jitpack.io/com/github/ga4gh/schemas/d6cc80d/schemas-d6cc80d.jar
tmp> wget http://central.maven.org/maven2/com/google/protobuf/protobuf-java/3.0.0-beta-2/protobuf-java-3.0.0-beta-2.jar
tmp> cd ..
assertion-generator> java -cp "tmp/*:lib/*" org.assertj.assertions.generator.cli.AssertionGeneratorLauncher ga4gh
assertion-generator> find ga4gh/ -type f -name "*.java" | wc -l
9

So 9 files have been generated.

assertion-generator> rm -rf ga4gh
assertion-generator> cd tmp
tmp> unzip schemas-d6cc80d.jar
tmp> cd ..
assertion-generator> java -cp "tmp:tmp/*:lib/*" org.assertj.assertions.generator.cli.AssertionGeneratorLauncher ga4gh
assertion-generator> find ga4gh/ -type f -name "*.java" | wc -l
143

Now 143 files have been generated, which is more what I was expecting.

Is this something really odd with what I'm doing? This looks to me like a bug in how the generator locates classes to generate for.

Dominant language
Java
Stars
72
Forks
47
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from assertj/assertj-generator

All issues in assertj/assertj-generator

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.