Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Analysis hints for assertj: assertThat does not modify its argument

Aperta
#116 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java
Ambito
devtools

Direzione di ricerca

Start with the existing libs/test (JUnit Jupiter) hints as the model: follow how it is wired through a compile dependency in maddi-aapi-archive, an entry in CompileAnalysisHints.LIBRARIES, and one in LoadAnalysisResults.ANALYZED_RESULTS. The annotation targets are the assertThat*/then* entry points of org.assertj.core.api.Assertions, WithAssertions and BDDAssertions. Done when the argument of those methods is marked @NotModified and the langchain4j-core fields named in the issue (UserMessage.contents, ChatRequest.messages, AiMessage.toolExecutionRequests) are no longer reported as modified.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

AssertJ has no hints. An unannotated library parameter defaults to modified, so every assertThat(x) in a project's test code makes x modified. Through the reachability pass's shared callee-parameter node, that reaches the fields and parameters behind every argument passed there.

Measured on langchain4j-core (CodeLaser/maddi-mod#24): UserMessage.contents, ChatRequest.messages and AiMessage.toolExecutionRequests are modified only because tests pass them to WithAssertions.assertThat(List) / Assertions.assertThat(List).

Minimum: @NotModified on the argument of the assertThat*/then* entry points of org.assertj.core.api.Assertions, WithAssertions and BDDAssertions. Better: the Abstract*Assert methods, which read the actual value. Like libs/test (JUnit Jupiter), this needs a compile dependency in maddi-aapi-archive, an entry in CompileAnalysisHints.LIBRARIES and one in LoadAnalysisResults.ANALYZED_RESULTS.

Lingua principale
Java
Stelle
1
Fork
1
Merge medio
2h 51m
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CodeLaser/maddi

Tutte le issue di CodeLaser/maddi

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.