#534 Black List for Interface method definition

Check (274)
Gene Wu

Certain java interfaces need to be restrict not to use a set of Java classes. For example, the Vector and ArrayList, in this case, Collection and List.

It could be used to prevent API interface from using incorrect classes, for example, web services.

Also, we could apply it to any project to loose couple the implementation from interface definition.


  • Gene Wu

    Gene Wu - 2010-02-18

    I had a check wrote by myself. Maybe I can contribute to the repository.

  • Oliver Burn

    Oliver Burn - 2010-02-22

    Could you please give a detailed example of what the check should detect. I do not understand at the moment. Thanks.

  • Gene Wu

    Gene Wu - 2010-02-23

    Sorry for my bad English.

    For example:

    public interface OracleTestDAO

    void testVector(Vector vector);
    Vector testVector();
    void testArrayList(ArrayList arrayList);
    ArrayList testArrayList();


    From best practice's perspective, it's not very good to export ArrayList and Vector as parameter or return type of interface method.

    Some ancient code may have this issue, better to identify them and fix them step by step. Also, we can use it to restrict interface design.

  • Roman Ivanov

    Roman Ivanov - 2016-02-26
    • status: open --> closed
    • Group: --> Future
  • Roman Ivanov

    Roman Ivanov - 2016-02-26

    If I miss smth please open issue at github issue tracker.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks