Skip to content

Commit

Permalink
Drop @throws
Browse files Browse the repository at this point in the history
  • Loading branch information
HMBSbige committed Nov 6, 2019
1 parent 2aed3e4 commit 2b50e85
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 15 deletions.
2 changes: 0 additions & 2 deletions app/src/main/java/com/github/shadowsocks/BaseService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ abstract class BaseService : Service()
}
}

@Throws(NameNotResolvedException::class, NullConnectionException::class)
fun connect()
{
if (profile == null) return
Expand All @@ -163,7 +162,6 @@ abstract class BaseService : Service()
val client = OkHttpClient.Builder()
.dns(object : Dns
{
@Throws(UnknownHostException::class)
override fun lookup(hostname: String): List<InetAddress>
{
val ip = Utils.resolve(hostname, false)
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/com/github/shadowsocks/BaseVpnService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ abstract class BaseVpnService : VpnService()
}
}

@Throws(NameNotResolvedException::class, NullConnectionException::class)
open fun connect()
{
if (profile == null) return
Expand All @@ -191,7 +190,6 @@ abstract class BaseVpnService : VpnService()
val client = OkHttpClient.Builder()
.dns(object : Dns
{
@Throws(UnknownHostException::class)
override fun lookup(hostname: String): List<InetAddress>
{
val ip = Utils.resolve(hostname, false)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/github/shadowsocks/GuardedProcess.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class GuardedProcess(private val cmd: List<String>)
private var process: Process? = null
private var isRestart = false

@Throws(InterruptedException::class)
@JvmOverloads
fun start(onRestartCallback: (() -> Boolean)? = null): GuardedProcess
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class ShadowsocksTileService : TileService()
{
}

@Throws(RemoteException::class)
override fun stateChanged(state: Int, profileName: String?, msg: String?)
{
val tile = qsTile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ class ShadowsocksVpnService : BaseVpnService()
super.startRunner(profile)
}

@Throws(NameNotResolvedException::class)
override fun connect()
{
super.connect()
Expand Down Expand Up @@ -209,7 +208,6 @@ class ShadowsocksVpnService : BaseVpnService()
/**
* Called when the activity is first created.
*/
@Throws(Exception::class)
fun handleConnection()
{
if (!sendFd(startVpn()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ private constructor(builder: OkHttpClient.Builder? = null)
*
* @param request request object
* @return response object
* @throws IOException request exception
*/
@Throws(IOException::class)
fun requestByThread(request: Request): Response
private fun requestByThread(request: Request): Response
{
return mClient!!.newCall(request)
.execute()
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/com/github/shadowsocks/utils/IOUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ object IOUtils
*
* @param inputStream input stream
* @param out output stream
* @throws IOException io write error
*/
@Throws(IOException::class) //TODO: Drop Java
fun copy(inputStream: InputStream, out: OutputStream)
{
val buffer = ByteArray(BUFFER_SIZE)
Expand All @@ -37,9 +35,7 @@ object IOUtils
*
* @param `inputStream` input stream
* @return read failed return ""
* @throws IOException io write error
*/
@Throws(IOException::class)
fun readString(inputStream: InputStream): String
{
val builder = StringBuilder()
Expand Down

0 comments on commit 2b50e85

Please sign in to comment.