== Why is this an issue?

Naming a thread won't make it run faster or more reliably, but it will make it easier to deal with if you need to debug the application.


=== Noncompliant code example

[source,java]
----
Thread t1 = new Thread(new Runnable() {
  // ...
};
t1.start();   // Noncompliant; this thread wasn't named
----


=== Compliant solution

[source,java]
----
Thread t1 = new Thread(new Runnable() {
  // ...
};
t1.setName("t1");
t1.start();
----


ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Name this thread to ease debugging and profiling.


'''
== Comments And Links
(visible only on this page)

=== on 11 Jun 2015, 19:37:06 Ann Campbell wrote:
CodePro: Disallow Unnamed Thread Usage

=== on 16 Jun 2015, 17:09:38 Nicolas Peru wrote:
Looks good.

endif::env-github,rspecator-view[]
