All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sourcegraph.semanticdb_javac.LocalSymbolsCache Maven / Gradle / Ivy

There is a newer version: 0.10.3
Show newest version
package com.sourcegraph.semanticdb_javac;

import com.sun.tools.javac.code.Symbol;

import java.util.IdentityHashMap;

/** Cache of SemanticDB symbols that are local to a single file. */
public final class LocalSymbolsCache {

  private final IdentityHashMap symbols = new IdentityHashMap<>();
  private int localsCounter = -1;

  public String get(Symbol sym) {
    return symbols.get(sym);
  }

  public String put(Symbol sym) {
    localsCounter++;
    String result = SemanticdbSymbols.local(localsCounter);
    symbols.put(sym, result);
    return result;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy