Polishing.

Fix ordering of static final modifiers. Fix Cubbyhole lettercasing.

See gh-88.
This commit is contained in:
Mark Paluch
2017-05-02 09:35:52 +02:00
parent a7d8cdb229
commit 9946f5ed79
17 changed files with 64 additions and 64 deletions

View File

@@ -42,7 +42,7 @@ import org.springframework.web.client.RestOperations;
*/
public class AppIdAuthentication implements ClientAuthentication {
private final static Log logger = LogFactory.getLog(AppIdAuthentication.class);
private static final Log logger = LogFactory.getLog(AppIdAuthentication.class);
private final AppIdAuthenticationOptions options;

View File

@@ -23,7 +23,7 @@ import org.springframework.util.Assert;
* Authentication options provide the path, appId and a {@link AppIdUserIdMechanism}.
* {@link AppIdAuthentication} can be constructed using {@link #builder()}. Instances of
* this class are immutable once constructed.
*
*
* @author Mark Paluch
* @see AppIdAuthentication
* @see AppIdUserIdMechanism
@@ -31,7 +31,7 @@ import org.springframework.util.Assert;
*/
public class AppIdAuthenticationOptions {
public final static String DEFAULT_APPID_AUTHENTICATION_PATH = "app-id";
public static final String DEFAULT_APPID_AUTHENTICATION_PATH = "app-id";
/**
* Path of the appid authentication backend mount.
@@ -100,7 +100,7 @@ public class AppIdAuthenticationOptions {
/**
* Configure the mount path.
*
*
* @param path must not be empty or {@literal null}.
* @return {@code this} {@link AppIdAuthenticationOptionsBuilder}.
* @see #DEFAULT_APPID_AUTHENTICATION_PATH
@@ -145,7 +145,7 @@ public class AppIdAuthenticationOptions {
/**
* Build a new {@link AppIdAuthenticationOptions} instance. Requires
* {@link #userIdMechanism(AppIdUserIdMechanism)} to be configured.
*
*
* @return a new {@link AppIdAuthenticationOptions}.
*/
public AppIdAuthenticationOptions build() {

View File

@@ -44,7 +44,7 @@ import org.springframework.web.client.RestOperations;
*/
public class AppRoleAuthentication implements ClientAuthentication {
private final static Log logger = LogFactory.getLog(AppRoleAuthentication.class);
private static final Log logger = LogFactory.getLog(AppRoleAuthentication.class);
private final AppRoleAuthenticationOptions options;

View File

@@ -23,14 +23,14 @@ import org.springframework.util.Assert;
* Authentication options provide the path, roleId and pull/push mode.
* {@link AppRoleAuthentication} can be constructed using {@link #builder()}. Instances of
* this class are immutable once constructed.
*
*
* @author Mark Paluch
* @see AppRoleAuthentication
* @see #builder()
*/
public class AppRoleAuthenticationOptions {
public final static String DEFAULT_APPROLE_AUTHENTICATION_PATH = "approle";
public static final String DEFAULT_APPROLE_AUTHENTICATION_PATH = "approle";
/**
* Path of the apprile authentication backend mount.
@@ -98,7 +98,7 @@ public class AppRoleAuthenticationOptions {
/**
* Configure the mount path.
*
*
* @param path must not be empty or {@literal null}.
* @return {@code this} {@link AppRoleAuthenticationOptionsBuilder}.
* @see #DEFAULT_APPROLE_AUTHENTICATION_PATH
@@ -142,7 +142,7 @@ public class AppRoleAuthenticationOptions {
/**
* Build a new {@link AppRoleAuthenticationOptions} instance. Requires
* {@link #roleId(String)} to be configured.
*
*
* @return a new {@link AppRoleAuthenticationOptions}.
*/
public AppRoleAuthenticationOptions build() {

View File

@@ -48,7 +48,7 @@ import org.springframework.web.client.RestOperations;
*/
public class AwsEc2Authentication implements ClientAuthentication {
private final static Log logger = LogFactory.getLog(AwsEc2Authentication.class);
private static final Log logger = LogFactory.getLog(AwsEc2Authentication.class);
private final AwsEc2AuthenticationOptions options;

View File

@@ -32,17 +32,17 @@ import org.springframework.util.Assert;
*/
public class AwsEc2AuthenticationOptions {
public final static URI DEFAULT_PKCS7_IDENTITY_DOCUMENT_URI = URI
public static final URI DEFAULT_PKCS7_IDENTITY_DOCUMENT_URI = URI
.create("http://169.254.169.254/latest/dynamic/instance-identity/pkcs7");
public final static String DEFAULT_AWS_AUTHENTICATION_PATH = "aws-ec2";
public static final String DEFAULT_AWS_AUTHENTICATION_PATH = "aws-ec2";
/**
* Default {@link AwsEc2AuthenticationOptions} using
* {@link #DEFAULT_AWS_AUTHENTICATION_PATH} and
* {@link #DEFAULT_PKCS7_IDENTITY_DOCUMENT_URI}.
*/
public final static AwsEc2AuthenticationOptions DEFAULT = new AwsEc2AuthenticationOptions();
public static final AwsEc2AuthenticationOptions DEFAULT = new AwsEc2AuthenticationOptions();
/**
* Path of the aws-ec2 authentication backend mount.
@@ -142,7 +142,7 @@ public class AwsEc2AuthenticationOptions {
* Configure the name of the role against which the login is being attempted.If
* role is not specified, then the login endpoint looks for a role bearing the
* name of the AMI ID of the EC2 instance that is trying to login.
*
*
* @param role may be empty or {@literal null}.
* @return {@code this} {@link AwsEc2AuthenticationOptionsBuilder}.
*/

View File

@@ -35,7 +35,7 @@ import org.springframework.web.client.RestOperations;
*/
public class ClientCertificateAuthentication implements ClientAuthentication {
private final static Log logger = LogFactory
private static final Log logger = LogFactory
.getLog(ClientCertificateAuthentication.class);
private final RestOperations restOperations;

View File

@@ -134,7 +134,7 @@ import org.springframework.web.client.RestOperations;
*/
public class CubbyholeAuthentication implements ClientAuthentication {
private final static Log logger = LogFactory.getLog(CubbyholeAuthentication.class);
private static final Log logger = LogFactory.getLog(CubbyholeAuthentication.class);
private final CubbyholeAuthenticationOptions options;
@@ -186,7 +186,7 @@ public class CubbyholeAuthentication implements ClientAuthentication {
}
catch (HttpStatusCodeException e) {
throw new VaultException(String.format(
"Cannot retrieve Token from cubbyhole: %s %s", e.getStatusCode(),
"Cannot retrieve Token from Cubbyhole: %s %s", e.getStatusCode(),
VaultResponses.getError(e.getResponseBodyAsString())));
}
}
@@ -236,7 +236,7 @@ public class CubbyholeAuthentication implements ClientAuthentication {
}
catch (HttpStatusCodeException e) {
throw new VaultException(String.format(
"Cannot self-lookup Token from cubbyhole: %s %s", e.getStatusCode(),
"Cannot self-lookup Token from Cubbyhole: %s %s", e.getStatusCode(),
VaultResponses.getError(e.getResponseBodyAsString())));
}
}
@@ -252,7 +252,7 @@ public class CubbyholeAuthentication implements ClientAuthentication {
if (data == null || data.isEmpty()) {
throw new VaultException(String.format(
"Cannot retrieve Token from cubbyhole: Response at %s does not contain a token",
"Cannot retrieve Token from Cubbyhole: Response at %s does not contain a token",
options.getPath()));
}
@@ -262,7 +262,7 @@ public class CubbyholeAuthentication implements ClientAuthentication {
}
throw new VaultException(String.format(
"Cannot retrieve Token from cubbyhole: Response at %s does not contain an unique token",
"Cannot retrieve Token from Cubbyhole: Response at %s does not contain an unique token",
options.getPath()));
}
}

View File

@@ -66,10 +66,10 @@ public class LifecycleAwareSessionManager implements SessionManager, DisposableB
*/
public static final int REFRESH_PERIOD_BEFORE_EXPIRY = 5;
private final static RefreshTrigger DEFAULT_TRIGGER = new FixedTimeoutRefreshTrigger(
private static final RefreshTrigger DEFAULT_TRIGGER = new FixedTimeoutRefreshTrigger(
REFRESH_PERIOD_BEFORE_EXPIRY, TimeUnit.SECONDS);
private final static Log logger = LogFactory
private static final Log logger = LogFactory
.getLog(LifecycleAwareSessionManager.class);
private final ClientAuthentication clientAuthentication;

View File

@@ -43,7 +43,7 @@ import org.springframework.util.StringUtils;
public class MacAddressUserId implements AppIdUserIdMechanism {
// Compatibility with Java 1.7 and greater
private final static Method GET_INDEX = ReflectionUtils
private static final Method GET_INDEX = ReflectionUtils
.findMethod(NetworkInterface.class, "getIndex");
private final Log log = LogFactory.getLog(MacAddressUserId.class);

View File

@@ -53,7 +53,7 @@ import org.springframework.vault.support.JsonMapFlattener;
public class LeaseAwareVaultPropertySource
extends EnumerablePropertySource<VaultOperations> {
private final static Log logger = LogFactory
private static final Log logger = LogFactory
.getLog(LeaseAwareVaultPropertySource.class);
private final SecretLeaseContainer secretLeaseContainer;

View File

@@ -45,7 +45,7 @@ import org.springframework.vault.support.VaultResponse;
*/
public class VaultPropertySource extends EnumerablePropertySource<VaultOperations> {
private final static Log logger = LogFactory.getLog(VaultPropertySource.class);
private static final Log logger = LogFactory.getLog(VaultPropertySource.class);
private final String path;

View File

@@ -20,8 +20,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
@@ -118,14 +118,14 @@ import org.springframework.web.client.RestOperations;
public class SecretLeaseContainer extends SecretLeaseEventPublisher implements
InitializingBean, DisposableBean {
private final static AtomicIntegerFieldUpdater<SecretLeaseContainer> UPDATER = AtomicIntegerFieldUpdater
private static final AtomicIntegerFieldUpdater<SecretLeaseContainer> UPDATER = AtomicIntegerFieldUpdater
.newUpdater(SecretLeaseContainer.class, "status");
private static final AtomicInteger poolId = new AtomicInteger();
private final static int STATUS_INITIAL = 0;
private final static int STATUS_STARTED = 1;
private final static int STATUS_DESTROYED = 2;
private static final int STATUS_INITIAL = 0;
private static final int STATUS_STARTED = 1;
private static final int STATUS_DESTROYED = 2;
private final List<RequestedSecret> requestedSecrets = new CopyOnWriteArrayList<RequestedSecret>();
@@ -691,11 +691,11 @@ public class SecretLeaseContainer extends SecretLeaseEventPublisher implements
*/
static class OneShotTrigger implements Trigger {
private final static AtomicIntegerFieldUpdater<OneShotTrigger> UPDATER = AtomicIntegerFieldUpdater
private static final AtomicIntegerFieldUpdater<OneShotTrigger> UPDATER = AtomicIntegerFieldUpdater
.newUpdater(OneShotTrigger.class, "status");
private final static int STATUS_ARMED = 0;
private final static int STATUS_FIRED = 1;
private static final int STATUS_ARMED = 0;
private static final int STATUS_FIRED = 1;
// see AtomicIntegerFieldUpdater UPDATER
private volatile int status = 0;

View File

@@ -24,7 +24,7 @@ import org.springframework.util.Assert;
*/
public class Lease {
private final static Lease NONE = new Lease(null, 0, false);
private static final Lease NONE = new Lease(null, 0, false);
private final String leaseId;

View File

@@ -183,40 +183,40 @@ class KeystoreUtil {
private static class DerParser {
// Classes
public final static int UNIVERSAL = 0x00;
public final static int APPLICATION = 0x40;
public final static int CONTEXT = 0x80;
public final static int PRIVATE = 0xC0;
public static final int UNIVERSAL = 0x00;
public static final int APPLICATION = 0x40;
public static final int CONTEXT = 0x80;
public static final int PRIVATE = 0xC0;
// Constructed Flag
public final static int CONSTRUCTED = 0x20;
public static final int CONSTRUCTED = 0x20;
// Tag and data types
public final static int ANY = 0x00;
public final static int BOOLEAN = 0x01;
public final static int INTEGER = 0x02;
public final static int BIT_STRING = 0x03;
public final static int OCTET_STRING = 0x04;
public final static int NULL = 0x05;
public final static int REAL = 0x09;
public final static int ENUMERATED = 0x0a;
public static final int ANY = 0x00;
public static final int BOOLEAN = 0x01;
public static final int INTEGER = 0x02;
public static final int BIT_STRING = 0x03;
public static final int OCTET_STRING = 0x04;
public static final int NULL = 0x05;
public static final int REAL = 0x09;
public static final int ENUMERATED = 0x0a;
public final static int SEQUENCE = 0x10;
public final static int SET = 0x11;
public static final int SEQUENCE = 0x10;
public static final int SET = 0x11;
public final static int NUMERIC_STRING = 0x12;
public final static int PRINTABLE_STRING = 0x13;
public final static int VIDEOTEX_STRING = 0x15;
public final static int IA5_STRING = 0x16;
public final static int GRAPHIC_STRING = 0x19;
public final static int ISO646_STRING = 0x1A;
public final static int GENERAL_STRING = 0x1B;
public static final int NUMERIC_STRING = 0x12;
public static final int PRINTABLE_STRING = 0x13;
public static final int VIDEOTEX_STRING = 0x15;
public static final int IA5_STRING = 0x16;
public static final int GRAPHIC_STRING = 0x19;
public static final int ISO646_STRING = 0x1A;
public static final int GENERAL_STRING = 0x1B;
public final static int UTF8_STRING = 0x0C;
public final static int UNIVERSAL_STRING = 0x1C;
public final static int BMP_STRING = 0x1E;
public static final int UTF8_STRING = 0x0C;
public static final int UNIVERSAL_STRING = 0x1C;
public static final int BMP_STRING = 0x1E;
public final static int UTC_TIME = 0x17;
public static final int UTC_TIME = 0x17;
protected InputStream in;

View File

@@ -97,7 +97,7 @@ public class CubbyholeAuthenticationIntegrationTests extends IntegrationTestSupp
fail("Missing VaultException");
}
catch (VaultException e) {
assertThat(e).hasMessageContaining("Cannot retrieve Token from cubbyhole")
assertThat(e).hasMessageContaining("Cannot retrieve Token from Cubbyhole")
.hasMessageContaining("permission denied");
}
}

View File

@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@SuppressWarnings("unchecked")
public class JsonMapFlattenerUnitTests {
private final static ObjectMapper objectMapper = new ObjectMapper();
private static final ObjectMapper objectMapper = new ObjectMapper();
@Test
public void shouldPreserveFlatMap() throws Exception {
@@ -98,4 +98,4 @@ public class JsonMapFlattenerUnitTests {
assertThat(result).containsEntry("key.level1[0].nested", "value").containsEntry(
"key.level1[1].nested", "other-value");
}
}
}