File tree Expand file tree Collapse file tree
atplug-runtime/src/main/java/com/diffplug/atplug Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 */
77package com.diffplug.atplug
88
9- import java.io.EOFException
109import java.lang.Exception
1110import java.lang.IllegalArgumentException
1211import java.lang.RuntimeException
@@ -189,15 +188,13 @@ abstract class SocketOwner<T>(val socketClass: Class<T>) {
189188 return generatorForSocket(socket)
190189 }
191190 } catch (e: Throwable ) {
192- rethrowIfEOF(e)
193191 firstAttempt = e
194192 }
195193 try {
196194 val socketOwnerClass = Class .forName(socketClass.name + " \$ Socket" ).kotlin
197195 val socket = socketOwnerClass.objectInstance!! as SocketOwner <T >
198196 return generatorForSocket(socket)
199197 } catch (secondAttempt: Throwable ) {
200- rethrowIfEOF(secondAttempt)
201198 val e =
202199 IllegalArgumentException (
203200 " To create metadata for `$socketClass ` we need either a field `static final SocketOwner socket` or a kotlin `object Socket`." ,
@@ -207,12 +204,6 @@ abstract class SocketOwner<T>(val socketClass: Class<T>) {
207204 }
208205 }
209206
210- private fun rethrowIfEOF (exception : Throwable ) {
211- if (rootCause(exception) is EOFException ) {
212- throw Error (" The JVM needs to be restarted (gradew --stop) to fix" , exception)
213- }
214- }
215-
216207 private fun <T > generatorForSocket (socket : SocketOwner <T >): Function <T , String > {
217208 return Function { plug ->
218209 try {
You can’t perform that action at this time.
0 commit comments