question: private void beforeName ( ) throws IOException { JsonScope context = peek ( ) ; if ( context == JsonScope . NONEMPTY_OBJECT ) { out . write ( ',' ) ; } else if ( context != JsonScope . EMPTY_OBJECT ) { throw new IllegalStateException ( "Nesting problem: " + stack ) ; } newline ( ) ; replaceTop ( JsonScope . DANGLING_NAME ) ; }
target:  Inserts any necessary separators and whitespace before a name. Also adjusts the stack to expect the name's value.