user name containing underscore breaks the UsersActivityStatsService
--------------------------------------------------------------------
Key: JBPORTAL-2470
URL:
https://jira.jboss.org/jira/browse/JBPORTAL-2470
Project: JBoss Portal
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Gary Hu
If a user name contains underscore, for example "john_dow", it breaks the
UsersActivityStatsService MBean sevice.
This is the code from UsersActivityStatsServiceImpl:
public void registerActivity(final UserActivity userActivity)
{
try
{
Notification notification = new
Notification(Integer.toString(userActivity.getType()), this.getServiceName(),
userActivity.getTimestamp(), userActivity.getTimestamp(),
userActivity.getId() + "_"
+ userActivity.getSessionId());
....
And here is the code from UserActivity:
public UserActivity(Notification notification)
{
if (notification.getMessage() == null)
{
throw new IllegalArgumentException("Id (notification message) cannot be
null");
}
this.id = notification.getMessage().substring(0,
notification.getMessage().indexOf("_"));
this.sessionId =
notification.getMessage().substring(notification.getMessage().indexOf("_"));
this.timestamp = notification.getTimeStamp();
this.type = Integer.parseInt(notification.getType());
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira