Browse Source

Polish: Array designators "[]" should be on the type, not the variable

pull/1702/head
igor-suhorukov 7 years ago committed by Juergen Hoeller
parent
commit
c782075a13
  1. 6
      spring-beans/src/main/java/org/springframework/beans/PropertyDescriptorUtils.java
  2. 2
      spring-beans/src/main/java/org/springframework/beans/PropertyMatches.java
  3. 6
      spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
  4. 4
      spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java
  5. 2
      spring-core/src/main/java/org/springframework/util/DigestUtils.java
  6. 2
      spring-core/src/main/java/org/springframework/util/StreamUtils.java
  7. 2
      spring-core/src/main/java/org/springframework/util/xml/AbstractStaxHandler.java
  8. 4
      spring-core/src/main/java/org/springframework/util/xml/DomContentHandler.java
  9. 2
      spring-expression/src/main/java/org/springframework/expression/spel/standard/Tokenizer.java
  10. 2
      spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/PassThroughBlob.java
  11. 2
      spring-test/src/main/java/org/springframework/mock/web/MockBodyContent.java
  12. 2
      spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java
  13. 2
      spring-test/src/main/java/org/springframework/mock/web/MockJspWriter.java
  14. 4
      spring-test/src/main/java/org/springframework/test/web/servlet/setup/StubWebApplicationContext.java
  15. 2
      spring-web/src/main/java/org/springframework/web/util/ContentCachingResponseWrapper.java
  16. 2
      spring-web/src/main/java/org/springframework/web/util/WebUtils.java

6
spring-beans/src/main/java/org/springframework/beans/PropertyDescriptorUtils.java

