docs: @SuppressWarnings("nls")
  	public void flush()
  	{
  		synchronized (this)
  		{
  			// write xml header
  			if (!hasXmlHeader)
  			{
  				out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?> ");
  				out.println("<java version=\"" + System.getProperty("java.version") + "\" class=\"com.googlecode.openbeans.XMLDecoder\"> ");
  				hasXmlHeader = true;
  			}
  
  			// preprocess pending objects
  			for (Iterator<Object> iter = flushPending.iterator(); iter.hasNext();)
  			{
  				Object o = iter.next();
  				Record rec = objRecordMap.get(o);
  				if (rec != null)
  				{
  					preprocess(o, rec);
  				}
  			}
  
  			// flush pending objects
  			for (Iterator<Object> iter = flushPending.iterator(); iter.hasNext();)
  			{
  				Object o = iter.next();
  				flushObject(o, INDENT_UNIT);
  				// remove flushed obj
  				iter.remove();
  			}
  
  			// clear statement records
  			objRecordMap.clear();
  			flushPendingStat.clear();
  			objPrePendingCache.clear();
  			clazzCounterMap.clear();
  
  			// remove all old->new mappings
  			super.clear();
  		}
  	}