Polishing

This commit is contained in:
Juergen Hoeller
2014-07-29 11:42:37 +02:00
parent 7bc966032b
commit 8f484d382e
14 changed files with 220 additions and 224 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,14 +47,13 @@ final class SimpleStreamingClientHttpRequest extends AbstractClientHttpRequest {
private final boolean outputStreaming;
SimpleStreamingClientHttpRequest(HttpURLConnection connection, int chunkSize,
boolean outputStreaming) {
SimpleStreamingClientHttpRequest(HttpURLConnection connection, int chunkSize, boolean outputStreaming) {
this.connection = connection;
this.chunkSize = chunkSize;
this.outputStreaming = outputStreaming;
}
@Override
public HttpMethod getMethod() {
return HttpMethod.valueOf(this.connection.getRequestMethod());
}

View File

@@ -72,8 +72,11 @@ public class ControllerAdviceBean implements Ordered {
public ControllerAdviceBean(String beanName, BeanFactory beanFactory) {
Assert.hasText(beanName, "Bean name must not be null");
Assert.notNull(beanFactory, "BeanFactory must not be null");
Assert.isTrue(beanFactory.containsBean(beanName),
"BeanFactory [" + beanFactory + "] does not contain bean with name '" + beanName + "'");
if (!beanFactory.containsBean(beanName)) {
throw new IllegalArgumentException(
"BeanFactory [" + beanFactory + "] does not contain bean with name '" + beanName + "'");
}
this.bean = beanName;
this.beanFactory = beanFactory;
@@ -132,7 +135,7 @@ public class ControllerAdviceBean implements Ordered {
* Return a bean instance if necessary resolving the bean name through the BeanFactory.
*/
public Object resolveBean() {
return (this.bean instanceof String) ? this.beanFactory.getBean((String) this.bean) : this.bean;
return (this.bean instanceof String ? this.beanFactory.getBean((String) this.bean) : this.bean);
}
/**
@@ -173,20 +176,14 @@ public class ControllerAdviceBean implements Ordered {
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o != null && o instanceof ControllerAdviceBean) {
ControllerAdviceBean other = (ControllerAdviceBean) o;
return this.bean.equals(other.bean);
}
return false;
public boolean equals(Object other) {
return (this == other ||
(other instanceof ControllerAdviceBean && this.bean.equals(((ControllerAdviceBean) other).bean)));
}
@Override
public int hashCode() {
return 31 * this.bean.hashCode();
return this.bean.hashCode();
}
@Override

View File

@@ -616,7 +616,7 @@ final class HierarchicalUriComponents extends UriComponents {
@Override
public String getPath() {
return path;
return this.path;
}
@Override