package org.camsrobotics.frc2016.auto;

import org.camsrobotics.frc2016.auto.modes.*;

/**
 * Autonomous mode magic
 * 
 * @author Wesley
 *
 */
public class AutoExecutor {
	private AutoMode m_auto;
	private Thread m_thread = null;
	
	/**
	 * Autonomous Modes
	 * 
	 * @author Wesley
	 *
	 */
	public enum Mode	{
		DO_NOTHING
	}
	
	/**
	 * Default Constructor
	 * 
	 * @param mode
	 */
	public AutoExecutor(Mode mode)	{
		switch(mode)	{
		case DO_NOTHING:
			m_auto = new DoNothingAuto();
			break;
		default:
			m_auto = new DoNothingAuto();
			break;
		}
	}
	
	/**
	 * Let's go!
	 */
	public void start()	{
		if(m_thread == null)	{
			m_thread = new Thread(new Runnable() {
				@Override
				public void run() {
					m_auto.run();
				}
			});
			
			m_thread.start();
		}
	}
	
	/**
	 * Stops the Autonomous mode
	 */
	@SuppressWarnings("deprecation")
	public void stop()	{
		if(m_thread != null)	{
			m_thread.stop();
		}
	}
}

@@ -876,43 +876,8 @@
 */%0D%0A
-%09@SuppressWarnings(%22deprecation%22)%0D%0A
 %09pub
@@ -902,22 +902,20 @@
 %0A%09%09if(m_
-thread
+auto
  != null
@@ -924,22 +924,20 @@
 %7B%0D%0A%09%09%09m_
-thread
+auto
 .stop();
@@ -939,19 +939,39 @@
 op();%0D%0A%09%09%7D%0D%0A
+%09%09m_thread = null;%0D%0A
 %09%7D%0D%0A%7D%0D%0A

Fix auto stopping method