/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.util;

import java.util.concurrent.ThreadFactory;

/**
 *A thread that has called {@link Thread#setDaemon(boolean) } with true.
 */
public class Daemon extends Thread {

  {
    setDaemon(true);
  }

  /**
   * Provide a factory for named daemon threads,
   * for use in ExecutorServices constructors.
   */
  public static class DaemonFactory extends Daemon implements ThreadFactory {

    @Override
    public Thread newThread(Runnable runnable) {
      return new Daemon(runnable);
    }
  }

  Runnable mRunnable = null;

  /**
   * Construct a daemon thread.
   */
  public Daemon() {
    super();
  }

  /** Construct a daemon thread.
   * @param mRunnable given a Runnable object
   */
  public Daemon(Runnable mRunnable) {
    super(mRunnable);
    mRunnable = mRunnable;
    setName(((Object) mRunnable).toString());
  }

  /** Construct a daemon thread to be part of a specified thread group.
   * @param group thread group
   * @param mRunnable an Runnable object
   */
  public Daemon(ThreadGroup group, Runnable mRunnable) {
    super(group, mRunnable);
    mRunnable = mRunnable;
    setName(((Object) mRunnable).toString());
  }

  /**
   * @return mRunnable
   */
  public Runnable getRunnable() {
    return mRunnable;
  }
}


@@ -1168,34 +1168,33 @@
 ad.%0A   * @param 
-mR
+r
 unnable given a 
@@ -1232,34 +1232,33 @@
 Daemon(Runnable 
-mR
+r
 unnable) %7B%0A    s
@@ -1262,18 +1262,17 @@
   super(
-mR
+r
 unnable)
@@ -1281,34 +1281,33 @@
     mRunnable = 
-mR
+r
 unnable;%0A    set
@@ -1465,18 +1465,17 @@
  @param 
-mR
+r
 unnable 
@@ -1539,26 +1539,25 @@
 p, Runnable 
-mR
+r
 unnable) %7B%0A 
@@ -1572,18 +1572,17 @@
 (group, 
-mR
+r
 unnable)
@@ -1599,18 +1599,17 @@
 nable = 
-mR
+r
 unnable;
@@ -1623,34 +1623,33 @@
 tName(((Object) 
-mR
+r
 unnable).toStrin

change code style