{"record":{"id":"8ad0fbb6e7d00fd2","repo":"hibernate/hibernate-orm","slug":"null-keys","errorCode":null,"errorMessage":"Null keys","messagePattern":"Null keys","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/internal/find/AbstractFindMultipleByKeyOperation.java","lineNumber":173,"sourceCode":"\t\t\t\t\tthis.enabledFetchProfile( enabledFetchProfile.profileName() );\n\t\t\t\t}\n\t\t\t\telse if ( option instanceof NaturalIdSynchronization naturalIdSynchronization ) {\n\t\t\t\t\tthis.naturalIdSynchronization = naturalIdSynchronization;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void enabledFetchProfile(String profileName) {\n\t\tif ( enabledFetchProfiles == null ) {\n\t\t\tenabledFetchProfiles = new HashSet<>();\n\t\t}\n\t\tenabledFetchProfiles.add( profileName );\n\t}\n\n\tprotected void checkKeys(List<?> keys) {\n\t\tif ( keys == null ) {\n\t\t\tthrow new IllegalArgumentException( \"Null keys\" );\n\t\t}\n\t\tfor ( Object key : keys ) {\n\t\t\tif ( key == null ) {\n\t\t\t\tthrow new IllegalArgumentException( \"Null key\" );\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected void checkFindRequirements(List<?> keys, SharedSessionContractImplementor session) {\n\t\tcheckKeys( keys );\n\t\tcheckTransactionNeededForLock( session, getLockMode() );\n\t}\n\n\tpublic List<T> performFind(\n\t\t\tList<?> keys,\n\t\t\t@Nullable GraphSemantic graphSemantic,\n\t\t\t@Nullable RootGraphImplementor<T> rootGraph) {\n\t\tfinal var session = getSession();","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/internal/find/AbstractFindMultipleByKeyOperation.java#L155-L191","documentation":"Error \"Null keys\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/internal/find/AbstractFindMultipleByKeyOperation.java:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Filter out null keys before calling findMultiple; validate the key collection first."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}