{"record":{"id":"0075018c6ce74aa5","repo":"permissions-dispatcher/PermissionsDispatcher","slug":"annotated-class-rpe-inputclassname-doesn-t-ha","errorCode":null,"errorMessage":"Annotated class '${rpe.inputClassName}' doesn't have any method annotated with '@${type.simpleName}'","messagePattern":"Annotated class '(.+?)' doesn't have any method annotated with '@(.+?)'","errorType":"validation","errorClass":"NoAnnotatedMethodsException","httpStatus":null,"severity":"error","filePath":"processor/src/main/kotlin/permissions/dispatcher/processor/util/Validators.kt","lineNumber":55,"sourceCode":"    val allItems: HashSet<List<String>> = hashSetOf()\n    items.forEach {\n        val permissionValue = it.getAnnotation(annotationClass).permissionValue().sorted()\n        if (allItems.contains(permissionValue)) {\n            throw DuplicatedValueException(permissionValue, it, annotationClass)\n        } else {\n            allItems.add(permissionValue)\n        }\n    }\n}\n\n/**\n * Checks the elements in the provided list for elements.\n * <p>\n * Raises an exception if it doesn't contain any elements.\n */\nfun <A : Annotation> checkNotEmpty(items: List<ExecutableElement>, rpe: RuntimePermissionsElement, annotationClass: Class<A>) {\n    if (items.isEmpty()) {\n        throw NoAnnotatedMethodsException(rpe, annotationClass)\n    }\n}\n\n/**\n * Checks the elements in the provided list annotated with an annotation\n * against private modifiers.\n * <p>\n * Raises an exception if any element contains the \"private\" modifier.\n */\nfun <A : Annotation> checkPrivateMethods(items: List<ExecutableElement>, annotationClass: Class<A>) {\n    items.forEach {\n        if (it.modifiers.contains(Modifier.PRIVATE)) {\n            throw PrivateMethodException(it, annotationClass)\n        }\n    }\n}\n\n/**","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/permissions-dispatcher/PermissionsDispatcher/blob/74b532bf1fe430fb12ad8414b80399f2d7cfc954/processor/src/main/kotlin/permissions/dispatcher/processor/util/Validators.kt#L37-L73","documentation":"Thrown by checkNotEmpty in Validators.kt:55. A class annotated with @RuntimePermissions must contain at least one method annotated with the given annotation (e.g. @NeedsPermission). If the list of annotated methods is empty, NoAnnotatedMethodsException is thrown because there is nothing useful to generate.","triggerScenarios":"@RuntimePermissions on a class whose body has no @NeedsPermission methods; deleting or renaming the only annotated method; annotating methods in a different class than the one carrying @RuntimePermissions.","commonSituations":"Removing the last @NeedsPermission method during refactoring while leaving the class-level annotation; moving permission methods into a base class or helper; typo in the method annotation so the processor does not see it.","solutions":["Add at least one method annotated with @NeedsPermission to the annotated class.","Remove the @RuntimePermissions annotation if no permission methods are needed.","Ensure the annotated methods live in the same class as @RuntimePermissions and use the correct annotation import."],"exampleFix":"// before\n@RuntimePermissions\nclass MyActivity : AppCompatActivity() { }\n\n// after\n@RuntimePermissions\nclass MyActivity : AppCompatActivity() {\n    @NeedsPermission(Manifest.permission.CAMERA)\n    fun showCamera() { }\n}","handlingStrategy":"validation","validationCode":"@RuntimePermissions\nclass MyActivity : AppCompatActivity() {\n    @NeedsPermission(Manifest.permission.CAMERA)\n    fun showCamera() { }\n}","typeGuard":null,"tryCatchPattern":"try {\n    compile()\n} catch (e: CompilationError) {\n    logger.error(\"Class annotated with @RuntimePermissions has no @NeedsPermission methods\", e)\n}","preventionTips":["Always pair @RuntimePermissions with at least one @NeedsPermission method.","Remove class-level annotation when the last permission method is deleted.","Keep permission methods in the same annotated class, not a base class."],"tags":["kotlin","annotation-processor","empty"],"backgroundTag":"empty-required-field","analyzedSha":"74b532bf1fe430fb12ad8414b80399f2d7cfc954","analyzedAt":"2026-09-08T21:44:58.380Z","contentChangedAt":"2026-09-08T21:44:58.380Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}