Commit cc425a93 authored by manohar's avatar manohar

along with null checking trim().length() also checked for determining the...

along with null checking  trim().length() also checked for determining the operation insert,update or delete


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92941 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3ed2a8d0
......@@ -913,15 +913,25 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
pstmt.close();
pstmt = null;
//foundRights = (String) userRightsMap.get(searchKey);
System.out.println("Found rights in function ["+foundRights+"] rights [" + rights +"] alreadyExists [" + alreadyExists + "]");
if(foundRights == null && rights != null && "N".equals(alreadyExists))
System.out.println("Found rights in function before ["+foundRights+"] rights [" + rights +"] alreadyExists [" + alreadyExists + "]");
if (foundRights != null && foundRights.trim().length() == 0)
{
foundRights = null;
}
if (rights != null && rights.trim().length() == 0)
{
rights = null;
}
System.out.println("Found rights in function after ["+foundRights+"] rights [" + rights +"] alreadyExists [" + alreadyExists + "]");
if( (foundRights == null || foundRights.trim().length() == 0) && (rights != null && rights.trim().length() > 0 ) && "N".equals(alreadyExists))
operation = 1;
else if((foundRights != null && rights != null) || ("Y".equals(alreadyExists) && foundRights == null && rights != null) )
else if(( (foundRights != null && foundRights.trim().length() > 0 ) && (rights != null && rights.trim().length() > 0 ) ) || ("Y".equals(alreadyExists) && (foundRights == null || foundRights.trim().length() == 0 ) && (rights != null && rights.trim().length() > 0 ) ) )
operation = 2;
else if(foundRights != null && rights == null && "Y".equals(alreadyExists))
else if((foundRights != null && foundRights.trim().length() > 0 ) && (rights == null || rights.trim().length() == 0) && "Y".equals(alreadyExists))
operation = 3;
System.out.println("Found rights in function operation [" + operation + "] foundRights ["+foundRights+"] rights [" + rights +"] alreadyExists [" + alreadyExists + "]");
}
catch (Exception e)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment