Replace "if(" with "if ("

This commit is contained in:
agnostic-apollo
2021-04-12 20:19:04 +05:00
parent 6293f5f170
commit 3d46849673
17 changed files with 69 additions and 69 deletions

View File

@@ -32,9 +32,9 @@ public class ShellUtils {
// This function may be called by a different package like a plugin, so we get version for Termux package via its context
Context termuxPackageContext = TermuxUtils.getTermuxPackageContext(currentPackageContext);
if(termuxPackageContext != null) {
if (termuxPackageContext != null) {
String termuxVersionName = PackageUtils.getVersionNameForPackage(termuxPackageContext);
if(termuxVersionName != null)
if (termuxVersionName != null)
environment.add("TERMUX_VERSION=" + termuxVersionName);
}
@@ -145,7 +145,7 @@ public class ShellUtils {
}
public static String getExecutableBasename(String executable) {
if(executable == null) return null;
if (executable == null) return null;
int lastSlash = executable.lastIndexOf('/');
return (lastSlash == -1) ? executable : executable.substring(lastSlash + 1);
}
@@ -169,14 +169,14 @@ public class ShellUtils {
String transcriptText;
if(linesJoined)
if (linesJoined)
transcriptText = terminalBuffer.getTranscriptTextWithFullLinesJoined();
else
transcriptText = terminalBuffer.getTranscriptTextWithoutJoinedLines();
if (transcriptText == null) return null;
if(trim)
if (trim)
transcriptText = transcriptText.trim();
return transcriptText;

View File

@@ -178,7 +178,7 @@ public class StreamGobbler extends Thread {
String line;
while ((line = reader.readLine()) != null) {
if(currentLogLevel >= logLevelVerbose)
if (currentLogLevel >= logLevelVerbose)
Logger.logVerbose(LOG_TAG, String.format(Locale.ENGLISH, "[%s] %s", shell, line)); // This will get truncated by LOGGER_ENTRY_MAX_LEN, likely 4KB
if (stringWriter != null) stringWriter.append(line).append("\n");

View File

@@ -170,7 +170,7 @@ public class TermuxSession {
*/
public void killIfExecuting(@NonNull final Context context, boolean processResult) {
// If execution command has already finished executing, then no need to process results or send SIGKILL
if(mExecutionCommand.hasExecuted()) {
if (mExecutionCommand.hasExecuted()) {
Logger.logDebug(LOG_TAG, "Ignoring sending SIGKILL to \"" + mExecutionCommand.getCommandIdAndLabelLogString() + "\" TermuxSession since it has already finished executing");
return;
}

View File

@@ -149,7 +149,7 @@ public final class TermuxTask {
STDIN.close();
//STDIN.write("exit\n".getBytes(StandardCharsets.UTF_8));
//STDIN.flush();
} catch(IOException e){
} catch(IOException e) {
if (e.getMessage().contains("EPIPE") || e.getMessage().contains("Stream closed")) {
// Method most horrid to catch broken pipe, in which case we
// do nothing. The command is not a shell, the shell closed
@@ -218,7 +218,7 @@ public final class TermuxTask {
*/
public void killIfExecuting(@NonNull final Context context, boolean processResult) {
// If execution command has already finished executing, then no need to process results or send SIGKILL
if(mExecutionCommand.hasExecuted()) {
if (mExecutionCommand.hasExecuted()) {
Logger.logDebug(LOG_TAG, "Ignoring sending SIGKILL to \"" + mExecutionCommand.getCommandIdAndLabelLogString() + "\" TermuxTask since it has already finished executing");
return;
}