Skip to content

Commit cf57acb

Browse files
author
fanshilun
committed
HADOOP-19415. Fix CheckStyle.
1 parent f5f0159 commit cf57acb

32 files changed

+141
-145
lines changed

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestContentSummary.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ public void testConstructorWithQuota() {
5858
spaceConsumed(spaceConsumed).spaceQuota(spaceQuota).build();
5959
assertEquals(length, contentSummary.getLength(), "getLength");
6060
assertEquals(fileCount, contentSummary.getFileCount(), "getFileCount");
61-
assertEquals(directoryCount,
62-
contentSummary.getDirectoryCount(), "getDirectoryCount");
61+
assertEquals(directoryCount, contentSummary.getDirectoryCount(), "getDirectoryCount");
6362
assertEquals(quota, contentSummary.getQuota(), "getQuota");
6463
assertEquals(spaceConsumed,
6564
contentSummary.getSpaceConsumed(), "getSpaceConsumed");
@@ -131,11 +130,9 @@ public void testReadFields() throws IOException {
131130
contentSummary.readFields(in);
132131
assertEquals(length, contentSummary.getLength(), "getLength");
133132
assertEquals(fileCount, contentSummary.getFileCount(), "getFileCount");
134-
assertEquals(directoryCount,
135-
contentSummary.getDirectoryCount(), "getDirectoryCount");
133+
assertEquals(directoryCount, contentSummary.getDirectoryCount(), "getDirectoryCount");
136134
assertEquals(quota, contentSummary.getQuota(), "getQuota");
137-
assertEquals(spaceConsumed,
138-
contentSummary.getSpaceConsumed(), "getSpaceConsumed");
135+
assertEquals(spaceConsumed, contentSummary.getSpaceConsumed(), "getSpaceConsumed");
139136
assertEquals(spaceQuota, contentSummary.getSpaceQuota(), "getSpaceQuota");
140137
}
141138

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDFVariations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ public void testGetMountCurrentDirectory() throws Exception {
162162
String mountPath = df.getMount();
163163
File mountDir = new File(mountPath);
164164
assertTrue(mountDir.exists(), "Mount dir ["+mountDir.getAbsolutePath()+"] should exist.");
165-
assertTrue(mountDir.isDirectory(),
165+
assertTrue(mountDir.isDirectory(),
166166
"Mount dir ["+mountDir.getAbsolutePath()+"] should be directory.");
167-
assertTrue(workingDir.startsWith(mountPath),
167+
assertTrue(workingDir.startsWith(mountPath),
168168
"Working dir ["+workingDir+"] should start with ["+mountPath+"].");
169169
}
170170
}

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDU.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void testDU() throws IOException, InterruptedException {
9191
long duSize = du.getUsed();
9292
du.close();
9393

94-
assertTrue(duSize >= writtenSize && writtenSize <= (duSize + slack),
94+
assertTrue(duSize >= writtenSize && writtenSize <= (duSize + slack),
9595
"Invalid on-disk size");
9696

9797
//test with 0 interval, will not launch thread
@@ -100,15 +100,15 @@ public void testDU() throws IOException, InterruptedException {
100100
duSize = du.getUsed();
101101
du.close();
102102

103-
assertTrue(duSize >= writtenSize && writtenSize <= (duSize + slack),
103+
assertTrue(duSize >= writtenSize && writtenSize <= (duSize + slack),
104104
"Invalid on-disk size");
105105

106106
//test without launching thread
107107
du = new DU(file, 10000, 0, -1);
108108
du.init();
109109
duSize = du.getUsed();
110110

111-
assertTrue(duSize >= writtenSize && writtenSize <= (duSize + slack),
111+
assertTrue(duSize >= writtenSize && writtenSize <= (duSize + slack),
112112
"Invalid on-disk size");
113113
}
114114

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegationTokenRenewer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public Long answer(InvocationOnMock invocation) {
7979

8080
renewer.addRenewAction(fs);
8181

82-
assertEquals(1, renewer.getRenewQueueLength(),
82+
assertEquals(1, renewer.getRenewQueueLength(),
8383
"FileSystem not added to DelegationTokenRenewer");
8484

8585
Thread.sleep(RENEW_CYCLE*2);
@@ -92,7 +92,7 @@ public Long answer(InvocationOnMock invocation) {
9292
verify(fs, never()).getDelegationToken(null);
9393
verify(fs, never()).setDelegationToken(any());
9494

95-
assertEquals(0, renewer.getRenewQueueLength(),
95+
assertEquals(0, renewer.getRenewQueueLength(),
9696
"FileSystem not removed from DelegationTokenRenewer");
9797
}
9898

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileSystemStorageStatistics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class TestFileSystemStorageStatistics {
6060
new FileSystem.Statistics("test-scheme");
6161
private FileSystemStorageStatistics storageStatistics =
6262
new FileSystemStorageStatistics(FS_STORAGE_STATISTICS_NAME, statistics);
63-
63+
6464
@BeforeEach
6565
public void setup() {
6666
statistics.incrementBytesRead(RandomUtils.nextInt(0, 100));

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFilterFileSystem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ public void testFilterPathCapabilites() throws Exception {
307307
try (FilterFileSystem flfs = new FilterLocalFileSystem()) {
308308
flfs.initialize(URI.create("filter:/"), conf);
309309
Path src = new Path("/src");
310-
assertFalse(flfs.hasPathCapability(src, CommonPathCapabilities.FS_MULTIPART_UPLOADER),
311-
"hasPathCapability(FS_MULTIPART_UPLOADER) should have failed for " + flfs);
310+
assertFalse(flfs.hasPathCapability(src, CommonPathCapabilities.FS_MULTIPART_UPLOADER),
311+
"hasPathCapability(FS_MULTIPART_UPLOADER) should have failed for " + flfs);
312312
}
313313
}
314314

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShellReturnCode.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private void change(int exit, String owner, String group, String...files)
109109
assertEquals(((owner != null) ? "STUB-"+owner : oldStats[i][j].getOwner()),
110110
stats[j].getOwner(), "check owner of " + files[i]);
111111
assertEquals(((group != null) ? "STUB-"+group : oldStats[i][j].getGroup()),
112-
stats[j].getGroup(), "check group of " + files[i]);
112+
stats[j].getGroup(), "check group of " + files[i]);
113113
}
114114
}
115115
}
@@ -310,7 +310,8 @@ public void testGetWithInvalidSourcePathShouldNotDisplayNullInConsole()
310310
results = bytes.toString();
311311
assertEquals(1, run, "Return code should be 1");
312312
assertTrue(!results.contains("get: null"), " Null is coming when source path is invalid. ");
313-
assertTrue(results.contains("get: `"+args[1]+"': No such file or directory"), " Not displaying the intended message ");
313+
assertTrue(results.contains("get: `" + args[1] + "': No such file or directory"),
314+
" Not displaying the intended message ");
314315
} finally {
315316
IOUtils.closeStream(out);
316317
System.setErr(oldErr);

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobExpander.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ private void checkExpansionIsIdentical(String filePattern) throws IOException {
5555
private void checkExpansion(String filePattern, String... expectedExpansions)
5656
throws IOException {
5757
List<String> actualExpansions = GlobExpander.expand(filePattern);
58-
assertEquals(expectedExpansions.length,
58+
assertEquals(expectedExpansions.length,
5959
actualExpansions.size(), "Different number of expansions");
6060
for (int i = 0; i < expectedExpansions.length; i++) {
61-
assertEquals(expectedExpansions[i],
61+
assertEquals(expectedExpansions[i],
6262
actualExpansions.get(i), "Expansion of " + filePattern);
6363
}
6464
}

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestHarFileSystemBasics.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public void testListLocatedStatus() throws Exception {
260260
assertTrue(expectedFileNames.contains(fileName), fileName + " not in expected files list");
261261
expectedFileNames.remove(fileName);
262262
}
263-
assertEquals(0, expectedFileNames.size(),
263+
assertEquals(0, expectedFileNames.size(),
264264
"Didn't find all of the expected file names: " + expectedFileNames);
265265
}
266266

@@ -274,7 +274,7 @@ public void testMakeQualifiedPath() throws Exception {
274274
+ harPath.toUri().getPath().toString();
275275
Path path = new Path(harPathWithUserinfo);
276276
Path qualifiedPath = path.getFileSystem(conf).makeQualified(path);
277-
assertTrue(qualifiedPath.toString().equals(harPathWithUserinfo),
277+
assertTrue(qualifiedPath.toString().equals(harPathWithUserinfo),
278278
String.format("The qualified path (%s) did not match the expected path (%s).",
279279
qualifiedPath.toString(), harPathWithUserinfo));
280280
}

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestListFiles.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,17 @@ public void testDirectory() throws IOException {
162162
itor = fs.listFiles(TEST_DIR, true);
163163
stat = itor.next();
164164
assertTrue(stat.isFile());
165-
assertTrue(filesToFind.remove(stat.getPath()),
165+
assertTrue(filesToFind.remove(stat.getPath()),
166166
"Path " + stat.getPath() + " unexpected");
167167

168168
stat = itor.next();
169169
assertTrue(stat.isFile());
170-
assertTrue(filesToFind.remove(stat.getPath()),
170+
assertTrue(filesToFind.remove(stat.getPath()),
171171
"Path " + stat.getPath() + " unexpected");
172172

173173
stat = itor.next();
174174
assertTrue(stat.isFile());
175-
assertTrue(filesToFind.remove(stat.getPath()),
175+
assertTrue(filesToFind.remove(stat.getPath()),
176176
"Path " + stat.getPath() + " unexpected");
177177
assertFalse(itor.hasNext());
178178
assertTrue(filesToFind.isEmpty());

0 commit comments

Comments
 (0)