Details
Description
Found by Sonarqube: https://sonarcloud.io/project/issues?resolved=false&rules=java%3AS2159&id=org.xwiki.platform%3Axwiki-platform&open=AW5-S7MI1Yj5qvzeRn5i
private boolean isPrivateProperty(BaseProperty<?> property) { BaseCollection<?> object = property == null ? null : property.getObject(); if (object != null) { BaseClass xclass = object.getXClass(this.xcontextProvider.get()); if (xclass != null) { PropertyClass propertyClass = (PropertyClass) xclass.get(property.getName()); String propertyType = propertyClass == null ? null : propertyClass.getClassType(); return "Password".equals(propertyType) || "Email".equals(propertyClass); } } return false; }
Should probably be "Email".equals(propertyType);
Important: when fixing, please add a unit test.
This line is executed 315 times by the unit/integration tests but there's no specific test to verify the type and that it's hidden for emails.
Attachments
Issue Links
- is caused by
-
XWIKI-11506 Get a status of the documents of an extension from Extension Manager
- Closed