hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matteo Bertozzi <theo.berto...@gmail.com>
Subject Re: A checkstyle question: indentation in switch-case statements
Date Wed, 04 May 2016 14:20:50 GMT
I think it is complaining because the "case" is aligned with the "switch"
and not indented

Matteo


On Wed, May 4, 2016 at 7:13 AM, Stephen Jiang <syuanjiangdev@gmail.com>
wrote:

> I got two checkstyle warning for the style of switch-case statements:
>
>
> ./hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/AddColumnFamilyProcedure.java:386:
>            cpHost.preAddColumnFamilyAction(tableName, cfDescriptor);:
> error: 'block' child have incorrect indentation level 12, expected
> level should be one of the following: 14, 16.
>
> ./hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/AddColumnFamilyProcedure.java:386:
>            cpHost.preAddColumnFamilyAction(tableName, cfDescriptor);:
> error: 'method call' child have incorrect indentation level 12,
> expected level should be one of the following: 14, 16.
>
> To me, the 2-space indentation looks correct.  What is wrong for this style
> (switch and case are in the same level, is this wrong?  I set up HBASE
> coding style in eclipse and it automatically did it this way)?
>
>           switch (state) {
>
>           case ADD_COLUMN_FAMILY_PRE_OPERATION:
>
>             cpHost.preAddColumnFamilyAction(tableName, cfDescriptor);
>
>             break;
>
>           case ADD_COLUMN_FAMILY_POST_OPERATION:
>
>             cpHost.postCompletedAddColumnFamilyAction(tableName,
> cfDescriptor);
>
>             break;
>
>           default:
>
>             throw new UnsupportedOperationException(this + " unhandled
> state=" + state);
>
>           }
>
>
> Any insight would be helpful.
>
> Thanks
>
> Stephen
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message