Skip to content

Commit 9827fb8

Browse files
author
Xing Lin
committed
Moved suppressWarning to a separate line
1 parent dc6e9bd commit 9827fb8

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestObserverReadProxyProvider.java

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,11 @@ public void testGetHAServiceStateWithTimeout() throws Exception {
366366

367367
setupProxyProvider(1, NAMENODE_HA_STATE_PROBE_TIMEOUT_SHORT);
368368
final HAServiceState state = HAServiceState.STANDBY;
369-
@SuppressWarnings("unchecked") NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
369+
@SuppressWarnings("unchecked")
370+
NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
370371
(NNProxyInfo<ClientProtocol>) mock(NNProxyInfo.class);
371-
@SuppressWarnings("unchecked") Future<HAServiceState> task = mock(Future.class);
372+
@SuppressWarnings("unchecked")
373+
Future<HAServiceState> task = mock(Future.class);
372374
when(task.get(anyLong(), any(TimeUnit.class))).thenReturn(state);
373375

374376
HAServiceState state2 = proxyProvider.getHAServiceStateWithTimeout(dummyNNProxyInfo, task);
@@ -388,9 +390,11 @@ public void testTimeoutExceptionGetHAServiceStateWithTimeout() throws Exception
388390
proxyLog.clearOutput();
389391

390392
setupProxyProvider(1, NAMENODE_HA_STATE_PROBE_TIMEOUT_SHORT);
391-
@SuppressWarnings("unchecked") NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
393+
@SuppressWarnings("unchecked")
394+
NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
392395
(NNProxyInfo<ClientProtocol>) Mockito.mock(NNProxyInfo.class);
393-
@SuppressWarnings("unchecked") Future<HAServiceState> task = mock(Future.class);
396+
@SuppressWarnings("unchecked")
397+
Future<HAServiceState> task = mock(Future.class);
394398
TimeoutException e = new TimeoutException("Timeout");
395399
when(task.get(anyLong(), any(TimeUnit.class))).thenThrow(e);
396400

@@ -412,9 +416,11 @@ public void testInterruptedExceptionGetHAServiceStateWithTimeout() throws Except
412416
proxyLog.clearOutput();
413417

414418
setupProxyProvider(1, NAMENODE_HA_STATE_PROBE_TIMEOUT_SHORT);
415-
@SuppressWarnings("unchecked") NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
419+
@SuppressWarnings("unchecked")
420+
NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
416421
(NNProxyInfo<ClientProtocol>) Mockito.mock(NNProxyInfo.class);
417-
@SuppressWarnings("unchecked") Future<HAServiceState> task = mock(Future.class);
422+
@SuppressWarnings("unchecked")
423+
Future<HAServiceState> task = mock(Future.class);
418424
InterruptedException e = new InterruptedException("Interrupted");
419425
when(task.get(anyLong(), any(TimeUnit.class))).thenThrow(e);
420426

@@ -435,9 +441,11 @@ public void testExecutionExceptionGetHAServiceStateWithTimeout() throws Exceptio
435441
proxyLog.clearOutput();
436442

437443
setupProxyProvider(1, NAMENODE_HA_STATE_PROBE_TIMEOUT_SHORT);
438-
@SuppressWarnings("unchecked") NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
444+
@SuppressWarnings("unchecked")
445+
NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
439446
(NNProxyInfo<ClientProtocol>) Mockito.mock(NNProxyInfo.class);
440-
@SuppressWarnings("unchecked") Future<HAServiceState> task = mock(Future.class);
447+
@SuppressWarnings("unchecked")
448+
Future<HAServiceState> task = mock(Future.class);
441449
Exception e = new ExecutionException(new InterruptedException("Interrupted"));
442450
when(task.get(anyLong(), any(TimeUnit.class))).thenThrow(e);
443451

@@ -459,9 +467,11 @@ public void testGetHAServiceStateWithoutTimeout() throws Exception {
459467
setupProxyProvider(1, 0);
460468

461469
final HAServiceState state = HAServiceState.STANDBY;
462-
@SuppressWarnings("unchecked") NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
470+
@SuppressWarnings("unchecked")
471+
NNProxyInfo<ClientProtocol> dummyNNProxyInfo =
463472
(NNProxyInfo<ClientProtocol>) mock(NNProxyInfo.class);
464-
@SuppressWarnings("unchecked") Future<HAServiceState> task = mock(Future.class);
473+
@SuppressWarnings("unchecked")
474+
Future<HAServiceState> task = mock(Future.class);
465475
when(task.get()).thenReturn(state);
466476

467477
HAServiceState state2 = proxyProvider.getHAServiceStateWithTimeout(dummyNNProxyInfo, task);

0 commit comments

Comments
 (0)