@ Override public boolean add ( Object o ) { ConnectorProperty connectorPropertyToAdd = ( ConnectorProperty ) o ; String nameToAdd = connectorPropertyToAdd . getName ( ) ; ConnectorProperty connectorProperty = null ; String name = null ; Enumeration < Object > e = this . elements ( ) ; while ( e . hasMoreElements ( ) ) { connectorProperty = ( ConnectorProperty ) e . nextElement ( ) ; name = connectorProperty . getName ( ) ; if ( name . equals ( nameToAdd ) ) { if ( tc . isDebugEnabled ( ) ) { String value = ( String ) connectorPropertyToAdd . getValue ( ) ; if ( ! value . equals ( "" ) ) { if ( name . equals ( "UserName" ) || name . equals ( "Password" ) ) { Tr . debug ( tc , "DUPLICATE_USERNAME_PASSWORD_CONNECTOR_PROPERTY_J2CA0103" , new Object [ ] { ( ConnectorProperty ) o } ) ; } else { Tr . warning ( tc , "DUPLICATE_CONNECTOR_PROPERTY_J2CA0308" , new Object [ ] { ( ConnectorProperty ) o } ) ; } } } return true ; } } return super . add ( o ) ; }
override the Vector add method to not add duplicate entries . That is entries with the same name .