title: Comparing HttpStatus.SC_OK and INT variable
body: <p>I made a method to check whether an http server is responding ok.
  I'm using apache components.</p>
  
  <pre><code>private static int CheckAvailabilityHttp(String pHostName, int pPort)
  {
      try {
          HttpClient httpClient = new DefaultHttpClient();
          HttpGet httpGet = new HttpGet(String.format("http://%s:%s",pHostName,pPort));
          HttpResponse response = httpClient.execute(httpGet);
          int status = response.getStatusLine().getStatusCode();
          if (HttpStatus.SC_OK == status) { // HttpStatus.SC_OK is 200 and status is 200
              return ServerStatuses.SUCCESS;
          }   
      } catch (MalformedURLException e1) {
          e1.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
  
      return ServerStatuses.FAILED;
  }
  </code></pre>
  
  <p>The problem is on the comparison line:</p>
  
  <pre><code>if (HttpStatus.SC_OK == status)
  </code></pre>
  
  <p>Even though BOTH (HttpStatus.SC_OK and status variable) are 200, it doesn´t get inside the condition... It doesn't even throw an exception.</p>
  
  <p>What I am doing wrong??</p>
  
  <p>Thank you for your time!</p>