question: private void collectWarnings ( SQLWarning warning , List < Warning > messages ) { while ( warning != null ) { messages . add ( new Warning ( warning . getSQLState ( ) , warning . getMessage ( ) ) ) ; warning = warning . getNextWarning ( ) ; } }
target:  Add the warning message from the specified warning, as well as any additional warnings linked via the getNextWarning method, to the list of messages.