title: User object cannot be resolved to a variable
body: <p>Am novice. Just wrote down a function for login that returns User object but am getting error in last line return oUser as "oUser cannot be resolved to a variable". Can someone please help me in it.I am using User as the return type for sLoginContractTest function.</p>
  
  <pre><code>    public User sLoginContractTest(String sUserName, String sPassword, String sDomain,
              String sBusUnitID) throws Exception {
  
              String[] sInfo = new String[2];
  
  
              Gson gson = new GsonBuilder().create();
  
              // Create your http client
              CloseableHttpClient httpclient = HttpClientBuilder.create().build();
  
              // Create http post object
              // HttpPost postRequest = new HttpPost(sUrl);
              HttpPut putRequest = new HttpPut(this.sAuthUrl);
  
          // Message Body
              StringEntity input = new StringEntity("{\"userId\":\"" + sUserName
                  + "\",\"password\":\"" + sPassword + "\",\"businessUnitId\":\""
                  + sBusUnitID + "\",\"domainName\":\"" + sDomain + "\"}");
  
          // Set content type for post
          input.setContentType("application/json");
  
          // attach message body to request
          putRequest.setEntity(input);
  
          // submit request and save response
          HttpResponse response = httpclient.execute(putRequest);
  
          // get status code from response
          int sStatusCode = response.getStatusLine().getStatusCode();
  
          // Check if status code returned is 200 (success) or other (failure)
          if (sStatusCode != 200) {
              ReportResults("FAIL", "Login Failed due to " + response.toString(),
                      false);
              Assert.fail(response.getStatusLine().getReasonPhrase());
  
              sInfo = null;
          }   
          // Expected response
          else if (sStatusCode == 200) {  
               System.out.println(response.toString());
               ReportResults("PASS", "Logged in Successfully.", false);
  
               // Get response body (entity and parse to string
               String sEntity = EntityUtils.toString(response.getEntity());
               User oUser = gson.fromJson(sEntity, User.class);
  
               // Get securityID and token
               sInfo[0] = this.getJsonResponseValue(sEntity, "securityId");
               sInfo[1] = this.getJsonResponseValue(sEntity, "token");
  
               //Check to see if Contract is valid
  
               try{
  
                   if(oUser!=null){
                       return oUser;
                   }
                   else{
                       return null;
                   }
               }
                   catch(Exception e){
                  //If exception, contract failed (might want to check for specific exception here)
                    ReportResults("FAIL", "Login user contract failed because: " + e.getMessage(),false);
                   } 
                   this.setUserID(sUserName);
                      this.sAuthToken = sInfo;
                      System.out.println("the security id is" + this.sAuthToken[0]);
                      System.out.println("the token id is " + this.sAuthToken[1]);
  
  
                  }
  
              return oUser;   
  
  }
  </code></pre>