Skip to content

Commit 6868280

Browse files
committed
Revert "SocketOwner now gives a more helpful exception when the problem is "java.io.EOFException: Unexpected end of ZLIB input stream""
This reverts commit d3641a3.
1 parent a8b2a64 commit 6868280

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

atplug-runtime/src/main/java/com/diffplug/atplug/SocketOwner.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
package com.diffplug.atplug
88

9-
import java.io.EOFException
109
import java.lang.Exception
1110
import java.lang.IllegalArgumentException
1211
import 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 {

0 commit comments

Comments
 (0)