style: use uppercase L instead of lowercase version for better readability

This commit is contained in:
broDom
2017-07-03 17:16:54 +02:00
parent c91b3a39cd
commit efac49ccf7
22 changed files with 48 additions and 48 deletions

View File

@@ -701,7 +701,7 @@ public class ScmConfiguration
* @since 1.34
*/
@XmlElement(name = "login-attempt-limit-timeout")
private long loginAttemptLimitTimeout = TimeUnit.MINUTES.toSeconds(5l);
private long loginAttemptLimitTimeout = TimeUnit.MINUTES.toSeconds(5L);
/** Field description */
private boolean enableProxy = false;

View File

@@ -46,7 +46,7 @@ public final class Base32 extends AbstractBase
{
/** base value */
private static final BigInteger BASE = BigInteger.valueOf(32l);
private static final BigInteger BASE = BigInteger.valueOf(32L);
/** char table */
private static final String CHARS = "0123456789bcdefghjkmnpqrstuvwxyz";

View File

@@ -46,7 +46,7 @@ public final class Base62 extends AbstractBase
{
/** base value */
private static final BigInteger BASE = BigInteger.valueOf(62l);
private static final BigInteger BASE = BigInteger.valueOf(62L);
/** char table */
private static final String CHARS =

View File

@@ -58,7 +58,7 @@ public class ByteSourceContentTest {
ByteSource source = ByteSource.wrap("abc".getBytes(Charsets.UTF_8));
ByteSourceContent content = new ByteSourceContent(source);
content.prepare(request);
verify(request).contentLength(3l);
verify(request).contentLength(3L);
}
@Test

View File

@@ -76,7 +76,7 @@ public class FileContentTest
FileContent content = create("abc");
content.prepare(request);
verify(request).contentLength(3l);
verify(request).contentLength(3L);
}
/**

View File

@@ -56,7 +56,7 @@ public class UrlBuilderTest
UrlBuilder builder = new UrlBuilder("http://www.short.de");
builder.appendParameter("i", 123).appendParameter("s", "abc");
builder.appendParameter("b", true).appendParameter("l", 321l);
builder.appendParameter("b", true).appendParameter("l", 321L);
assertEquals("http://www.short.de?i=123&s=abc&b=true&l=321", builder.toString());
builder.appendParameter("c", "a b");
assertEquals("http://www.short.de?i=123&s=abc&b=true&l=321&c=a%20b", builder.toString());

View File

@@ -145,7 +145,7 @@ public class GitPullCommand extends AbstractGitPushOrPullCommand
private PullResponse convert(Git git, FetchResult fetch)
throws RepositoryException
{
long counter = 0l;
long counter = 0L;
for (TrackingRefUpdate tru : fetch.getTrackingRefUpdates())
{

View File

@@ -86,7 +86,7 @@ public class GitPushCommandTest extends AbstractRemoteCommandTestBase
PushResponse response = cmd.push(request);
assertNotNull(response);
assertEquals(2l, response.getChangesetCount());
assertEquals(2L, response.getChangesetCount());
Iterator<RevCommit> commits = incoming.log().call().iterator();

View File

@@ -120,7 +120,7 @@ public class SvnBlameCommand extends AbstractSvnCommand implements BlameCommand
SVNLogClient svnLogClient = new SVNLogClient(svnManager, null);
svnLogClient.doAnnotate(svnurl, SVNRevision.UNDEFINED,
SVNRevision.create(1l), endRevision,
SVNRevision.create(1L), endRevision,
new SvnBlameHandler(svnRepository, path,
blameLines));
}

View File

@@ -98,7 +98,7 @@ public class SvnBundleCommand extends AbstractSvnCommand
try
{
outputStream = target.openBufferedStream();
adminClient.doDump(repository, outputStream, SVNRevision.create(-1l),
adminClient.doDump(repository, outputStream, SVNRevision.create(-1L),
SVNRevision.HEAD, false, false);
}
finally

View File

@@ -203,7 +203,7 @@ public class SvnLogCommand extends AbstractSvnCommand implements LogCommand
*/
private long parseRevision(String v) throws RepositoryException
{
long result = -1l;
long result = -1L;
if (!Strings.isNullOrEmpty(v))
{
@@ -252,7 +252,7 @@ public class SvnLogCommand extends AbstractSvnCommand implements LogCommand
new ChangesetCollector(changesets));
}
return new ChangesetPagingResult((int) (latest + 1l), changesets);
return new ChangesetPagingResult((int) (latest + 1L), changesets);
}
/**
@@ -279,7 +279,7 @@ public class SvnLogCommand extends AbstractSvnCommand implements LogCommand
long endRev = Math.max(endRevision, 0);
long maxRev = repo.getLatestRevision();
if (startRevision >= 0l)
if (startRevision >= 0L)
{
startRev = startRevision;
}

View File

@@ -78,9 +78,9 @@ public class SvnBundleCommandTest extends AbstractSvnCommandTestBase
repository).bundle(req);
assertThat(res, notNullValue());
assertThat(res.getChangesetCount(), is(5l));
assertThat(res.getChangesetCount(), is(5L));
assertTrue("file does not exists", file.exists());
assertThat(file.length(), greaterThan(0l));
assertThat(file.length(), greaterThan(0L));
}
//~--- fields ---------------------------------------------------------------

View File

@@ -87,11 +87,11 @@ public class SvnUnbundleCommandTest extends AbstractSvnCommandTestBase
//J+
assertThat(res, notNullValue());
assertThat(res.getChangesetCount(), is(5l));
assertThat(res.getChangesetCount(), is(5L));
SVNRepository repo = ctx.open();
assertThat(repo.getLatestRevision(), is(5l));
assertThat(repo.getLatestRevision(), is(5L));
SvnUtil.closeSession(repo);
}

View File

@@ -301,7 +301,7 @@ public abstract class UserManagerTestBase
while (!fin)
{
Thread.sleep(100l);
Thread.sleep(100L);
fin = true;
for (MultiThreadTester tester : testers)

View File

@@ -153,7 +153,7 @@ public class ConfigurableLoginAttemptHandler implements LoginAttemptHandler {
}
private boolean isEnabled() {
return (configuration.getLoginAttemptLimit() > 0) && (configuration.getLoginAttemptLimitTimeout() > 0l);
return (configuration.getLoginAttemptLimit() > 0) && (configuration.getLoginAttemptLimitTimeout() > 0L);
}
//~--- inner classes --------------------------------------------------------
@@ -161,7 +161,7 @@ public class ConfigurableLoginAttemptHandler implements LoginAttemptHandler {
private static class LoginAttempt {
private int counter = 0;
private long lastAttempt = -1l;
private long lastAttempt = -1L;
synchronized void increase() {
counter++;
@@ -169,7 +169,7 @@ public class ConfigurableLoginAttemptHandler implements LoginAttemptHandler {
}
synchronized void reset() {
lastAttempt = -1l;
lastAttempt = -1L;
counter = 0;
}

View File

@@ -177,8 +177,8 @@ public abstract class CacheTestBase
// skip test if implementation does not support stats
Assume.assumeTrue( stats != null );
assertEquals("test", stats.getName());
assertEquals(0l, stats.getHitCount());
assertEquals(0l, stats.getMissCount());
assertEquals(0L, stats.getHitCount());
assertEquals(0L, stats.getMissCount());
cache.put("test-1", "test123");
cache.put("test-2", "test456");
cache.get("test-1");
@@ -186,11 +186,11 @@ public abstract class CacheTestBase
cache.get("test-1");
cache.get("test-3");
// check that stats have not changed
assertEquals(0l, stats.getHitCount());
assertEquals(0l, stats.getMissCount());
assertEquals(0L, stats.getHitCount());
assertEquals(0L, stats.getMissCount());
stats = cache.getStatistics();
assertEquals(3l, stats.getHitCount());
assertEquals(1l, stats.getMissCount());
assertEquals(3L, stats.getHitCount());
assertEquals(1L, stats.getMissCount());
assertEquals(0.75d, stats.getHitRate(), 0.0d);
assertEquals(0.25d, stats.getMissRate(), 0.0d);
}

View File

@@ -63,7 +63,7 @@ public class GuavaConfigurationReaderTest
GuavaCacheConfiguration cfg =
readConfiguration("gcache.001.xml").getDefaultCache();
assertCacheValues(cfg, 200l, 1200l, 2400l);
assertCacheValues(cfg, 200L, 1200L, 2400L);
}
/**
@@ -82,10 +82,10 @@ public class GuavaConfigurationReaderTest
//J+
// cache sonia.test.cache.001 override by cache.004.xml
assertCacheValues(getCache(gcm, "sonia.test.cache.001"), 6l, 2l, 8l);
assertCacheValues(getCache(gcm, "sonia.test.cache.002"), 1000l, 120l, 60l);
assertCacheValues(getCache(gcm, "sonia.test.cache.003"), 3000l, 120l,
2400l);
assertCacheValues(getCache(gcm, "sonia.test.cache.001"), 6L, 2L, 8L);
assertCacheValues(getCache(gcm, "sonia.test.cache.002"), 1000L, 120L, 60L);
assertCacheValues(getCache(gcm, "sonia.test.cache.003"), 3000L, 120L,
2400L);
}
/**
@@ -100,8 +100,8 @@ public class GuavaConfigurationReaderTest
// check default
assertCacheValues(getCache(gcm, "sonia.test.cache.001"), 1000l, 60l, 30l);
assertCacheValues(getCache(gcm, "sonia.test.cache.002"), 1000l, 120l, 60l);
assertCacheValues(getCache(gcm, "sonia.test.cache.001"), 1000L, 60L, 30L);
assertCacheValues(getCache(gcm, "sonia.test.cache.002"), 1000L, 120L, 60L);
}
/**
@@ -115,10 +115,10 @@ public class GuavaConfigurationReaderTest
Iterators.forArray("gcache.002.xml",
"gcache.003.xml"));
assertCacheValues(getCache(gcm, "sonia.test.cache.001"), 1000l, 60l, 30l);
assertCacheValues(getCache(gcm, "sonia.test.cache.002"), 1000l, 120l, 60l);
assertCacheValues(getCache(gcm, "sonia.test.cache.003"), 3000l, 120l,
2400l);
assertCacheValues(getCache(gcm, "sonia.test.cache.001"), 1000L, 60L, 30L);
assertCacheValues(getCache(gcm, "sonia.test.cache.002"), 1000L, 120L, 60L);
assertCacheValues(getCache(gcm, "sonia.test.cache.003"), 3000L, 120L,
2400L);
}
/**
@@ -131,7 +131,7 @@ public class GuavaConfigurationReaderTest
GuavaCacheConfiguration cfg =
readConfiguration("gcache.001.xml").getCaches().get(0);
assertCacheValues(cfg, 1000l, 60l, 30l);
assertCacheValues(cfg, 1000L, 60L, 30L);
}
/**
@@ -144,7 +144,7 @@ public class GuavaConfigurationReaderTest
GuavaCacheConfiguration cfg =
readConfiguration("gcache.002.xml").getCaches().get(0);
assertCacheValues(cfg, 1000l, 120l, 60l);
assertCacheValues(cfg, 1000L, 120L, 60L);
}
/**

View File

@@ -193,7 +193,7 @@ public class ChangesetViewerITCase extends AbstractAdminITCaseBase
if (sleep) {
// cache clear is async
Thread.sleep(500l);
Thread.sleep(500L);
}
ChangesetPagingResult cpr = getChangesets(repository);

View File

@@ -122,7 +122,7 @@ public abstract class HttpCacheITCaseBase<T>
long lastModified = getLastModified(response);
// wait 1 second because http date is not millisecond precision
Thread.sleep(1000l);
Thread.sleep(1000L);
item = createSampleItem();
response = getCollectionResponse();

View File

@@ -188,7 +188,7 @@ public class BearerRealmTest
resolveKey(key);
Date exp = new Date(System.currentTimeMillis() - 600l);
Date exp = new Date(System.currentTimeMillis() - 600L);
String compact = createCompactToken(trillian.getName(), key, exp, Scope.empty());
realm.doGetAuthenticationInfo(BearerToken.valueOf(compact));

View File

@@ -74,7 +74,7 @@ public class ConfigurableLoginAttemptHandlerTest {
handler.onUnsuccessfulAuthentication(token, new SimpleAuthenticationInfo());
handler.beforeAuthentication(token);
handler.onUnsuccessfulAuthentication(token, new SimpleAuthenticationInfo());
Thread.sleep(TimeUnit.MILLISECONDS.toMillis(1200l));
Thread.sleep(TimeUnit.MILLISECONDS.toMillis(1200L));
handler.beforeAuthentication(token);
}

View File

@@ -132,7 +132,7 @@ public class JwtAccessTokenResolverTest {
resolveKey(secureKey);
// create expired token
Date exp = new Date(System.currentTimeMillis() - 600l);
Date exp = new Date(System.currentTimeMillis() - 600L);
String compact = createCompactToken("trillian", secureKey, exp, Scope.empty());
// expect exception