/*
 * Copyright (c) 2019 Noah Andrews
 *
 *  Permission is hereby granted, free of charge, to any person
 *  obtaining a copy of this software and associated documentation
 *  files (the "Software"), to deal in the Software without
 *  restriction, including without limitation the rights to use,
 *  copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the
 *  Software is furnished to do so, subject to the following
 *  conditions:
 *
 *  The above copyright notice and this permission notice shall be
 *  included in all copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *  OTHER DEALINGS IN THE SOFTWARE.
 */

package org.java_websocket.util;

import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

public class NamedThreadFactory implements ThreadFactory {
        private final ThreadFactory defaultThreadFactory = Executors.defaultThreadFactory();
        private final AtomicInteger threadNumber = new AtomicInteger(1);
        private final String threadPrefix;

        public NamedThreadFactory(String threadPrefix) {
            this.threadPrefix = threadPrefix;
        }

        @Override
        public Thread newThread(Runnable runnable) {
            Thread thread = defaultThreadFactory.newThread(runnable);
            thread.setName(threadPrefix + "-" + threadNumber);
            return thread;
        }
}

@@ -1,13 +1,14 @@
 /*%0A *
+ 
  Copyrig
@@ -21,29 +21,35 @@
  201
-9 Noah Andrews
+0-2019 Nathan Rajlich
 %0A *%0A *
- 
  Per
@@ -107,17 +107,16 @@
 erson%0A *
- 
  obtaini
@@ -173,17 +173,16 @@
 ation%0A *
- 
  files (
@@ -232,17 +232,16 @@
 thout%0A *
- 
  restric
@@ -296,17 +296,16 @@
  use,%0A *
- 
  copy, m
@@ -365,17 +365,16 @@
  sell%0A *
- 
  copies 
@@ -426,17 +426,16 @@
 m the%0A *
- 
  Softwar
@@ -486,17 +486,16 @@
 owing%0A *
- 
  conditi
@@ -504,17 +504,16 @@
 s:%0A *%0A *
- 
  The abo
@@ -570,17 +570,16 @@
 ll be%0A *
- 
  include
@@ -640,17 +640,16 @@
 e.%0A *%0A *
- 
  THE SOF
@@ -707,17 +707,16 @@
 KIND,%0A *
- 
  EXPRESS
@@ -774,17 +774,16 @@
 NTIES%0A *
- 
  OF MERC
@@ -834,17 +834,16 @@
 E AND%0A *
- 
  NONINFR
@@ -897,17 +897,16 @@
 RIGHT%0A *
- 
  HOLDERS
@@ -961,17 +961,16 @@
 LITY,%0A *
- 
  WHETHER
@@ -1025,17 +1025,16 @@
 ISING%0A *
- 
  FROM, O
@@ -1090,17 +1090,16 @@
 SE OR%0A *
- 
  OTHER D

Replace license