Skip to content

Commit 1d2a73c

Browse files
committed
Polish
1 parent 1ceb999 commit 1d2a73c

File tree

1 file changed

+18
-22
lines changed
  • src/jdk.compiler/share/classes/com/sun/tools/javac/comp

1 file changed

+18
-22
lines changed

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,28 +2896,25 @@ Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Sym
28962896
} else {
28972897
final JCDiagnostic details = sym.kind == WRONG_MTH ?
28982898
((InapplicableSymbolError)sym.baseSymbol()).errCandidate().snd :
2899-
null;
2899+
null;
29002900
sym = new DiamondError(sym, currentResolutionContext);
29012901
sym = accessMethod(sym, pos, site, names.init, true, argtypes, typeargtypes);
29022902
env.info.pendingResolutionPhase = currentResolutionContext.step;
29032903
}
29042904
}
29052905
return sym;
2906-
}
2907-
});
2906+
}});
29082907
}
29092908

2910-
/**
2911-
* Find the constructor using diamond inference and do some checks(deprecated and preview).
2912-
*
2913-
* @param pos The position to use for error reporting.
2914-
* @param env The environment current at the constructor invocation.
2915-
* @param site The type of class for which a constructor is searched.
2916-
* The scope of this class has been touched in attribution.
2917-
* @param argtypes The types of the constructor invocation's value arguments.
2918-
* @param typeargtypes The types of the constructor invocation's type arguments.
2919-
* @param allowBoxing Allow boxing conversions of arguments.
2920-
* @param useVarargs Box trailing arguments into an array for varargs.
2909+
/** Find the constructor using diamond inference and do some checks(deprecated and preview).
2910+
* @param pos The position to use for error reporting.
2911+
* @param env The environment current at the constructor invocation.
2912+
* @param site The type of class for which a constructor is searched.
2913+
* The scope of this class has been touched in attribution.
2914+
* @param argtypes The types of the constructor invocation's value arguments.
2915+
* @param typeargtypes The types of the constructor invocation's type arguments.
2916+
* @param allowBoxing Allow boxing conversions of arguments.
2917+
* @param useVarargs Box trailing arguments into an array for varargs.
29212918
*/
29222919
private Symbol findDiamond(DiagnosticPosition pos,
29232920
Env<AttrContext> env,
@@ -2932,14 +2929,13 @@ private Symbol findDiamond(DiagnosticPosition pos,
29322929
return sym;
29332930
}
29342931

2935-
/**
2936-
* This method scans all the constructor symbol in a given class scope -
2937-
* assuming that the original scope contains a constructor of the kind:
2938-
* {@code Foo(X x, Y y)}, where X,Y are class type-variables declared in Foo,
2939-
* a method check is executed against the modified constructor type:
2940-
* {@code <X,Y>Foo<X,Y>(X x, Y y)}. This is crucial in order to enable diamond
2941-
* inference. The inferred return type of the synthetic constructor IS
2942-
* the inferred type for the diamond operator.
2932+
/** This method scans all the constructor symbol in a given class scope -
2933+
* assuming that the original scope contains a constructor of the kind:
2934+
* {@code Foo(X x, Y y)}, where X,Y are class type-variables declared in Foo,
2935+
* a method check is executed against the modified constructor type:
2936+
* {@code <X,Y>Foo<X,Y>(X x, Y y)}. This is crucial in order to enable diamond
2937+
* inference. The inferred return type of the synthetic constructor IS
2938+
* the inferred type for the diamond operator.
29432939
*/
29442940
private Symbol findDiamond(Env<AttrContext> env,
29452941
Type site,

0 commit comments

Comments
 (0)