{"record":{"id":"4039aa3d4bebf2c6","repo":"theonedev/onedev","slug":"getter-not-found-for-property-name","errorCode":null,"errorMessage":"Getter not found for property: ${name}","messagePattern":"Getter not found for property: (.+?)","errorType":"validation","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java","lineNumber":1379,"sourceCode":"\t\t\t\t} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n\t\t\t\t\tthrow new ExplicitException(\"Error invoking getter for property: \" + dependsOn.property(), e);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar showCondition = getter.getAnnotation(ShowCondition.class);\n\t\t\tif (showCondition != null) {\n\t\t\t\tEditContext.push(new EditContext() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic Object getInputValue(String name) {\n\t\t\t\t\t\tvar getter =  BeanUtils.findGetter(bean.getClass(), name);\n\t\t\t\t\t\tif (getter == null) {\n\t\t\t\t\t\t\tfor (var eachGetter: BeanUtils.findGetters(bean.getClass())) {\n\t\t\t\t\t\t\t\tif (EditableUtils.getDisplayName(eachGetter).equals(name)) {\n\t\t\t\t\t\t\t\t\tgetter = eachGetter;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (getter == null) \n\t\t\t\t\t\t\t\tthrow new ExplicitException(\"Getter not found for property: \" + name);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn getter.invoke(bean);\n\t\t\t\t\t\t} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n\t\t\t\t\t\t\tthrow new ExplicitException(\"Error invoking getter for property: \" + name, e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\ttry {\n\t\t\t\t\tif (!(boolean)ReflectionUtils.invokeStaticMethod(bean.getClass(), showCondition.value()))\n\t\t\t\t\t\treturn false;\n\t\t\t\t} finally {\n\t\t\t\t\tEditContext.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// check if this validation context is qualified to validate the current meta constraint.","sourceCodeStart":1361,"sourceCodeEnd":1397,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/hibernate/validator/internal/engine/ValidatorImpl.java#L1361-L1397","documentation":"OneDev's patched Hibernate Validator resolves property values reflectively when evaluating a ShowCondition. It first looks up a getter by property name, then falls back to matching getters by their editable display name. If neither lookup succeeds, it throws this ExplicitException because the referenced property cannot be resolved on the bean class.","triggerScenarios":"The name passed to EditContext.getInputValue (referenced from a @ShowCondition-annotated property) matches no getter on the bean class, and no getter's EditableUtils display name equals it — typically a typo or a renamed/removed property in the referenced property list of a ShowCondition.","commonSituations":"Renaming a bean property without updating the property name referenced in @ShowCondition; using a field with no standard getX()/isX() getter; referencing a property by its label when the label text differs in case or whitespace from the display name.","solutions":["Check the property name referenced in the @ShowCondition property list and correct it to an existing getter name on the bean class.","Add or fix the getter (getX()/isX()) for the referenced property on the bean.","If matching by display name, ensure the @Editable display name exactly equals the referenced name.","Rebuild the module so the edited bean class is hot-reloaded by the dev server."],"exampleFix":"// before\n@ShowCondition(property=\"enableTlsEnabled\")\n// after\n@ShowCondition(property=\"enableTls\")  // matches existing getter isEnableTls()","handlingStrategy":"validation","validationCode":"// Before building the bean/form, verify every @ShowCondition-referenced name has a getter:\nfor (Method m : beanClass.getDeclaredMethods()) {\n    ShowCondition sc = m.getAnnotation(ShowCondition.class);\n    if (sc != null)\n        for (String name : sc.property())\n            if (BeanUtils.findGetter(beanClass, name) == null)\n                throw new IllegalStateException(\"ShowCondition references unknown property: \" + name);\n}","typeGuard":"boolean hasGetter(Class<?> cls, String name) { return BeanUtils.findGetter(cls, name) != null; }","tryCatchPattern":null,"preventionTips":["Keep @ShowCondition property lists in sync whenever renaming fields","Always back editable properties with standard getX()/isX() getters","Write a unit test reflecting over form beans to verify ShowCondition references"],"tags":["reflection","bean-validation","missing-property"],"backgroundTag":"resource-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}