Buggy code:
@ Override public void reset ( ) throws IOException { } private void check ( Object obj ) { } private void internalCheck ( Object obj ) { if ( obj == null ) { return ; } Class < ? > cls = obj . getClass ( ) ; nameStack . add ( simpleName ) ; traceStack . add ( new SerializableChecker . TraceSlot ( obj , fieldDescription ) ) ; if ( ( ! ( obj instanceof Serializable ) ) && ( ! ( Proxy . isProxyClass ( cls ) ) ) ) { throw new SerializableChecker . WicketNotSerializableException ( toPrettyPrintedStack ( obj . getClass ( ) . getName ( ) ) , exception ) ; } ObjectStreamClass desc ; for ( ; ; ) { try { desc = ( ( ObjectStreamClass ) ( SerializableChecker . LOOKUP_METHOD . invoke ( null , cls , Boolean . TRUE ) ) ) ; Class < ? > repCl ; if ( ( ( ! ( ( Boolean ) ( SerializableChecker . HAS_WRITE_REPLACE_METHOD_METHOD . invoke ( desc , ( ( Object [ ] ) ( null ) ) ) ) ) ) || ( ( obj = SerializableChecker . INVOKE_WRITE_REPLACE_METHOD . invoke ( desc , obj ) ) == null ) ) || ( ( repCl = obj . getClass ( ) ) == cls ) ) { break ; } cls = repCl ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( e ) ; } } if ( cls . isPrimitive ( ) ) { } else if ( cls . isArray ( ) ) { checked . put ( obj , null ) ; Class < ? > ccl = cls . getComponentType ( ) ; if ( ! ( ccl . isPrimitive ( ) ) ) { Object [ ] objs = ( ( Object [ ] ) ( obj ) ) ; for ( int i = 0 ; i < ( objs . length ) ; i ++ ) { String arrayPos = ( "[" + i ) + "]" ; simpleName = arrayPos ; fieldDescription += arrayPos ; check ( objs [ i ] ) ; } } } else if ( ( obj instanceof Externalizable ) && ( ! ( Proxy . isProxyClass ( cls ) ) ) ) { Externalizable extObj = ( ( Externalizable ) ( obj ) ) ; try { extObj . writeExternal ( new SerializableChecker . ObjectOutputAdaptor ( ) { private int count = 0 ; public void writeObject ( Object streamObj ) throws IOException { if ( checked . containsKey ( streamObj ) ) { return ; } checked . put ( streamObj , null ) ; String arrayPos = ( "[write:" + ( ( count ) ++ ) ) + "]" ; simpleName = arrayPos ; fieldDescription += arrayPos ; check ( streamObj ) ; } } ) ; } catch ( Exception e ) { if ( e instanceof SerializableChecker . WicketNotSerializableException ) { throw ( ( SerializableChecker . WicketNotSerializableException ) ( e ) ) ; } SerializableChecker . log . warn ( ( ( ( "error<seq2seq4repair_space>delegating<seq2seq4repair_space>to<seq2seq4repair_space>Externalizable<seq2seq4repair_space>:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) + ",<seq2seq4repair_space>path:<seq2seq4repair_space>" ) + ( currentPath ( ) ) ) ) ; } } else { Method writeObjectMethod = null ; if ( ( writeObjectMethodMissing . contains ( cls ) ) == false ) { try { writeObjectMethod = cls . getDeclaredMethod ( "writeObject" , new Class [ ] { ObjectOutputStream . class } ) ; } catch ( SecurityException e ) { writeObjectMethodMissing . add ( cls ) ; } catch ( NoSuchMethodException e ) { writeObjectMethodMissing . add ( cls ) ; } } final Object original = obj ; if ( writeObjectMethod != null ) { class InterceptingObjectOutputStream extends ObjectOutputStream { private int counter ; InterceptingObjectOutputStream ( ) throws IOException { } @ Override protected Object replaceObject ( Object streamObj ) throws IOException { if ( streamObj == original ) { return streamObj ; } ( counter ) ++ ; if ( checked . containsKey ( streamObj ) ) { return null ; } <START_BUG> checked . put ( original , null ) ; <END_BUG> String arrayPos = ( "[write:" + ( counter ) ) + "]" ; simpleName = arrayPos ; fieldDescription += arrayPos ; check ( streamObj ) ; return streamObj ; } } try { InterceptingObjectOutputStream ioos = new InterceptingObjectOutputStream ( ) ; ioos . writeObject ( obj ) ; } catch ( Exception e ) { if ( e instanceof SerializableChecker . WicketNotSerializableException ) { throw ( ( SerializableChecker . WicketNotSerializableException ) ( e ) ) ; } SerializableChecker . log . warn ( ( ( ( "error<seq2seq4repair_space>delegating<seq2seq4repair_space>to<seq2seq4repair_space>writeObject<seq2seq4repair_space>:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) + ",<seq2seq4repair_space>path:<seq2seq4repair_space>" ) + ( currentPath ( ) ) ) ) ; } } else { Object [ ] slots ; try { slots = ( ( Object [ ] ) ( SerializableChecker . GET_CLASS_DATA_LAYOUT_METHOD . invoke ( desc , ( ( Object [ ] ) ( null ) ) ) ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } for ( Object slot : slots ) { ObjectStreamClass slotDesc ; try { Field descField = slot . getClass ( ) . getDeclaredField ( "desc" ) ; descField . setAccessible ( true ) ; slotDesc = ( ( ObjectStreamClass ) ( descField . get ( slot ) ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } checked . put ( obj , null ) ; checkFields ( obj , slotDesc ) ; } } } traceStack . removeLast ( ) ; nameStack . removeLast ( ) ; } private void checkFields ( Object obj , ObjectStreamClass desc ) { }

Fix:
checked . put ( streamObj , null ) ;