Scala: fix some warnings

wire-gradle
Georg Lukas 2019-12-30 15:16:11 +01:00
rodzic aafb3ec855
commit 9bc3ccf925
4 zmienionych plików z 5 dodań i 7 usunięć

Wyświetl plik

@ -164,8 +164,6 @@ class MessageActivity extends StationHelper(R.string.app_messages)
view.getId match { view.getId match {
case R.id.msgsend => case R.id.msgsend =>
sendMessage() sendMessage()
true
case _ => false
} }
} }

Wyświetl plik

@ -9,7 +9,7 @@ import _root_.android.graphics.Color
object ServiceNotifier { object ServiceNotifier {
val instance = if (Build.VERSION.SDK.toInt < 5) new DonutNotifier() else new EclairNotifier() val instance = if (Build.VERSION.SDK_INT < 5) new DonutNotifier() else new EclairNotifier()
} }
abstract class ServiceNotifier { abstract class ServiceNotifier {

Wyświetl plik

@ -121,7 +121,7 @@ class BluetoothTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBack
log("Reconnecting in 3s...") log("Reconnecting in 3s...")
try { try {
Thread.sleep(3*1000) Thread.sleep(3*1000)
} catch { case _ => } } catch { case _ : InterruptedException => }
init_socket() init_socket()
need_reconnect = false need_reconnect = false
service.postLinkOn(R.string.p_link_bt) service.postLinkOn(R.string.p_link_bt)
@ -143,7 +143,7 @@ class BluetoothTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBack
service.postAddPost(StorageDatabase.Post.TYPE_INFO, service.postAddPost(StorageDatabase.Post.TYPE_INFO,
R.string.post_error, e.toString()) R.string.post_error, e.toString())
e.printStackTrace() e.printStackTrace()
} catch { case _ => Log.d(TAG, "Yo dawg! I got an exception while getting an exception!") } catch { case _ : Exception => Log.d(TAG, "Yo dawg! I got an exception while getting an exception!")
} }
} }
} }
@ -154,7 +154,7 @@ class BluetoothTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBack
try { try {
proto.writePacket(packet) proto.writePacket(packet)
"Bluetooth OK" "Bluetooth OK"
} catch { case e => e.printStackTrace(); conn.socket.close(); "Bluetooth disconnected" } } catch { case e : Exception => e.printStackTrace(); conn.socket.close(); "Bluetooth disconnected" }
} }
def catchLog(tag : String, fun : ()=>Unit) { def catchLog(tag : String, fun : ()=>Unit) {

Wyświetl plik

@ -50,7 +50,7 @@ class KissProto(service : AprsService, is : InputStream, os : OutputStream) exte
try { try {
return Parser.parseAX25(buf.toArray).toString().trim() return Parser.parseAX25(buf.toArray).toString().trim()
} catch { } catch {
case e => buf.clear() case e : Exception => buf.clear()
} }
} }
case FESC => is.read() match { case FESC => is.read() match {