title: Java For loop with && condition with length and length reaching the max , FAILS. Its not shot circuit as reversal of condition in && makes it work
body: <p>I have a for loop condition in my code as below:</p>
  
  <pre><code>for(int i=0; contactInfoRecordArray[i].get_170_Cntct_Sqn() != 0 &amp;&amp; 
               i&lt;contactInfoRecordArray.length ; i++){
      insuranceObjectKey = new Integer(contactInfoRecordArray[i].get_170_Cntct_Insobj_Sqn());
          if(insuranceObjectMap.containsKey(insuranceObjectKey) &amp;&amp; insuranceObjectMap.get(insuranceObjectKey) != null) {
              serviceUseMap = (HashMap)(insuranceObjectMap.get(insuranceObjectKey));
          } else {
              serviceUseMap = new HashMap();
              insuranceObjectMap.put(insuranceObjectKey, serviceUseMap);
          }
          //second level (Service eg. Wildfire)
          serviceUseKey = new Integer(contactInfoRecordArray[i].get_170_Cntct_Srvcuse_Sqn());
          if(serviceUseMap.containsKey(serviceUseKey) &amp;&amp; serviceUseMap.get(serviceUseKey) != null) {
              contactMap = (HashMap)serviceUseMap.get(serviceUseKey);
          } else {
              contactMap = new HashMap();
              serviceUseMap.put(serviceUseKey, contactMap);
          }
  
          //third level (ContactAssignmentType)
          contactKey = new Integer(contactInfoRecordArray[i].get_170_Cntct_Sqn());
          if(contactMap.containsKey(contactKey) &amp;&amp; contactMap.get(contactKey) != null) {
              contactAssignment = (ContactAssignmentType)contactMap.get(contactKey);
          } else {
              contactAssignment = ContactAssignmentType.Factory.newInstance();
              contactAssignment.setPriority(contactInfoRecordArray[i].get_170_Cntct_Prty_Seq_N());
  
              contactAssignment.setRole(ServiceEligibilityReferenceDataUtility.getInstance().getContactAssignmentType_Role(contactInfoRecordArray[i].get_170_Cntct_Role_C()));
              ContactType contact = contactAssignment.addNewContact();
              contact.setName(contactInfoRecordArray[i].get_170_Cntct_Na());
              contactMap.put(contactKey, contactAssignment);
          }
  
          //fourth level (Communication Info)
          if(contactAssignment.getContact().getCommunicationAggregate() != null) {
              communicationAggr = contactAssignment.getContact().getCommunicationAggregate();
          } else {
              communicationAggr = contactAssignment.getContact().addNewCommunicationAggregate();
          }
  
          CommunicationType communication = communicationAggr.addNewCommunication();
          communication.setPriority(contactInfoRecordArray[i].get_170_Commu_Prty_Seq_N());
          communication.setValue(contactInfoRecordArray[i].get_170_Commu_Dvc_V());
          communication.setUsage(ServiceEligibilityReferenceDataUtility.getInstance().getCommunicationType_Usage(
                  contactInfoRecordArray[i].get_170_Commu_Dvc_Loc_Na().trim()));
  
          communication.setType(
                  ServiceEligibilityReferenceDataUtility.getInstance().getCommunicationType_Type(
                          contactInfoRecordArray[i].get_170_Commu_Dvc_Na(), contactInfoRecordArray[i].get_170_Commu_Dvc_Mode_Na()));
  </code></pre>
  
  <p>}
  The contactInfoRecordArray.length = 100. Now when value of i reaches 100, I get an Array Out Of bound Exception.</p>
  
  <p>If I reverse the condition in &amp;&amp;, it just works fine - please see code below: </p>
  
  <pre><code>for(int i=0; i&lt;contactInfoRecordArray.length &amp;&amp; 
               contactInfoRecordArray[i].get_170_Cntct_Sqn() != 0 ; i++)
  </code></pre>
  
  <p>I'm not sure why it works. Any insight would be greatly appreciated.</p>