2

I noticed this setting in Eclipse's compiler settings. How is this different than a "forbidden reference"?

Eric the Red
  • 5,364
  • 11
  • 49
  • 63
  • http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/editors/manifest_editor/access_rules.htm – biziclop Feb 17 '11 at 16:32

3 Answers3

3

From a comment on the accepted answer on how to open the find type dialog programmatically in eclipse

You get a discouraged access warning whenever you reference a type in a package that is not part of the API, typically these are *.internal packages. "Discouraged access" is an indicator that you should look for an API alternative if possible. Be aware that you might be vulnerable to change in later versions of Eclipse. See help.eclipse.org/galileo/index.jsp for more details – Rich Seller

Community
  • 1
  • 1
Lucas Zamboulis
  • 2,494
  • 5
  • 24
  • 27
2

Eclipse has Internal packages that are not intended for use by downstream plug-ins. However, these packages are visible to downstream plug-ins by default.

A discouraged reference is a reference in your code to one of the Eclipse internal packages.

You can find more information in the Plug-in Development Environment Guide -> Tools -> Editors -> Plug-in manifest editor -> Plug-in run time -> Access Rules.

Gilbert Le Blanc
  • 50,182
  • 6
  • 67
  • 111
  • Your answer does not explain the difference between a discouraged and forbidden reference. A link would've been faster; and your downmod (presuming if it were you) was a little rude considering a comment alone would have sufficed. I understand that maybe I've gotten a little link happy, and I'll take your advice to heart, but I think a little mercy goes a long way. – VoronoiPotato Feb 17 '11 at 16:50
  • @BeardedO: True, my answer is incomplete. I used the Help in my open Eclipse, so I didn't have an Internet link. Showing someone the breadcrumbs trail, as well as a link, is probably the most helpful. P.S. I've made 6 downvotes in 6 months. I think I'm pretty tolerant. – Gilbert Le Blanc Feb 17 '11 at 16:57
  • Well lets just set this behind us, and learn whatever there is to be learned from it. I imagine your intentions were pure and perhaps you had simply misread my post. – VoronoiPotato Feb 17 '11 at 17:08
1

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.

VoronoiPotato
  • 3,113
  • 20
  • 30