Nullability refinements and related polishing
See gh-32475
This commit is contained in:
@@ -76,14 +76,14 @@ public final class ConsumesRequestCondition extends AbstractRequestCondition<Con
|
||||
* @param consumes as described in {@link RequestMapping#consumes()}
|
||||
* @param headers as described in {@link RequestMapping#headers()}
|
||||
*/
|
||||
public ConsumesRequestCondition(String[] consumes, @Nullable String[] headers) {
|
||||
public ConsumesRequestCondition(@Nullable String[] consumes, @Nullable String[] headers) {
|
||||
this.expressions = parseExpressions(consumes, headers);
|
||||
if (this.expressions.size() > 1) {
|
||||
Collections.sort(this.expressions);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<ConsumeMediaTypeExpression> parseExpressions(String[] consumes, @Nullable String[] headers) {
|
||||
private static List<ConsumeMediaTypeExpression> parseExpressions(@Nullable String[] consumes, @Nullable String[] headers) {
|
||||
Set<ConsumeMediaTypeExpression> result = null;
|
||||
if (!ObjectUtils.isEmpty(headers)) {
|
||||
for (String header : headers) {
|
||||
|
||||
@@ -83,7 +83,7 @@ public final class ProducesRequestCondition extends AbstractRequestCondition<Pro
|
||||
* @param produces expressions with syntax defined by {@link RequestMapping#produces()}
|
||||
* @param headers expressions with syntax defined by {@link RequestMapping#headers()}
|
||||
*/
|
||||
public ProducesRequestCondition(String[] produces, @Nullable String[] headers) {
|
||||
public ProducesRequestCondition(@Nullable String[] produces, @Nullable String[] headers) {
|
||||
this(produces, headers, null);
|
||||
}
|
||||
|
||||
@@ -94,17 +94,17 @@ public final class ProducesRequestCondition extends AbstractRequestCondition<Pro
|
||||
* @param headers expressions with syntax defined by {@link RequestMapping#headers()}
|
||||
* @param manager used to determine requested media types
|
||||
*/
|
||||
public ProducesRequestCondition(String[] produces, @Nullable String[] headers,
|
||||
public ProducesRequestCondition(@Nullable String[] produces, @Nullable String[] headers,
|
||||
@Nullable ContentNegotiationManager manager) {
|
||||
|
||||
this.expressions = parseExpressions(produces, headers);
|
||||
if (this.expressions.size() > 1) {
|
||||
Collections.sort(this.expressions);
|
||||
}
|
||||
this.contentNegotiationManager = manager != null ? manager : DEFAULT_CONTENT_NEGOTIATION_MANAGER;
|
||||
this.contentNegotiationManager = (manager != null ? manager : DEFAULT_CONTENT_NEGOTIATION_MANAGER);
|
||||
}
|
||||
|
||||
private List<ProduceMediaTypeExpression> parseExpressions(String[] produces, @Nullable String[] headers) {
|
||||
private List<ProduceMediaTypeExpression> parseExpressions(@Nullable String[] produces, @Nullable String[] headers) {
|
||||
Set<ProduceMediaTypeExpression> result = null;
|
||||
if (!ObjectUtils.isEmpty(headers)) {
|
||||
for (String header : headers) {
|
||||
|
||||
Reference in New Issue
Block a user