@@ -223,10 +223,12 @@ Response update(final CellSetModel model, final boolean replace) {
223
223
int i = 0 ;
224
224
for (CellModel cell : row .getCells ()) {
225
225
byte [] col = cell .getColumn ();
226
- if (col == null ) try {
227
- col = rowspec .getColumns ()[i ++];
228
- } catch (ArrayIndexOutOfBoundsException e ) {
229
- col = null ;
226
+ if (col == null ) {
227
+ try {
228
+ col = rowspec .getColumns ()[i ++];
229
+ } catch (ArrayIndexOutOfBoundsException e ) {
230
+ col = null ;
231
+ }
230
232
}
231
233
if (col == null ) {
232
234
servlet .getMetrics ().incrementFailedPutRequests (1 );
@@ -263,10 +265,12 @@ Response update(final CellSetModel model, final boolean replace) {
263
265
servlet .getMetrics ().incrementFailedPutRequests (1 );
264
266
return processException (e );
265
267
} finally {
266
- if (table != null ) try {
267
- table .close ();
268
- } catch (IOException ioe ) {
269
- LOG .debug ("Exception received while closing the table" , ioe );
268
+ if (table != null ) {
269
+ try {
270
+ table .close ();
271
+ } catch (IOException ioe ) {
272
+ LOG .debug ("Exception received while closing the table" , ioe );
273
+ }
270
274
}
271
275
}
272
276
}
@@ -334,10 +338,12 @@ Response updateBinary(final byte[] message, final HttpHeaders headers,
334
338
servlet .getMetrics ().incrementFailedPutRequests (1 );
335
339
return processException (e );
336
340
} finally {
337
- if (table != null ) try {
338
- table .close ();
339
- } catch (IOException ioe ) {
340
- LOG .debug ("Exception received while closing the table" , ioe );
341
+ if (table != null ) {
342
+ try {
343
+ table .close ();
344
+ } catch (IOException ioe ) {
345
+ LOG .debug ("Exception received while closing the table" , ioe );
346
+ }
341
347
}
342
348
}
343
349
}
@@ -399,10 +405,11 @@ public Response delete(final @Context UriInfo uriInfo) {
399
405
.build ();
400
406
}
401
407
Delete delete = null ;
402
- if (rowspec .hasTimestamp ())
408
+ if (rowspec .hasTimestamp ()) {
403
409
delete = new Delete (rowspec .getRow (), rowspec .getTimestamp ());
404
- else
410
+ } else {
405
411
delete = new Delete (rowspec .getRow ());
412
+ }
406
413
407
414
for (byte [] column : rowspec .getColumns ()) {
408
415
byte [][] split = CellUtil .parseColumn (column );
@@ -440,10 +447,12 @@ public Response delete(final @Context UriInfo uriInfo) {
440
447
servlet .getMetrics ().incrementFailedDeleteRequests (1 );
441
448
return processException (e );
442
449
} finally {
443
- if (table != null ) try {
444
- table .close ();
445
- } catch (IOException ioe ) {
446
- LOG .debug ("Exception received while closing the table" , ioe );
450
+ if (table != null ) {
451
+ try {
452
+ table .close ();
453
+ } catch (IOException ioe ) {
454
+ LOG .debug ("Exception received while closing the table" , ioe );
455
+ }
447
456
}
448
457
}
449
458
return Response .ok ().build ();
@@ -557,10 +566,12 @@ Response checkAndPut(final CellSetModel model) {
557
566
servlet .getMetrics ().incrementFailedPutRequests (1 );
558
567
return processException (e );
559
568
} finally {
560
- if (table != null ) try {
561
- table .close ();
562
- } catch (IOException ioe ) {
563
- LOG .debug ("Exception received while closing the table" , ioe );
569
+ if (table != null ) {
570
+ try {
571
+ table .close ();
572
+ } catch (IOException ioe ) {
573
+ LOG .debug ("Exception received while closing the table" , ioe );
574
+ }
564
575
}
565
576
}
566
577
}
@@ -687,10 +698,12 @@ Response checkAndDelete(final CellSetModel model) {
687
698
servlet .getMetrics ().incrementFailedDeleteRequests (1 );
688
699
return processException (e );
689
700
} finally {
690
- if (table != null ) try {
691
- table .close ();
692
- } catch (IOException ioe ) {
693
- LOG .debug ("Exception received while closing the table" , ioe );
701
+ if (table != null ) {
702
+ try {
703
+ table .close ();
704
+ } catch (IOException ioe ) {
705
+ LOG .debug ("Exception received while closing the table" , ioe );
706
+ }
694
707
}
695
708
}
696
709
}
@@ -781,10 +794,12 @@ Response append(final CellSetModel model) {
781
794
servlet .getMetrics ().incrementFailedAppendRequests (1 );
782
795
return processException (e );
783
796
} finally {
784
- if (table != null ) try {
785
- table .close ();
786
- } catch (IOException ioe ) {
787
- LOG .debug ("Exception received while closing the table" + table .getName (), ioe );
797
+ if (table != null ) {
798
+ try {
799
+ table .close ();
800
+ } catch (IOException ioe ) {
801
+ LOG .debug ("Exception received while closing the table" + table .getName (), ioe );
802
+ }
788
803
}
789
804
}
790
805
}
@@ -878,10 +893,12 @@ Response increment(final CellSetModel model) {
878
893
servlet .getMetrics ().incrementFailedIncrementRequests (1 );
879
894
return processException (e );
880
895
} finally {
881
- if (table != null ) try {
882
- table .close ();
883
- } catch (IOException ioe ) {
884
- LOG .debug ("Exception received while closing the table " + table .getName (), ioe );
896
+ if (table != null ) {
897
+ try {
898
+ table .close ();
899
+ } catch (IOException ioe ) {
900
+ LOG .debug ("Exception received while closing the table " + table .getName (), ioe );
901
+ }
885
902
}
886
903
}
887
904
}
0 commit comments