@ -79,7 +79,7 @@ class PropertyDescriptorUtils { @@ -79,7 +79,7 @@ class PropertyDescriptorUtils {
}
if (writeMethod != null) {
Class<?> params[] = writeMethod.getParameterTypes();
Class<?>[] params = writeMethod.getParameterTypes();
if (params.length != 1) {
throw new IntrospectionException("Bad write method arg count: " + writeMethod);
}
@ -114,7 +114,7 @@ class PropertyDescriptorUtils { @@ -114,7 +114,7 @@ class PropertyDescriptorUtils {
Class<?> indexedPropertyType = null;
if (indexedReadMethod != null) {
Class<?> params[] = indexedReadMethod.getParameterTypes();
Class<?>[] params = indexedReadMethod.getParameterTypes();
if (params.length != 1) {
throw new IntrospectionException("Bad indexed read method arg count: " + indexedReadMethod);
}
@ -128,7 +128,7 @@ class PropertyDescriptorUtils { @@ -128,7 +128,7 @@ class PropertyDescriptorUtils {
}
if (indexedWriteMethod != null) {
Class<?> params[] = indexedWriteMethod.getParameterTypes();
Class<?>[] params = indexedWriteMethod.getParameterTypes();
if (params.length != 2) {
throw new IntrospectionException("Bad indexed write method arg count: " + indexedWriteMethod);
}

2
spring-beans/src/main/java/org/springframework/beans/PropertyMatches.java

@ -155,7 +155,7 @@ public abstract class PropertyMatches { @@ -155,7 +155,7 @@ public abstract class PropertyMatches {
if (s2.isEmpty()) {
return s1.length();
}
int d[][] = new int[s1.length() + 1][s2.length() + 1];
int[][] d = new int[s1.length() + 1][s2.length() + 1];
for (int i = 0; i <= s1.length(); i++) {
d[i][0] = i;

6
spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java

@ -833,11 +833,11 @@ class ConstructorResolver { @@ -833,11 +833,11 @@ class ConstructorResolver {
*/
private static class ArgumentsHolder {
public final Object rawArguments[];
public final Object[] rawArguments;
public final Object arguments[];
public final Object[] arguments;
public final Object preparedArguments[];
public final Object[] preparedArguments;
public boolean resolveNecessary = false;

4
spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

@ -1258,12 +1258,12 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader @@ -1258,12 +1258,12 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
//---------------------------------------------------------------------
@Override
public String getMessage(String code, @Nullable Object args[], @Nullable String defaultMessage, Locale locale) {
public String getMessage(String code, @Nullable Object[] args, @Nullable String defaultMessage, Locale locale) {
return getMessageSource().getMessage(code, args, defaultMessage, locale);
}
@Override
public String getMessage(String code, @Nullable Object args[], Locale locale) throws NoSuchMessageException {
public String getMessage(String code, @Nullable Object[] args, Locale locale) throws NoSuchMessageException {
return getMessageSource().getMessage(code, args, locale);
}

2
spring-core/src/main/java/org/springframework/util/DigestUtils.java

@ -169,7 +169,7 @@ public abstract class DigestUtils { @@ -169,7 +169,7 @@ public abstract class DigestUtils {
}
private static char[] encodeHex(byte[] bytes) {
char chars[] = new char[32];
char[] chars = new char[32];
for (int i = 0; i < chars.length; i = i + 2) {
byte b = bytes[i / 2];
chars[i] = HEX_CHARS[(b >>> 0x4) & 0xf];

2
spring-core/src/main/java/org/springframework/util/StreamUtils.java

@ -167,7 +167,7 @@ public abstract class StreamUtils { @@ -167,7 +167,7 @@ public abstract class StreamUtils {
}
long bytesToCopy = end - start + 1;
byte buffer[] = new byte[StreamUtils.BUFFER_SIZE];
byte[] buffer = new byte[StreamUtils.BUFFER_SIZE];
while (bytesToCopy > 0) {
int bytesRead = in.read(buffer);
if (bytesRead == -1) {

2
spring-core/src/main/java/org/springframework/util/xml/AbstractStaxHandler.java

@ -102,7 +102,7 @@ abstract class AbstractStaxHandler implements ContentHandler, LexicalHandler { @@ -102,7 +102,7 @@ abstract class AbstractStaxHandler implements ContentHandler, LexicalHandler {
}
@Override
public final void characters(char ch[], int start, int length) throws SAXException {
public final void characters(char[] ch, int start, int length) throws SAXException {
try {
String data = new String(ch, start, length);
if (!this.inCData) {

4
spring-core/src/main/java/org/springframework/util/xml/DomContentHandler.java

@ -94,7 +94,7 @@ class DomContentHandler implements ContentHandler { @@ -94,7 +94,7 @@ class DomContentHandler implements ContentHandler {
}
@Override
public void characters(char ch[], int start, int length) throws SAXException {
public void characters(char[] ch, int start, int length) throws SAXException {
String data = new String(ch, start, length);
Node parent = getParent();
Node lastChild = parent.getLastChild();
@ -139,7 +139,7 @@ class DomContentHandler implements ContentHandler { @@ -139,7 +139,7 @@ class DomContentHandler implements ContentHandler {
}
@Override
public void ignorableWhitespace(char ch[], int start, int length) throws SAXException {
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
}
@Override

2
spring-expression/src/main/java/org/springframework/expression/spel/standard/Tokenizer.java

@ -38,7 +38,7 @@ class Tokenizer { @@ -38,7 +38,7 @@ class Tokenizer {
private static final String[] ALTERNATIVE_OPERATOR_NAMES =
{"DIV", "EQ", "GE", "GT", "LE", "LT", "MOD", "NE", "NOT"};
private static final byte FLAGS[] = new byte[256];
private static final byte[] FLAGS = new byte[256];
private static final byte IS_DIGIT = 0x01;

2
spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/PassThroughBlob.java

@ -96,7 +96,7 @@ class PassThroughBlob implements Blob { @@ -96,7 +96,7 @@ class PassThroughBlob implements Blob {
}
@Override
public long position(byte pattern[], long start) throws SQLException {
public long position(byte[] pattern, long start) throws SQLException {
throw new UnsupportedOperationException();
}

2
spring-test/src/main/java/org/springframework/mock/web/MockBodyContent.java

@ -123,7 +123,7 @@ public class MockBodyContent extends BodyContent { @@ -123,7 +123,7 @@ public class MockBodyContent extends BodyContent {
}
@Override
public void write(char value[], int offset, int length) throws IOException {
public void write(char[] value, int offset, int length) throws IOException {
getEnclosingWriter().write(value, offset, length);
}

2
spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java

@ -717,7 +717,7 @@ public class MockHttpServletResponse implements HttpServletResponse { @@ -717,7 +717,7 @@ public class MockHttpServletResponse implements HttpServletResponse {
}
@Override
public void write(char buf[], int off, int len) {
public void write(char[] buf, int off, int len) {
super.write(buf, off, len);
super.flush();
setCommittedIfBufferSizeExceeded();

2
spring-test/src/main/java/org/springframework/mock/web/MockJspWriter.java

@ -116,7 +116,7 @@ public class MockJspWriter extends JspWriter { @@ -116,7 +116,7 @@ public class MockJspWriter extends JspWriter {
}
@Override
public void write(char value[], int offset, int length) throws IOException {
public void write(char[] value, int offset, int length) throws IOException {
getTargetWriter().write(value, offset, length);
}

4
spring-test/src/main/java/org/springframework/test/web/servlet/setup/StubWebApplicationContext.java

@ -303,12 +303,12 @@ class StubWebApplicationContext implements WebApplicationContext { @@ -303,12 +303,12 @@ class StubWebApplicationContext implements WebApplicationContext {
//---------------------------------------------------------------------
@Override
public String getMessage(String code, @Nullable Object args[], @Nullable String defaultMessage, Locale locale) {
public String getMessage(String code, @Nullable Object[] args, @Nullable String defaultMessage, Locale locale) {
return this.messageSource.getMessage(code, args, defaultMessage, locale);
}
@Override
public String getMessage(String code, @Nullable Object args[], Locale locale) throws NoSuchMessageException {
public String getMessage(String code, @Nullable Object[] args, Locale locale) throws NoSuchMessageException {
return this.messageSource.getMessage(code, args, locale);
}

2
spring-web/src/main/java/org/springframework/web/util/ContentCachingResponseWrapper.java

@ -271,7 +271,7 @@ public class ContentCachingResponseWrapper extends HttpServletResponseWrapper { @@ -271,7 +271,7 @@ public class ContentCachingResponseWrapper extends HttpServletResponseWrapper {
}
@Override
public void write(char buf[], int off, int len) {
public void write(char[] buf, int off, int len) {
super.write(buf, off, len);
super.flush();
}

2
spring-web/src/main/java/org/springframework/web/util/WebUtils.java

@ -503,7 +503,7 @@ public abstract class WebUtils { @@ -503,7 +503,7 @@ public abstract class WebUtils {
@Nullable
public static Cookie getCookie(HttpServletRequest request, String name) {
Assert.notNull(request, "Request must not be null");
Cookie cookies[] = request.getCookies();
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
if (name.equals(cookie.getName())) {

Loading…
Cancel
Save