Teste de Variaveis tipo String

Olá estou criando um programa para efetuar testes em endereços de IP, como sou novato em JAVA

Surgiu uma dificuldade na execução de um teste simples.
Estou comparando uma variável com ela mesma e o sistema esta retornando falso.

Como isso é possível ? Será que alguém pode me ajudar ?

segue código

public String atualizaArq(String ip, String nomeArq) throws FileNotFoundException, IOException {
BufferedReader buffRead = new BufferedReader(new FileReader(nomeArq));
String thisLine;

    try {
        while ((thisLine = buffRead.readLine()) != null) {

//StringBuffer linhaArq = new StringBuffer();

            if (thisLine == ip) {
                System.out.println(thisLine + "Achei");
                break;
            }

// thisLine = buffRead.readLine();
}
} catch (Exception e) {
e.printStackTrace();
}

    String newIp = ip;
    return newIp;

A variável “thisLine” e “ip” são exatamente iguais então resolvi fazer debug na rotina e escrevi as seguintes comparações:

thisLine.substring(0,1) == thisLine.substring(0,1)
thisLine.substring(1,1) == thisLine.substring(1,1)
ip.substring(0,1) == ip.substring(0,1)
ip.substring(1,1) == ip.substring(1,1)

Por incrível que pareça o compilador esta retornado “false” em todos os testes.

Alguém sabe onde estou errando ?
Muito Obrigado

Para comparar Strings utilize equals, o == esta comparando dois objetos diferentes criados pela substring

thisLine.substring(0,1).equals(thisLine.substring(0,1))