< prev index next >
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
Print this page
rev 53252 : imported patch 8217047
@@ -142,10 +142,12 @@
*/
JCDiagnostic.Factory diagFactory;
DeferredCompletionFailureHandler dcfh;
+ MissingInfoHandler missingInfoHandler;
+
/**
* Support for preview language features.
*/
Preview preview;
@@ -262,10 +264,11 @@
fileManager = context.get(JavaFileManager.class);
if (fileManager == null)
throw new AssertionError("FileManager initialization error");
diagFactory = JCDiagnostic.Factory.instance(context);
dcfh = DeferredCompletionFailureHandler.instance(context);
+ missingInfoHandler = MissingInfoHandler.instance(context);
log = Log.instance(context);
Options options = Options.instance(context);
verbose = options.isSet(Option.VERBOSE);
@@ -2551,18 +2554,16 @@
int skip = Code.width(jvmType.getParameterTypes())
- Code.width(sym.type.getParameterTypes());
firstParam += skip;
}
}
- List<Name> paramNames = List.nil();
+ Set<Name> paramNames = new HashSet<>();
ListBuffer<VarSymbol> params = new ListBuffer<>();
int nameIndex = firstParam;
int annotationIndex = 0;
for (Type t: sym.type.getParameterTypes()) {
- Name name = parameterName(nameIndex, paramNames);
- paramNames = paramNames.prepend(name);
- VarSymbol param = new VarSymbol(PARAMETER, name, t, sym);
+ VarSymbol param = parameter(nameIndex, t, sym, paramNames);
params.append(param);
if (parameterAnnotations != null) {
ParameterAnnotations annotations = parameterAnnotations[annotationIndex];
if (annotations != null && annotations.proxies != null
&& !annotations.proxies.isEmpty()) {
@@ -2583,23 +2584,29 @@
// Returns the name for the parameter at position 'index', either using
// names read from the MethodParameters, or by synthesizing a name that
// is not on the 'exclude' list.
- private Name parameterName(int index, List<Name> exclude) {
+ private VarSymbol parameter(int index, Type t, MethodSymbol owner, Set<Name> exclude) {
+ long flags = PARAMETER;
+ Name argName;
if (parameterNameIndices != null && index < parameterNameIndices.length
&& parameterNameIndices[index] != 0) {
- return readName(parameterNameIndices[index]);
- }
+ argName = readName(parameterNameIndices[index]);
+ flags |= NAME_FILLED;
+ } else {
String prefix = "arg";
while (true) {
- Name argName = names.fromString(prefix + exclude.size());
+ argName = names.fromString(prefix + exclude.size());
if (!exclude.contains(argName))
- return argName;
+ break;
prefix += "$";
}
}
+ exclude.add(argName);
+ return new ParamSymbol(flags, argName, t, owner);
+ }
/**
* skip n bytes
*/
void skipBytes(int n) {
< prev index next >