Author: sdumitriu
Date: 2008-02-08 17:34:09 +0100 (Fri, 08 Feb 2008)
New Revision: 7403
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/User.java
Log:
XWIKI-2088: Add a method to retrieve the e-mail address of a user
Documentation improvements
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/User.java
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/User.java
2008-02-08 16:32:31 UTC (rev 7402)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/User.java
2008-02-08 16:34:09 UTC (rev 7403)
@@ -112,6 +112,9 @@
*
* @return The e-mail address from the user profile, or <tt>null</tt> if
there is an error
* retrieving the email.
+ * @since 1.1.3
+ * @since 1.2.2
+ * @since 1.3M2
*/
public String getEmail()
{
@@ -121,6 +124,9 @@
BaseObject obj = userDoc.getObject("XWiki.XWikiUsers");
return obj.getStringValue("email");
} catch (Exception e) {
+ // APIs should never throw errors, as velocity cannot catch them,
and scripts should be
+ // as robust as possible. Instead, the code using this should know
that null means there
+ // was an error, if it really needs to report these exceptions.
return null;
}
}
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications