UnitTestBot / UnitTestBot/usvm
Incorrect setting collection field to null leads to further problems with iterator
Open
@Saloed is already working on this.
Since Nov 16, 2023.
bug
- Dominant language
- Kotlin
- Stars
- 33
- Forks
- 27
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 15
Description
Generate tests in the following configuration:
timeLimit=60
methodFilter = "org.usvm.samples.arrays.ArrayStoreExceptionExamples.*"
projectFilter = listOf("samples")
An failing test:
@Test
public void testFillWithTreeSet1() throws Exception {
ArrayStoreExceptionExamples arrayStoreExceptionExamples = new ArrayStoreExceptionExamples();
TreeSet treeSet = ((TreeSet) createInstance("java.util.TreeSet"));
setField(treeSet, "java.util.TreeSet", "m", null);
java.lang.Object[] actual = arrayStoreExceptionExamples.fillWithTreeSet(treeSet);
java.lang.Object[] expected = new java.lang.Object[1];
TreeSet treeSet1 = ((TreeSet) createInstance("java.util.TreeSet"));
Object present = createInstance("java.lang.Object");
setField(treeSet1, "java.util.TreeSet", "PRESENT", present);
setField(treeSet1, "java.util.TreeSet", "serialVersionUID", -2479143000061671589L);
setField(treeSet1, "java.util.AbstractCollection", "MAX_ARRAY_SIZE", 2147483639);
expected[0] = ((Object) treeSet1);
int expectedSize = expected.length;
assertEquals(expectedSize, actual.length);
assertTrue(deepEquals(expected, actual));
}
Let's pay attention to the line: setField(treeSet, "java.util.TreeSet", "m", null);
During the deepEquals method call, NullPointerException occurs.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.