Buggy code:
public class XMLPersistenceMappingSerializer extends XMLPersistenceMetaDataSerializer { private static final int TYPE_RESULTMAP = ( TYPE_QUERY ) + 1 ; private static final Map < XMLPersistenceMappingSerializer . ColType , String > _names ; private List < QueryResultMapping > _results = null ; private boolean _sync = false ; public XMLPersistenceMappingSerializer ( JDBCConfiguration conf ) { } public boolean getSyncMappingInfo ( ) { } public void setSyncMappingInfo ( boolean sync ) { } public void addQueryResultMapping ( QueryResultMapping meta ) { } public boolean removeQueryResultMapping ( QueryResultMapping meta ) { } @ Override public void addAll ( MetaDataRepository repos ) { } @ Override public boolean removeAll ( MetaDataRepository repos ) { } @ Override public void clear ( ) { } protected void addCommments ( Object obj ) throws SAXException { } @ Override protected void serializeClass ( ClassMetaData meta , boolean access ) throws SAXException { } @ Override protected void serializeClassMappingContent ( ClassMetaData mapping ) throws SAXException { } @ Override protected void serializeInheritanceContent ( ClassMetaData mapping ) throws SAXException { } private void serializeTable ( String table , String elementName , String defaultName , ClassMappingInfo secondaryInfo , Unique [ ] uniques ) throws SAXException { List < Column > cols = null ; if ( secondaryInfo != null ) cols = ( ( List < Column > ) ( secondaryInfo . getSecondaryTableJoinColumns ( table ) ) ) ; <START_BUG> boolean print = ( ( cols != null ) && ( ( cols . size ( ) ) > 0 ) ) || ( ( uniques != null ) || ( ( uniques . length ) > 0 ) ) ; <END_BUG> if ( ( table != null ) && ( ( defaultName == null ) || ( ! ( defaultName . equals ( table ) ) ) ) ) { print = true ; int index = table . indexOf ( '.' ) ; if ( index < 0 ) addAttribute ( "name" , table ) ; else { addAttribute ( "schema" , table . substring ( 0 , index ) ) ; addAttribute ( "name" , table . substring ( ( index + 1 ) ) ) ; } } if ( print ) { startElement ( elementName ) ; if ( cols != null ) { for ( Column col : cols ) serializeColumn ( col , XMLPersistenceMappingSerializer . ColType . PK_JOIN , null , false ) ; } if ( uniques != null ) for ( Unique unique : uniques ) serializeUniqueConstraint ( unique ) ; endElement ( elementName ) ; } } @ Override protected boolean serializeAttributeOverride ( FieldMetaData fmd , FieldMetaData orig ) { } @ Override protected void serializeAttributeOverrideMappingContent ( FieldMetaData fmd , FieldMetaData orig ) throws SAXException { } @ Override protected PersistenceStrategy getStrategy ( FieldMetaData fmd ) { } @ Override protected void serializeFieldMappingContent ( FieldMetaData fmd , PersistenceStrategy strategy ) throws SAXException { } private boolean isLob ( FieldMapping field ) { } private TemporalType getTemporal ( FieldMapping field ) { } protected EnumType getEnumType ( FieldMapping field ) { } private void serializeColumns ( MappingInfo info , XMLPersistenceMappingSerializer . ColType type , String secondary ) throws SAXException { } private void serializeColumn ( Column col , XMLPersistenceMappingSerializer . ColType type , String secondary , boolean unique ) throws SAXException { } private void serializeUniqueConstraint ( Unique unique ) throws SAXException { } @ Override protected SerializationComparator newSerializationComparator ( ) { } @ Override protected void addSystemMappingElements ( Collection toSerialize ) { } @ Override protected int type ( Object o ) { } private List < QueryResultMapping > getQueryResultMappings ( ClassMetaData cm ) { } @ Override protected void serializeSystemMappingElement ( Object obj ) throws SAXException { } @ Override protected void serializeQueryMappings ( ClassMetaData meta ) throws SAXException { } private void serializeQueryResultMapping ( QueryResultMapping meta ) throws SAXException { } @ Override protected void serializeSequence ( SequenceMetaData meta ) throws SAXException { } private static enum ColType { COL , JOIN , INVERSE , PK_JOIN , DISC ; } protected class MappingSerializationComparator extends SerializationComparator { protected int compareUnknown ( Object o1 , Object o2 ) { } } }

Fix:
boolean print = ( ( cols != null ) && ( ( cols . size ( ) ) > 0 ) ) || ( ( uniques != null ) && ( ( uniques . length ) > 0 ) ) ;