Wednesday, October 24, 2012

Eclipse Plugin Development: Discouraged Access

Many times if you use an existing plugin class when developing a plugin you might get some warning something like:
Discouraged access: The type ArchiveFileManipulations is not accessible due to restriction on required library C:\eclipse\plugins\org.eclipse.ui.ide_3.8.100.v20120917-171812.jar

Discouraged access: The method isTarFile(String) from the type ArchiveFileManipulations is not accessible due to restriction on required library C:\eclipse\plugins

 After a lot of searching I finally found out the answers here

Here's the summary:

  1. The class you are accessing mostly belongs to some package that has internal in its name.In my case its org.eclipse.ui.internal.wizards.datatransfer.ArchiveFileManipulations.
     
  2. This warning means you are using an internal method not an API. It means your plugin may not work in a different version in the future because that method may be removed/changed.

  3. Advice: Avoid using it altogether! If you want that functionality its better off you implement it yourself.

Hope this post helps people who wander a lot to get the right answer!

No comments:

Post a Comment