Search code examples
javaeclipseaccess-rules

access rules on Eclipse for Forbidden and discouraged reference


After a long time of search I didn't find good response for my lack of understanding.

I want to understand these options in Eclipse (indigo) for Java. These options:

  • Forbidden reference (access rules)
  • Discouraged reference (access rules)

I understand annotation process in Java compil or Javadoc but not the tags @forbidden or @discouraged.

Why Eclipse knows if reference is forbidden or discouraged?

Where is these access rules ? Is Java process or Eclipse process?

IMPORTANT : I don't develop a plugin and I am not in PDE Eclipse.

Can you help me to understand the process and theory logic for these options?


Solution

  • Finally I think have find the issue.

    Access rules in Eclipse is design on build path project per each or generally packages library. And define 2 access possibility here as Forbidden and discouraged.

    On other side, You can search issue from manifest file of OSGi bundle use. Because this file define different access rules from use of package for others bundle.