Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 383
darkomen Avatar asked Mar 12 '12 11:03

darkomen


People also ask

How do I fix eclipse warnings?

In your Eclipse, go to Window > Preferences > Java > Compiler > Errors/Warnings: Here you could switch any Warning entry to Error. Beware some entries may be hidden by expandable panels, so make sure you expand them all.

What is discouraged in Java?

a discouraged refrence is one that throws a warning by default whereas a forbidden reference is one that throws an error. They are similar contraindications but they differ in severity.


1 Answers

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.

like image 166
darkomen Avatar answered Oct 31 '22 18:10

darkomen