Source:
<code>SelectOrExamineResponse internalOpen(int mode, long cachedUidValidity, long cachedHighestModSeq) throws MessagingException { if (isOpen() && this.mode == mode) { try { return SelectOrExamineResponse.newInstance(executeSimpleCommand(Commands.NOOP), this); } catch (IOException ioe) { ioExceptionHandler(connection, ioe); } } store.releaseConnection(connection); synchronized (this) { connection = store.getConnection(); } try { msgSeqUidMap.clear(); String encodedFolderName = folderNameCodec.encode(getPrefixedName()); String escapedFolderName = ImapUtility.encodeString(encodedFolderName); SelectOrExamineCommand command; if (connection.isQresyncCapable() && K9MailLib.shouldUseQresync()) { connection.enableQresync(); command = SelectOrExamineCommand.createWithQresyncParameter(mode, escapedFolderName, cachedUidValidity, cachedHighestModSeq); } else if (connection.isCondstoreCapable() && K9MailLib.shouldUseCondstore()) { command = SelectOrExamineCommand.createWithCondstoreParameter(mode, escapedFolderName); } else { command = SelectOrExamineCommand.create(mode, escapedFolderName); } SelectOrExamineResponse response = SelectOrExamineResponse.newInstance( executeSimpleCommand(command.createCommandString()), this); this.mode = mode; if (response.hasOpenMode()) { this.mode = response.getOpenMode(); } <START> if (response == null) { <END> return null; } exists = true; uidValidity = response.getUidValidity(); highestModSeq = response.getHighestModSeq(); canCreateKeywords = response.canCreateKeywords(); return response; } catch (IOException ioe) { throw ioExceptionHandler(connection, ioe); } catch (MessagingException me) { Timber.e(me, "Unable to open connection for %s", getLogId()); throw me; } }</code><technical_language>This null check is pointless. Line 182 throw NPE here</technical_language>

Target:
SelectOrExamineResponse internalOpen(int mode, long cachedUidValidity, long cachedHighestModSeq) throws MessagingException { if (isOpen() && this.mode == mode) { try { return SelectOrExamineResponse.newInstance(executeSimpleCommand(Commands.NOOP), this); } catch (IOException ioe) { ioExceptionHandler(connection, ioe); } } store.releaseConnection(connection); synchronized (this) { connection = store.getConnection(); } try { msgSeqUidMap.clear(); String encodedFolderName = folderNameCodec.encode(getPrefixedName()); String escapedFolderName = ImapUtility.encodeString(encodedFolderName); SelectOrExamineCommand command; if (connection.isQresyncCapable() && ImapConfig.shouldUseQresync()) { connection.enableQresync(); command = SelectOrExamineCommand.createWithQresyncParameter(mode, escapedFolderName, cachedUidValidity, cachedHighestModSeq); } else if (connection.isCondstoreCapable() && ImapConfig.shouldUseCondstore()) { command = SelectOrExamineCommand.createWithCondstoreParameter(mode, escapedFolderName); } else { command = SelectOrExamineCommand.create(mode, escapedFolderName); } SelectOrExamineResponse response = SelectOrExamineResponse.newInstance( executeSimpleCommand(command.createCommandString()), this); if (response == null) { return null; } this.mode = mode; if (response.hasOpenMode()) { this.mode = response.getOpenMode(); } exists = true; uidValidity = response.getUidValidity(); highestModSeq = response.getHighestModSeq(); canCreateKeywords = response.canCreateKeywords(); return response; } catch (IOException ioe) { throw ioExceptionHandler(connection, ioe); } catch (MessagingException me) { Timber.e(me, "Unable to open connection for %s", getLogId()); throw me; } }