Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] Rule : problem with ruleThenEnum assignMembershipDisabledDaysForOwnerGroupId

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] Rule : problem with ruleThenEnum assignMembershipDisabledDaysForOwnerGroupId


Chronological Thread 
  • From: Chris Hyzer <>
  • To: SIAD <>, "" <>
  • Subject: RE: [grouper-users] Rule : problem with ruleThenEnum assignMembershipDisabledDaysForOwnerGroupId
  • Date: Sun, 8 Sep 2013 20:59:10 +0000
  • Accept-language: en-US

Yes, that is how to fix it.  This is fixed in the 2.1 branch, and I searched for other instances of this issue to and fixed those too

 

https://bugs.internet2.edu/jira/browse/GRP-931

 

Thanks

Chris

 

 

From: [mailto:] On Behalf Of SIAD
Sent: Thursday, September 05, 2013 10:06 AM
To:
Subject: [grouper-users] Rule : problem with ruleThenEnum assignMembershipDisabledDaysForOwnerGroupId

 

Hello,

I use a rule to assign disabled date on a membership.

My configuration :

ruleActAsSubjectId

admin_grouper

ruleThenEnum

assignMembershipDisabledDaysForOwnerGroupId

ruleActAsSubjectSourceId

ldapAdmin

ruleThenEnumArg0

365

ruleCheckType

membershipAdd

ruleValid

T

ruleThenEnumArg1

F


But, when i try this, the disabled date is set to 22/09/2013 and not to 05/09/2014 (+365 days).

I think, the problem is located in RuleElUtils class in the method assignMembershipDisabledDaysForGroupId.

More specifically, this line : membership.setDisabledTime(new Timestamp(System.currentTimeMillis() + (daysInFuture * 24 * 60 * 60 * 1000)));
daysInFuture is an integer, so Java think that the result of  daysInFuture * 24 * 60 * 60 * 1000 will be an Integer too. But with daysInFuture = 365, the result is too large for an integer.

i think, the problem can be resolve if we add (long) just before daysInFuture :
membership.setDisabledTime(new Timestamp(System.currentTimeMillis() + ((long)daysInFuture * 24 * 60 * 60 * 1000)));

Am i correct ?
Thanks for your help :-)

Yoann.

--

Yoann Delattre

03 20 95 69 61

Équipe SIAD (Systèmes d'Information et Aide à la Décision)
DSI de l'académie de Lille (Direction des Systèmes d'Information)
110 avenue Gaston Berger - 59000 Lille

 




Archive powered by MHonArc 2.6.16.

Top of Page