Skip to content

No VarAnnot insert if reserve class order #432

@aosen-xiong

Description

@aosen-xiong

take the two examples and run with debug solver. For explanation, we just changed the order of class.

class List{
	Object[] elems;

	int a;
	List() {
		Object[] t = new Object[10];
		this.elems = t;
	}
}

class MyA {
	String f;
}
class MyA {
	String f;
}

class List{
	Object[] elems;
	int count;
	List() {
		Object[] t = new Object[10];
		this.elems = t;
	}
}

import checkers.inference.qual.VarAnnot;
@VarAnnot(9)
class List{
	@VarAnnot(5)
	Object @VarAnnot(4) [] elems;

	@VarAnnot(6)
	int a;
	List() {
		@VarAnnot(14)
		Object[] t = new @VarAnnot(12) Object @VarAnnot(11) [((@VarAnnot(10) int) (10))];
		this.elems = t;
	}
}

@VarAnnot(20)
class MyA {
	@VarAnnot(17)
	String f;
}
import checkers.inference.qual.VarAnnot;
@VarAnnot(7)
class MyA {
	@VarAnnot(4)
	String f;
}

@VarAnnot(13)
class List{
	@VarAnnot(9)
	Object @VarAnnot(8) [] elems;
	@VarAnnot(10)
	int count;
	List() {
		Object[] t = new Object[10];
		this.elems = t;
	}
}

With MyA appear ahead, there is no VarAnnot generation in for t but the other case has.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions