code: public void addWarning(SQLWarning warn) {
      //copy reference to avoid NPE from concurrent modification of this.warnings
      final PSQLWarningWrapper warnWrap = this.warnings;
      if (warnWrap == null) {
        this.warnings = new PSQLWarningWrapper(warn);
      } else {
        warnWrap.addWarning(warn);
      }
    }
docs: <p>Either initializes new warning wrapper, or adds warning onto the chain.</p>
  
  <p>Although warnings are expected to be added sequentially, the warnings chain may be cleared
  concurrently at any time via {@link #clearWarnings()}, therefore it is possible that a warning
  added via this method is placed onto the end of the previous warning chain</p>
  
  @param warn warning to add