checkstyle: Enable and apply AvoidNestedBlocks

This commit is contained in:
Daniel Martí 2015-10-08 17:10:57 +02:00
parent b05ed99c74
commit 1f973a7c88
2 changed files with 16 additions and 20 deletions

View File

@ -747,16 +747,13 @@ public class SwapWorkflowActivity extends AppCompatActivity {
if (service == null) { if (service == null) {
message = "No swap service"; message = "No swap service";
} else { } else {
{
String bluetooth = service.getBluetoothSwap().isConnected() ? "Y" : " N"; String bluetooth = service.getBluetoothSwap().isConnected() ? "Y" : " N";
String wifi = service.getWifiSwap().isConnected() ? "Y" : " N"; String wifi = service.getWifiSwap().isConnected() ? "Y" : " N";
String mdns = service.getWifiSwap().getBonjour().isConnected() ? "Y" : " N"; String mdns = service.getWifiSwap().getBonjour().isConnected() ? "Y" : " N";
message += "Swap { BT: " + bluetooth + ", WiFi: " + wifi + ", mDNS: " + mdns + "}, "; message += "Swap { BT: " + bluetooth + ", WiFi: " + wifi + ", mDNS: " + mdns + "}, ";
}
{
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
String bluetooth = "N/A"; bluetooth = "N/A";
if (adapter != null) { if (adapter != null) {
Map<Integer, String> scanModes = new HashMap<>(3); Map<Integer, String> scanModes = new HashMap<>(3);
scanModes.put(BluetoothAdapter.SCAN_MODE_CONNECTABLE, "CON"); scanModes.put(BluetoothAdapter.SCAN_MODE_CONNECTABLE, "CON");
@ -765,10 +762,9 @@ public class SwapWorkflowActivity extends AppCompatActivity {
bluetooth = "\"" + adapter.getName() + "\" - " + scanModes.get(adapter.getScanMode()); bluetooth = "\"" + adapter.getName() + "\" - " + scanModes.get(adapter.getScanMode());
} }
String wifi = service.getBonjourFinder().isScanning() ? "Y" : " N"; wifi = service.getBonjourFinder().isScanning() ? "Y" : " N";
message += "Find { BT: " + bluetooth + ", WiFi: " + wifi + "}"; message += "Find { BT: " + bluetooth + ", WiFi: " + wifi + "}";
} }
}
Date now = new Date(); Date now = new Date();
Utils.debugLog("Swap Status", now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds() + " " + message); Utils.debugLog("Swap Status", now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds() + " " + message);

View File

@ -49,7 +49,7 @@
<!--<module name="ModifierOrder" />--> <!--<module name="ModifierOrder" />-->
<module name="RedundantModifier" /> <module name="RedundantModifier" />
<!--<module name="AvoidNestedBlocks" />--> <module name="AvoidNestedBlocks" />
<!--<module name="EmptyBlock"> <!--<module name="EmptyBlock">
<property name="option" value="text" /> <property name="option" value="text" />
</module>--> </module>-->