@@ -187,7 +187,7 @@ trait Forever {
187
187
}
188
188
189
189
trait Ignorance {
190
- private val readResolve = 42 // no warn special members
190
+ private val readResolve = 42 // warn wrong signatured for special members
191
191
}
192
192
193
193
trait CaseyKasem {
@@ -257,3 +257,31 @@ class `recursive reference is not a usage` {
257
257
def f () = new P ()
258
258
}
259
259
}
260
+
261
+ class `absolve serial framework` extends Serializable :
262
+ import java .io .{IOException , ObjectInputStream , ObjectOutputStream , ObjectStreamException }
263
+ @ throws(classOf [IOException ])
264
+ private def writeObject (stream : ObjectOutputStream ): Unit = ()
265
+ @ throws(classOf [ObjectStreamException ])
266
+ private def writeReplace (): Object = ???
267
+ @ throws(classOf [ClassNotFoundException ])
268
+ @ throws(classOf [IOException ])
269
+ private def readObject (stream : ObjectInputStream ): Unit = ()
270
+ @ throws(classOf [ObjectStreamException ])
271
+ private def readObjectNoData (): Unit = ()
272
+ @ throws(classOf [ObjectStreamException ])
273
+ private def readResolve (): Object = ???
274
+
275
+ class `absolve ONLY serial framework` :
276
+ import java .io .{IOException , ObjectInputStream , ObjectOutputStream , ObjectStreamException }
277
+ @ throws(classOf [IOException ])
278
+ private def writeObject (stream : ObjectOutputStream ): Unit = () // warn
279
+ @ throws(classOf [ObjectStreamException ])
280
+ private def writeReplace (): Object = ??? // warn
281
+ @ throws(classOf [ClassNotFoundException ])
282
+ @ throws(classOf [IOException ])
283
+ private def readObject (stream : ObjectInputStream ): Unit = () // warn
284
+ @ throws(classOf [ObjectStreamException ])
285
+ private def readObjectNoData (): Unit = () // warn
286
+ @ throws(classOf [ObjectStreamException ])
287
+ private def readResolve (): Object = ??? // warn
0 commit comments