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

org.checkerframework.dataflow.expression.SuperReference Maven / Gradle / Ivy

Go to download

dataflow-shaded is a dataflow framework based on the javac compiler. It differs from the org.checkerframework:dataflow artifact in two ways. First, the packages in this artifact have been renamed to org.checkerframework.shaded.*. Second, unlike the dataflow artifact, this artifact contains the dependencies it requires.

There is a newer version: 3.48.3
Show newest version
package org.checkerframework.dataflow.expression;

import javax.lang.model.type.TypeMirror;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.dataflow.analysis.Store;
import org.checkerframework.javacutil.AnnotationProvider;
import org.checkerframework.javacutil.TypesUtils;

/** A use of {@code super}. */
public class SuperReference extends JavaExpression {

  /**
   * Creates a new {@link SuperReference}.
   *
   * @param type the type of the {@code super} reference
   */
  public SuperReference(TypeMirror type) {
    super(type);
  }

  @SuppressWarnings("unchecked") // generic cast
  @Override
  public  @Nullable T containedOfClass(Class clazz) {
    return getClass() == clazz ? (T) this : null;
  }

  @Override
  public boolean isDeterministic(AnnotationProvider provider) {
    return true;
  }

  @Override
  public boolean isAssignableByOtherCode() {
    return false;
  }

  @Override
  public boolean isModifiableByOtherCode() {
    return !TypesUtils.isImmutableTypeInJdk(type);
  }

  @Override
  public boolean containsModifiableAliasOf(Store store, JavaExpression other) {
    return false;
  }

  @Override
  public boolean syntacticEquals(JavaExpression je) {
    return je instanceof SuperReference;
  }

  @Override
  public boolean containsSyntacticEqualJavaExpression(JavaExpression other) {
    return this.syntacticEquals(other);
  }

  @Override
  public boolean equals(@Nullable Object obj) {
    return obj instanceof SuperReference;
  }

  @Override
  public int hashCode() {
    return 0;
  }

  @Override
  public  R accept(JavaExpressionVisitor visitor, P p) {
    return visitor.visitSuperReference(this, p);
  }

  @Override
  public String toString() {
    return "super";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy