Use consistent class design

Update all classes so that inner classes are always last. Also
ensure that utility classes are always final and have a private
constructor and make exceptions final whenever possible.

Issue: SPR-16968
This commit is contained in:
Phillip Webb
2018-06-20 19:44:39 -07:00
committed by Juergen Hoeller
parent 0ad0f341bd
commit eeebd51f57
128 changed files with 656 additions and 455 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 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.
@@ -28,9 +28,9 @@ package org.springframework.dao;
@SuppressWarnings("serial")
public class IncorrectResultSizeDataAccessException extends DataRetrievalFailureException {
private int expectedSize;
private final int expectedSize;
private int actualSize;
private final int actualSize;
/**

View File

@@ -225,7 +225,7 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory impleme
/**
* Invocation handler that suppresses close calls on CCI Connections.
*/
private static class CloseSuppressingInvocationHandler implements InvocationHandler {
private static final class CloseSuppressingInvocationHandler implements InvocationHandler {
private final Connection target;

View File

@@ -65,7 +65,7 @@ public class HeuristicCompletionException extends TransactionException {
/**
* The outcome state of the transaction: have some or all resources been committed?
*/
private int outcomeState = STATE_UNKNOWN;
private final int outcomeState;
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 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.
@@ -27,7 +27,7 @@ package org.springframework.transaction;
@SuppressWarnings("serial")
public class InvalidTimeoutException extends TransactionUsageException {
private int timeout;
private final int timeout;
/**

View File

@@ -1273,7 +1273,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
* Holder for suspended resources.
* Used internally by {@code suspend} and {@code resume}.
*/
protected static class SuspendedResourcesHolder {
protected static final class SuspendedResourcesHolder {
@Nullable
private final Object suspendedResources;