External refinements are not applied to packages checked before the spec's package
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 55/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- java
- Domínio
- testing-qa
Direção de pesquisa
Start with RefinementProcessor.processPackage, which the issue identifies as registering external specs, checking package types, and then recursing into sub-packages. Trace how first-pass information is registered across the package tree and how verification consumes external specs. Reproduce the example with VectorRefinements and Client; done means the invalid Vector constructor call reports a refinement error regardless of package order.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
An @ExternalRefinementsFor spec is ignored when the code that uses the class is in a package that is checked before the spec's own package: its parent package, or a sibling that comes earlier. A call that violates the spec then passes verification silently.
Example
sub/VectorRefinements.java:
package sub;
import liquidjava.specification.ExternalRefinementsFor;
import liquidjava.specification.Refinement;
@ExternalRefinementsFor("java.util.Vector")
public interface VectorRefinements<E> {
public void Vector(@Refinement("_ >= 0") int initialCapacity);
}
Client.java, in the unnamed package:
import java.util.Vector;
public class Client {
public static void main(String[] args) {
Vector<String> v = new Vector<>(-1);
}
}
Verifying the directory gives Correct! Passed Verification. (checked with 0.0.35 and main).
| Spec in | Client in | Result |
|---|---|---|
sub |
unnamed package (same directory, or spec in sub/) |
passes |
sub |
sibling app |
passes |
aspec |
sibling zclient |
Refinement Error |
sub |
sub or sub.inner |
Refinement Error |
| unnamed package | unnamed package or app |
Refinement Error |
Cause
RefinementProcessor.processPackage registers a package's external specs, checks that package's types, and only then recurses into its sub-packages. A spec is therefore unknown while every package checked before its own is verified.
Possible fix
Register the external specs (and the other first-pass information) of the whole package tree before checking any package's types.
Impact
Found while running the Barista benchmark specs (package expert.<class>;) against exercises in the unnamed package: every violation passed until the spec's package line was removed.
- Linguagem predominante
- Java
- Estrelas
- 73
- Forks
- 38
- Merge médio
- 12h 32min
- PRs com merge (30d)
- 45
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de liquid-java/liquidjava
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
liquid-java/liquidjava#562 ·
Mantenedores costumam responder em até 1 dia
-
A float ghost crashes the verifier: "Ghost not implemented for type float"Talvez já em andamento @MohammedZaid1740 assumiu há 7 dias. Abertabug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
liquid-java/liquidjava#443 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug real-world-finding
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
liquid-java/liquidjava#395 ·
Mantenedores costumam responder em até 1 dia
-
A ternary between arrays crashes: Sorts (Array Int Int) and Bool are incompatibleTalvez já em andamento @CatarinaGamboa assumiu há 4 dias. Abertabug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 15/100
liquid-java/liquidjava#558 ·
Mantenedores costumam responder em até 1 dia
-
new T[a][b] gets length b instead of a (unsound)Talvez já em andamento @CatarinaGamboa assumiu há 4 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 30/100
liquid-java/liquidjava#557 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de liquid-java/liquidjava
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 60/100
quelea-projection/Quelea#749 ·
Mantenedores costumam responder em até 1 dia
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 92/100
erkamyaman/rust-anything#963 ·
Mantenedores costumam responder em até 1 dia
-
api-diagnostics bug jdbc
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
ClickHouse/clickhouse-java#3464 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 76/100
-
Deferred
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Sanne/incus-spawn#2768 ·
Mantenedores costumam responder em até 1 dia