TestExamples crashes on a diagnostic without a source position

Aberta
#403 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
Meio dia
Facilidade para iniciantes
52/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
java
Domínio
testing

Direção de pesquisa

The crash is in TestExamples.matches, where diagnostic.getPosition().getLine() dereferences a null position for the "Java compilation encountered issues" warning. Start there and run the TestExamples test suite with a reproducer that emits that warning. Done means an unmatched position-less diagnostic reports the "unexpected diagnostic" failure instead of throwing a NullPointerException. The fixture syntax for expecting a position-less warning is not settled in the issue, so agree on it with the maintainers before adding it.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug

Impact: test-only. Reproducers that produce the "Java compilation encountered issues" warning cannot become test fixtures. It blocked fixtures for #390 and #345.

Description

TestExamples.matches calls diagnostic.getPosition().getLine(). The compilation warning has no position, so the test crashes with a NullPointerException instead of failing with the "unexpected diagnostic" message, and an expected position-less warning cannot be declared.

Possible fix

Treat a diagnostic without a position as unmatched (return false), and decide how a fixture expects a position-less warning (e.g. a file-level // Expect: Warning comment).

Linguagem predominante
Java
Estrelas
73
Forks
38
Merge médio
12h 32min
PRs com merge (30d)
45

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de liquid-java/liquidjava

Todas as issues de liquid-java/liquidjava

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.