assertj / assertj/assertj-generator
...internal.Iterables is used in Asserts generated by assertj-assertions-generator (java9)
- Lingua principale
- Java
- Stelle
- 72
- Fork
- 47
- Merge medio
- 1g 16h
- PR unite (30g)
- 2
Descrizione
#### Summary
Hi,
I am migrating from java 8 to 17 and had big trouble getting the generated assertions to work (actually is does not work at all, is it dead?)
But even with great hacks I cannot get arround that the generated code imports the internal class `org.assertj.core.internal.Iterables` which is (of course) not exported by assertj-core. Could this become public? Or could the code-generator be updated? Which btw has medium CVEs in it's dependencies.
#### Example
```java
import org.assertj.core.internal.Iterables;
//this is part of the generated code
public YAssert hasXs(X... xs) {
// check that actual Y we want to make assertions on is not null.
isNotNull();
// check that given X varargs is not null.
if (x== null) failWithMessage("Expecting x parameter not to be null.");
// check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
Iterables.instance().assertContains(info, actual.getX(), xs);
// return the current assertion for method chaining
return this;
}
```
Package 'org.assertj.core.internal' is declared in module 'org.assertj.core', which does not export it to module 'my.assertions'
In other words: Is does not compile in Java > 8 which renders the complete code generation useless.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia ispezionando il percorso di generazione delle asserzioni che produce importazioni di org.assertj.core.internal.Iterables, quindi riproduci l’errore di compilazione del codice generato in un progetto modulare Java 9+. Il lavoro è completato quando le asserzioni generate non dipendono più dalla classe interna non esportata e vengono compilate correttamente su Java 9 e versioni successive.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100