< prev index next >
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
Print this page
rev 53252 : imported patch 8217047
*** 62,82 ****
--- 62,86 ----
import com.sun.tools.javac.util.Name;
import static com.sun.tools.javac.code.Flags.*;
import static com.sun.tools.javac.code.Kinds.*;
import static com.sun.tools.javac.code.Kinds.Kind.*;
+ import com.sun.tools.javac.code.MissingInfoHandler;
import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
import com.sun.tools.javac.code.Scope.WriteableScope;
+ import com.sun.tools.javac.code.Symbol;
import static com.sun.tools.javac.code.Symbol.OperatorSymbol.AccessCode.FIRSTASGOP;
+ import com.sun.tools.javac.code.Type;
import static com.sun.tools.javac.code.TypeTag.CLASS;
import static com.sun.tools.javac.code.TypeTag.FORALL;
import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
import static com.sun.tools.javac.jvm.ByteCodes.iadd;
import static com.sun.tools.javac.jvm.ByteCodes.ishll;
import static com.sun.tools.javac.jvm.ByteCodes.lushrl;
import static com.sun.tools.javac.jvm.ByteCodes.lxor;
import static com.sun.tools.javac.jvm.ByteCodes.string_add;
+ import com.sun.tools.javac.util.Name;
/** Root class for Java symbols. It contains subclasses
* for specific sorts of symbols, such as variables, methods and operators,
* types, packages. Each subclass is represented as a static inner class
* inside Symbol.
*** 1186,1195 ****
--- 1190,1209 ----
metadata = null;
}
}
+ public static class RootPackageSymbol extends PackageSymbol {
+ public final MissingInfoHandler missingInfoHandler;
+
+ public RootPackageSymbol(Name name, Symbol owner, MissingInfoHandler missingInfoHandler) {
+ super(name, owner);
+ this.missingInfoHandler = missingInfoHandler;
+ }
+
+ }
+
/** A class for class symbols
*/
public static class ClassSymbol extends TypeSymbol implements TypeElement {
/** a scope for all class members; variables, methods and inner classes
*** 1631,1640 ****
--- 1645,1680 ----
public <R, P> R accept(Symbol.Visitor<R, P> v, P p) {
return v.visitVarSymbol(this, p);
}
}
+ public static class ParamSymbol extends VarSymbol {
+ public ParamSymbol(long flags, Name name, Type type, Symbol owner) {
+ super(flags, name, type, owner);
+ }
+
+ @Override
+ public Name getSimpleName() {
+ if ((flags_field & NAME_FILLED) == 0) {
+ flags_field |= NAME_FILLED;
+ Symbol rootPack = this;
+ while (rootPack != null && !(rootPack instanceof RootPackageSymbol)) {
+ rootPack = rootPack.owner;
+ }
+ if (rootPack != null) {
+ Name inferredName =
+ ((RootPackageSymbol) rootPack).missingInfoHandler.getParameterName(this);
+ if (inferredName != null) {
+ this.name = inferredName;
+ }
+ }
+ }
+ return super.getSimpleName();
+ }
+
+ }
+
/** A class for method symbols.
*/
public static class MethodSymbol extends Symbol implements ExecutableElement {
/** The code of the method. */
< prev index next >