< prev index next > src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
Print this page
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.WeakHashMap;
+ import java.util.function.BiFunction;
import java.util.function.BiPredicate;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collector;
import com.sun.tools.javac.code.TypeMetadata.Annotations;
import com.sun.tools.javac.comp.AttrContext;
import com.sun.tools.javac.comp.Check;
import com.sun.tools.javac.comp.Enter;
import com.sun.tools.javac.comp.Env;
- import com.sun.tools.javac.comp.LambdaToMethod;
import com.sun.tools.javac.jvm.ClassFile;
import com.sun.tools.javac.util.*;
import static com.sun.tools.javac.code.BoundKind.*;
import static com.sun.tools.javac.code.Flags.*;
chk = Check.instance(context);
enter = Enter.instance(context);
capturedName = names.fromString("<captured wildcard>");
messages = JavacMessages.instance(context);
diags = JCDiagnostic.Factory.instance(context);
! noWarnings = new Warner(null);
Options options = Options.instance(context);
dumpStacktraceOnError = options.isSet("dev") || options.isSet(DOE);
}
// </editor-fold>
chk = Check.instance(context);
enter = Enter.instance(context);
capturedName = names.fromString("<captured wildcard>");
messages = JavacMessages.instance(context);
diags = JCDiagnostic.Factory.instance(context);
! noWarnings = new Warner(null) {
+ @Override
+ public String toString() {
+ return "NO_WARNINGS";
+ }
+ };
Options options = Options.instance(context);
dumpStacktraceOnError = options.isSet("dev") || options.isSet(DOE);
}
// </editor-fold>
*
* @param t The component type of the ArrayType
* @return the ArrayType for the given component
*/
public ArrayType makeArrayType(Type t) {
if (t.hasTag(VOID) || t.hasTag(PACKAGE)) {
Assert.error("Type t must not be a VOID or PACKAGE type, " + t.toString());
}
! return new ArrayType(t, syms.arrayClass);
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="asSuper">
/**
*
* @param t The component type of the ArrayType
* @return the ArrayType for the given component
*/
public ArrayType makeArrayType(Type t) {
+ return makeArrayType(t, 1);
+ }
+
+ public ArrayType makeArrayType(Type t, int dimensions) {
if (t.hasTag(VOID) || t.hasTag(PACKAGE)) {
Assert.error("Type t must not be a VOID or PACKAGE type, " + t.toString());
}
! ArrayType result = new ArrayType(t, syms.arrayClass);
+ for (int i = 1; i < dimensions; i++) {
+ result = new ArrayType(result, syms.arrayClass);
+ }
+ return result;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="asSuper">
/**
}
Assert.check(act1.isEmpty() && act2.isEmpty() && typarams.isEmpty());
// There is no spec detailing how type annotations are to
// be inherited. So set it to noAnnotations for now
return new ClassType(class1.getEnclosingType(), merged.toList(),
! class1.tsym);
}
/**
* Return the minimum type of a closure, a compound type if no
* unique minimum exists.
}
Assert.check(act1.isEmpty() && act2.isEmpty() && typarams.isEmpty());
// There is no spec detailing how type annotations are to
// be inherited. So set it to noAnnotations for now
return new ClassType(class1.getEnclosingType(), merged.toList(),
! class1.tsym, List.nil());
}
/**
* Return the minimum type of a closure, a compound type if no
* unique minimum exists.
* A wrapper for a type that allows use in sets.
*/
public static class UniqueType {
public final Type type;
final Types types;
! public UniqueType(Type type, Types types) {
this.type = type;
this.types = types;
}
public int hashCode() {
return types.hashCode(type);
}
* A wrapper for a type that allows use in sets.
*/
public static class UniqueType {
public final Type type;
final Types types;
+ private boolean encodeTypeSig;
! public UniqueType(Type type, Types types, boolean encodeTypeSig) {
this.type = type;
this.types = types;
+ this.encodeTypeSig = encodeTypeSig;
+ }
+
+ public UniqueType(Type type, Types types) {
+ this(type, types, true);
}
public int hashCode() {
return types.hashCode(type);
}
public boolean equals(Object obj) {
return (obj instanceof UniqueType uniqueType) &&
types.isSameType(type, uniqueType.type);
}
+ public boolean encodeTypeSig() {
+ return encodeTypeSig;
+ }
+
public String toString() {
return type.toString();
}
}
< prev index next >