Description
I tried to create an index on a region with objects that could not be deserialized (it was a mistake in my code). I found that it actually allowed me to create the index, but my values were not actually indexed.
Looking at the code in PartitionedRegion.createIndexes, it has some interesting code to maintain a boolean flag that an exception should be thrown. However, it keeps losing the value of the flag. Here's some of the code:
boolean throwException = false; ... throwException = createEmptyIndexes(indexDefinitions, remotelyOriginated, indexes, exceptionsMap); ... //This overwrites the value of throwException if (unpopulatedIndexes != null && unpopulatedIndexes.size() > 0) { throwException = populateEmptyIndexes(unpopulatedIndexes, exceptionsMap); } //Same thing here throwException = sendCreateIndexesMessage(remotelyOriginated, indexDefinitions, indexes, exceptionsMap);
This method should always throw an exception if the index creation failed.