Inconsistent imports
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by reproducing the generated Java compile error with the versions listed in the issue, then inspect the generator's import handling and configuration options. Done means generated assertions no longer produce conflicting imports and the choice between imports and fully qualified class names is configurable.
Written by the indexing model from the issue text.
Description
Problem:
I'm having classes generated with imports like:
import java.util.Objects;
import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.internal.Iterables;
import org.assertj.core.util.Objects;
And this results in the compile error:
'java.util.Objects' is already defined in a single-type import
Solution:
I'd like to just use fully qualified class names instead of import statements.
I see https://github.com/assertj/assertj-assertions-generator/issues/97 requested using imports instead of fully qualified class names. Maybe both should be supported, but it should be configurable which one is being used.
Also it looks like this the use of fully qualified class names was already implemented for 2.2.1 with https://github.com/assertj/assertj-assertions-generator/commit/73d3c5e584e33b1509b058a2707c1ece00ee8bee?
Versions:
I'm using assertj-assertions-generator version 2.2.1, assertj-assertions-generator-maven-plugin version 2.2.0, and assertj-core version 3.21.0.
- Dominant language
- Java
- Stars
- 72
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from assertj/assertj-generator
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
assertj/assertj-generator#278 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
assertj/assertj-generator#220 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
assertj/assertj-generator#219 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
assertj/assertj-generator#204 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
assertj/assertj-generator#197 · 7 comments ·
All issues in assertj/assertj-generator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100