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

org.checkerframework.dataflow.cfg.builder.Label Maven / Gradle / Ivy

Go to download

The Checker Framework enhances Java's type system to make it more powerful and useful. This lets software developers detect and prevent errors in their Java programs. The Checker Framework includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits you to write your own compiler plug-ins.

There is a newer version: 3.43.0
Show newest version
package org.checkerframework.dataflow.cfg.builder;

/**
 * A label is used to refer to other extended nodes using a mapping from labels to extended nodes.
 * Labels get their names either from labeled statements in the source code or from internally
 * generated unique names.
 */
class Label {
  private static int uid = 0;

  protected final String name;

  public Label(String name) {
    this.name = name;
  }

  public Label() {
    this.name = uniqueName();
  }

  @Override
  public String toString() {
    return name;
  }

  /**
   * Return a new unique label name that cannot be confused with a Java source code label.
   *
   * @return a new unique label name
   */
  private static String uniqueName() {
    return "%L" + uid++;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy