'if' with a boolean that does not act according to the [closed] documentation

1

I am working against an Active Directory and the server response is a boolean. And always, always, enter the "true" part of the if.

I have done debug returns false the validation against the Active Directory has gone well or badly.

Since the result is false, should not I go to the else?

The part of my code:

if(callLDAP(internalVO));//este metodo devuelve un boolean
    System.out.println("Entra en el true");
}else{
    System.out.println("Entra en el false");
}

The code of callLDAP is basically this:

private static boolean callLDAP(InternalDoLoginVO internalVO){
    boolean status = false;
    String LDAPServer = "servidor";
    String LDAPPort = "puerto";
    String LDAPDomain = "dominio";
    String LDAPUser = internalVO.getUser();
    String LDAPassword = internalVO.getPass();

    LDAPServer LDAP = new LDAPServer(LDAPServer, LDAPPort, LDAPDomain); 
    LDAP.setCredentials(LDAPUser, LDAPassword);
    status = LDAP.doLogin();//haciendo debug esta variable es false
    return status;
}
    
asked by rencinas 13.09.2018 в 13:22
source

1 answer

8

You lack a key in the if. You have a semicolon instead.

if(callLDAP(internalVO)){//este metodo devuelve un boolean
    System.out.println("Entra en el true");
}else{
    System.out.println("Entra en el false");
}
    
answered by 13.09.2018 / 13:23
source