1
2
3
4 package net.sourceforge.pmd.util;
5
6 import java.util.concurrent.ExecutorService;
7 import java.util.concurrent.Executors;
8
9 public final class SystemUtils {
10
11 private SystemUtils() {
12
13 }
14
15
16
17
18 public static final boolean MT_SUPPORTED;
19 static {
20 boolean error = false;
21 try {
22
23
24
25
26
27
28
29
30
31
32 ExecutorService executor = Executors.newFixedThreadPool(1);
33 executor.shutdown();
34 } catch (RuntimeException e) {
35 error = true;
36 System.err.println("Disabling multithreading - consider to upgrade to java 1.6");
37 System.err.println("See also: http://sourceforge.net/p/pmd/bugs/670/");
38 }
39 MT_SUPPORTED = !error;
40 }
41 }