fixed #3185

1. add "override" behind virtual function.
2. remove duplicate function in class ComAttribute.