### Question:
APutOp extends MethodStateOp { @Override public void execute(ExecutionNode node, MethodState mState) { HeapItem valueItem = mState.readRegister(valueRegister); HeapItem arrayItem = mState.readRegister(arrayRegister); HeapItem indexItem = mState.readRegister(indexRegister); boolean throwsStoreException = throwsArrayStoreException(arrayItem, valueItem, classManager); if (throwsStoreException) { String storeType = ClassNameUtils.internalToBinary(valueItem.getType()); Throwable exception = exceptionFactory.build(this, ArrayStoreException.class, storeType); node.setException(exception); node.clearChildren(); return; } if (arrayItem.isUnknown()) { } else { if (valueItem.isUnknown() || indexItem.isUnknown()) { String type = arrayItem.getType(); arrayItem = HeapItem.newUnknown(type); } else { Object array = arrayItem.getValue(); if (null == array) { Throwable exception = exceptionFactory.build(this, NullPointerException.class); node.setException(exception); node.clearChildren(); return; } int index = indexItem.asInteger(); if (index >= Array.getLength(array)) { Throwable exception = exceptionFactory.build(this, ArrayIndexOutOfBoundsException.class); node.setException(exception); node.clearChildren(); return; } else { Object value = castValue(getName(), valueItem.getValue()); Array.set(array, index, value); node.clearExceptions(); } } } mState.assignRegister(arrayRegister, arrayItem); } APutOp(MethodLocation location, MethodLocation child, int putRegister, int arrayRegister, int indexRegister,
           ClassManager classManager, ExceptionFactory exceptionFactory); @Override void execute(ExecutionNode node, MethodState mState); @Override String toString();  }### Answer:
@Test public void unknownValueItemMakesArrayUnknownAndDoesNotClearExceptions() { initial.setRegisters(0, new int[5], "[I", 1, 0, "I", 2, new UnknownValue(), "I"); ExecutionGraph graph = VMTester.execute(CLASS_NAME, "putWithCatch()V", initial); ExecutionNode putNode = graph.getNodePile(0).get(0); Set<Throwable> exceptions = putNode.getExceptions(); assertEquals(2, exceptions.size()); List<Class<?>> exceptionClasses = exceptions.stream().map(Throwable::getClass).collect(Collectors.toList()); assertTrue(exceptionClasses.contains(ArrayIndexOutOfBoundsException.class)); assertTrue(exceptionClasses.contains(NullPointerException.class)); HeapItem item = graph.getTerminatingRegisterConsensus(0); assertEquals(CommonTypes.OBJECT, item.getType()); assertEquals(UnknownValue.class, item.getValue().getClass()); }