From 893c8f222e9808b6b794e162147941b7445aba9b Mon Sep 17 00:00:00 2001 From: Javinator9889 Date: Tue, 20 Nov 2018 16:58:59 +0100 Subject: [PATCH] Fixed indentation --- examples/4-CombiningThreadsAndPooling.md | 76 ++++++++++++------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/examples/4-CombiningThreadsAndPooling.md b/examples/4-CombiningThreadsAndPooling.md index 0898b2f..7668632 100644 --- a/examples/4-CombiningThreadsAndPooling.md +++ b/examples/4-CombiningThreadsAndPooling.md @@ -82,45 +82,45 @@ public class CombiningClass implements OnThreadCompletedListener { mThreadsPooling.start(); } - @Override - public void onThreadCompletedListener(@NotNull Thread thread, @Nullable Throwable exception) { - // First, we will handle the exception - if (exception != null) { - System.err.println("Exception thrown by thread: " + thread.getName()); - exception.printStackTrace(); - } - // Handle finished threads - switch (thread.getName()) { - case FIRST_DIVIDE: - // First division thread has finished its execution - System.out.println("First division finished"); - break; - case SECON_DIVIDE: - // Second divide thread has finished its execution - System.out.println("Second division finished"); - break; - case HEAVY_OPERATIONS: - // Math calculations thread has finished its execution - // We can safely print the result - System.out.println("Heavy operations finished"); - System.out.println("Operations result: " + mHeavyOperationResult.get()); - break; - case PRIME_FACTORS: - // Prime factors thread has finished its execution - // We can safely print the result - System.out.println("Prime factors finished"); - System.out.println("Prime factors:"); - List result = mPrimeFactorsResult.get(); - // First element is a descriptor (in this case) - String firstItem = result.remove(0); - // Print prime factors - System.out.println(firstItem + " | Factors: " + Arrays.toString(result.toArray())); - break; - default: - System.err.println("Non contemplated case"); - break; - } + @Override + public void onThreadCompletedListener(@NotNull Thread thread, @Nullable Throwable exception) { + // First, we will handle the exception + if (exception != null) { + System.err.println("Exception thrown by thread: " + thread.getName()); + exception.printStackTrace(); } + // Handle finished threads + switch (thread.getName()) { + case FIRST_DIVIDE: + // First division thread has finished its execution + System.out.println("First division finished"); + break; + case SECON_DIVIDE: + // Second divide thread has finished its execution + System.out.println("Second division finished"); + break; + case HEAVY_OPERATIONS: + // Math calculations thread has finished its execution + // We can safely print the result + System.out.println("Heavy operations finished"); + System.out.println("Operations result: " + mHeavyOperationResult.get()); + break; + case PRIME_FACTORS: + // Prime factors thread has finished its execution + // We can safely print the result + System.out.println("Prime factors finished"); + System.out.println("Prime factors:"); + List result = mPrimeFactorsResult.get(); + // First element is a descriptor (in this case) + String firstItem = result.remove(0); + // Print prime factors + System.out.println(firstItem + " | Factors: " + Arrays.toString(result.toArray())); + break; + default: + System.err.println("Non contemplated case"); + break; + } + } // An example class that takes too much time to finish its working public class HeavyLoadClass {