@@ -0,0 +1,1784 @@
+/*%0A * Copyright 2017 Eric Bishton%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.intellij.plugins.haxe.util;%0A%0A/**%0A * A counter that is thread static.  Use it like this:%0A * Created by ebishton on 7/16/17.%0A */%0Apublic class ThreadLocalCounter %7B%0A  static final HaxeDebugLogger LOG = HaxeDebugLogger.getLogger();%0A  final String debugName;%0A%0A  private final ThreadLocal%3CInteger%3E counter = new ThreadLocal%3CInteger%3E() %7B%0A    @Override%0A    protected Integer initialValue() %7B%0A      return 0;%0A    %7D%0A  %7D;%0A%0A  public ThreadLocalCounter() %7B%0A    this(HaxeDebugUtil.getCallerCanonicalName());%0A  %7D%0A%0A  public ThreadLocalCounter(String debugName) %7B%0A    this.debugName = null == debugName ? %22Anonymous%22 : debugName;%0A  %7D%0A%0A  public int increment() %7B%0A    int newval = counter.get() + 1;%0A    counter.set(newval);%0A    return newval;%0A  %7D%0A%0A  public int decrement() %7B%0A    int newval = counter.get() - 1;%0A    counter.set(newval);%0A    if (newval %3C 0) %7B%0A      LOG.debug(HaxeDebugUtil.traceThreadMessage(%0A        debugName + %22 decremented past zero by %22 + HaxeDebugUtil.getCallerCanonicalName()));%0A    %7D%0A    return newval;%0A  %7D%0A%0A  public int value() %7B%0A    return counter.get();%0A  %7D%0A%0A  public String toString() %7B%0A    // XXX: Output debugName here?%0A    return Integer.toString(counter.get());%0A  %7D%0A%7D%0A

Add new ThreadLocalCounter utility class.