HBASE-20707 Move MissingSwitchDefault case check
Perform this check using error-prone instead of checkstyle because the former can handle enum switches somewhat more intelligently.
This commit is contained in:
parent
573b57d437
commit
eb13cdd7ed
|
@ -83,6 +83,7 @@
|
||||||
<arg>-XepDisableWarningsInGeneratedCode</arg>
|
<arg>-XepDisableWarningsInGeneratedCode</arg>
|
||||||
<arg>-Xep:FallThrough:OFF</arg> <!-- already in findbugs -->
|
<arg>-Xep:FallThrough:OFF</arg> <!-- already in findbugs -->
|
||||||
<arg>-Xep:ClassNewInstance:ERROR</arg>
|
<arg>-Xep:ClassNewInstance:ERROR</arg>
|
||||||
|
<arg>-Xep:MissingDefault:ERROR</arg>
|
||||||
</compilerArgs>
|
</compilerArgs>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
<path>
|
<path>
|
||||||
|
|
|
@ -61,7 +61,6 @@
|
||||||
<module name="EqualsHashCode"/>
|
<module name="EqualsHashCode"/>
|
||||||
<module name="IllegalInstantiation"/>
|
<module name="IllegalInstantiation"/>
|
||||||
<module name="InnerAssignment"/>
|
<module name="InnerAssignment"/>
|
||||||
<module name="MissingSwitchDefault"/>
|
|
||||||
<module name="NoFinalizer"/>
|
<module name="NoFinalizer"/>
|
||||||
|
|
||||||
<!-- Import Checks
|
<!-- Import Checks
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class JenkinsHash extends Hash {
|
||||||
* <p>Use for hash table lookup, or anything where one collision in 2^^32 is
|
* <p>Use for hash table lookup, or anything where one collision in 2^^32 is
|
||||||
* acceptable. Do NOT use for cryptographic purposes.
|
* acceptable. Do NOT use for cryptographic purposes.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("fallthrough")
|
@SuppressWarnings({"fallthrough", "MissingDefault"})
|
||||||
@Override
|
@Override
|
||||||
public <T> int hash(HashKey<T> hashKey, int initval) {
|
public <T> int hash(HashKey<T> hashKey, int initval) {
|
||||||
int length = hashKey.length();
|
int length = hashKey.length();
|
||||||
|
|
|
@ -78,6 +78,8 @@ public class MurmurHash3 extends Hash {
|
||||||
k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15);
|
k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15);
|
||||||
k1 *= c2;
|
k1 *= c2;
|
||||||
h1 ^= k1;
|
h1 ^= k1;
|
||||||
|
default:
|
||||||
|
// fall out
|
||||||
}
|
}
|
||||||
|
|
||||||
// finalization
|
// finalization
|
||||||
|
|
|
@ -306,7 +306,8 @@ public class ExpressionParser {
|
||||||
return Operator.OR;
|
return Operator.OR;
|
||||||
case NOT:
|
case NOT:
|
||||||
return Operator.NOT;
|
return Operator.NOT;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ public class TestClusterStatusPublisher {
|
||||||
@Test
|
@Test
|
||||||
public void testMaxSend() {
|
public void testMaxSend() {
|
||||||
ClusterStatusPublisher csp = new ClusterStatusPublisher() {
|
ClusterStatusPublisher csp = new ClusterStatusPublisher() {
|
||||||
|
@SuppressWarnings("MissingDefault")
|
||||||
@Override
|
@Override
|
||||||
protected List<Pair<ServerName, Long>> getDeadServers(long since) {
|
protected List<Pair<ServerName, Long>> getDeadServers(long since) {
|
||||||
List<Pair<ServerName, Long>> res = new ArrayList<>();
|
List<Pair<ServerName, Long>> res = new ArrayList<>();
|
||||||
|
|
|
@ -765,6 +765,8 @@ public class TestAssignmentManager {
|
||||||
case 0: throw new ServerNotRunningYetException("wait on server startup");
|
case 0: throw new ServerNotRunningYetException("wait on server startup");
|
||||||
case 1: throw new SocketTimeoutException("simulate socket timeout");
|
case 1: throw new SocketTimeoutException("simulate socket timeout");
|
||||||
case 2: throw new RemoteException("java.io.IOException", "unexpected exception");
|
case 2: throw new RemoteException("java.io.IOException", "unexpected exception");
|
||||||
|
default:
|
||||||
|
// fall out
|
||||||
}
|
}
|
||||||
return super.sendRequest(server, req);
|
return super.sendRequest(server, req);
|
||||||
}
|
}
|
||||||
|
@ -785,6 +787,8 @@ public class TestAssignmentManager {
|
||||||
LOG.info("Return transition report that FAILED_OPEN/FAILED_OPENING response");
|
LOG.info("Return transition report that FAILED_OPEN/FAILED_OPENING response");
|
||||||
sendTransitionReport(server, openReq.getRegion(), TransitionCode.FAILED_OPEN);
|
sendTransitionReport(server, openReq.getRegion(), TransitionCode.FAILED_OPEN);
|
||||||
return OpenRegionResponse.RegionOpeningState.FAILED_OPENING;
|
return OpenRegionResponse.RegionOpeningState.FAILED_OPENING;
|
||||||
|
default:
|
||||||
|
// fall out
|
||||||
}
|
}
|
||||||
// The procedure on master will just hang forever because nothing comes back
|
// The procedure on master will just hang forever because nothing comes back
|
||||||
// from the RS in this case.
|
// from the RS in this case.
|
||||||
|
|
Loading…
Reference in New Issue