Jaechang Nam created AIRAVATA-2288:
--------------------------------------
Summary: Incorrect `if' condition that can return a wrong object.
Key: AIRAVATA-2288
URL: https://issues.apache.org/jira/browse/AIRAVATA-2288
Project: Airavata
Issue Type: Bug
Reporter: Jaechang Nam
Priority: Minor
In current code snapshot (690b5297708fdae3cba8d2d09b19977dd53313f7 as of
today), it seems there is an incorrect condition in if statement.
' "".equals(username) will always return null as username is always null in
this if statement.
{code}
95 public ResultSet getWorkflowsOfUser(String username) throws
WorkflowMonitoringException {
96
97 // do a bit of validation here
98 if (username != null || "".equals(username)) {
99 return null;
100 }
101
102 try {
103
104 String sqlString =
getSQLForWorkflowInformationRetrieval(username);
105
106 System.out.println("sqlString = " + sqlString);
{code}
If getWorkflowsOfUser retuns null when username is null or "", the fix could be:
{code}
if (username == null || "".equals(username)) {
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)