On Tue, Sep 14, 2010 at 13:21, Caleb James DeLisle <[email protected]> wrote:
I removed a method which was inaccessible to any code which might use it: protected BaseProperty getBaseProperty() and made final a field which is not altered anywhere. Assuming nobody has extended c.x.x.api.* these are not api breaks.
I would like to block clierr from breaking the build rather than merging out this change.
clirr plugin is configurable and configured in core-parent pom.xml file. Look at the end.
WDYT?
Caleb
cjdelisle (SVN) wrote:
Author: cjdelisle Date: 2010-09-14 12:03:32 +0200 (Tue, 14 Sep 2010) New Revision: 31093
Modified: platform/core/trunk/xwiki-core/pom.xml platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Element.java platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Property.java Log: [cleanup] Documented c.x.x.api.Property, removed an unnecessary override and an unusable method, and made an un-reassignable field final.
Modified: platform/core/trunk/xwiki-core/pom.xml =================================================================== --- platform/core/trunk/xwiki-core/pom.xml 2010-09-14 09:14:38 UTC (rev 31092) +++ platform/core/trunk/xwiki-core/pom.xml 2010-09-14 10:03:32 UTC (rev 31093) @@ -896,7 +896,6 @@ **/api/Document.java, **/api/DocumentSection.java, **/api/Object.java, - **/api/Property.java, **/api/Util.java, **/api/XWiki.java, **/atom/lifeblog/LifeblogServices.java,
Modified: platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Element.java =================================================================== --- platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Element.java 2010-09-14 09:14:38 UTC (rev 31092) +++ platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Element.java 2010-09-14 10:03:32 UTC (rev 31093) @@ -33,7 +33,7 @@ public class Element extends Api { /** The internal element which this wraps. */ - protected BaseElement element; + protected final BaseElement element;
/** * The Constructor.
Modified: platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Property.java =================================================================== --- platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Property.java 2010-09-14 09:14:38 UTC (rev 31092) +++ platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Property.java 2010-09-14 10:03:32 UTC (rev 31093) @@ -18,28 +18,33 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. * */ + package com.xpn.xwiki.api;
import com.xpn.xwiki.XWikiContext; import com.xpn.xwiki.objects.BaseProperty;
+/** + * Property is a single attribute of an XWiki {@link com.xpn.xwiki.api.Object}. + * + * @version $Id$ + */ public class Property extends Element { + /** + * The Constructor. + * + * @param property the internal {@link com.xpn.xwiki.objects.BaseProperty} to wrap. + * @param context the XWikiContext which may be used to get information about the current request. + */ public Property(BaseProperty property, XWikiContext context) { super(property, context); }
- protected BaseProperty getBaseProperty() - { - return (BaseProperty) element; - } - - public String getName() - { - return element.getName(); - } - + /** + * @return the internal {@link com.xpn.xwiki.objects.BaseProperty} which this Property wraps. + */ public BaseProperty getProperty() { if (hasProgrammingRights()) { @@ -49,8 +54,12 @@ } }
+ /** + * @return the actual value of the property, as a String, Number or List. + */ public java.lang.Object getValue() { + // This is evil, any property which happens to be called 'password' will be masked. TODO fix. if (element.getName().equals("password") && !getXWikiContext().getWiki().getRightService().hasProgrammingRights( getXWikiContext())) {
_______________________________________________ notifications mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/notifications
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne