Skip to content

NPE when projecting to an interface using String-based Aggregation Repository Query Methods #4839

Closed
@fdutton

Description

@fdutton
  1. AbstractMongoQuery.execute() calls ReturnedInterface.getTypeToRead()
  2. ReturnedInterface.getTypeToRead() returns null when the query's result is a closed projection
  3. AbstractMongoQuery.execute() calls StringBasedAggregation.execute()
  4. StringBasedAggregation.execute() calls StringBasedAggregation.isSimpleReturnType() and passes null as the targetType
  5. StringBasedAggregation.isSimpleReturnType() calls MongoSimpleTypes.HOLDER.isSimpleType()
  6. MongoSimpleTypes.HOLDER.isSimpleType() raises a NullPointerException by attempting to invoke type.isEnum() when type is null

This does not happen when projecting to a class.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions