Difference between revisions of "Dali Discouraged Access Warnings"

From Eclipsepedia

Jump to: navigation, search
(New page: For background, see DTP's discussion of resolving <code>Discouraged Access</code> warnings. Currently, Dali has three levels of ''Di...)
 
Line 1: Line 1:
For background, see DTP's discussion of [[DTP Ganymede Resolving Discouraged Access Warnings|resolving <code>Discouraged Access</code> warnings]].
+
DRAFT
 +
 
 +
For background, see
 +
*[[DTP Ganymede Resolving Discouraged Access Warnings]]
 +
*[[WTP Policy on Package Visibility]]
  
 
Currently, Dali has three levels of ''Discouraged Access'' warnings to deal with:
 
Currently, Dali has three levels of ''Discouraged Access'' warnings to deal with:
  
 
*'''Internal ''Discouraged Access'' Warnings'''
 
*'''Internal ''Discouraged Access'' Warnings'''
**Non-Test Plug-ins: Add non-test plug-ins as "friends" of other non-test plug-ins, ''as appropriate'' (e.g. ''all'' the non-test plug-ins are friends of <code>org.eclipse.jpt.'''utility'''</code>; while ''none'' of the plug-ins are friends of <code>org.eclipse.jpt.'''ui'''</code>).
+
**'''Non-Test Plug-ins''' We add non-test plug-ins as "friends" of other non-test plug-ins, ''as appropriate'' (e.g. ''all'' the non-test plug-ins are friends of <code>o.e.jpt.'''utility'''</code>; while ''none'' of the plug-ins are friends of <code>o.e.jpt.'''ui'''</code>).
 
+
**'''Test Plug-ins''' Because test plug-ins are not loaded at run-time, there is no need to make them friends of the non-test plug-ins. To suppress the ''Discouraged Access'' warnings in a test plug-in, we add the ''appropriate'' build-time access rule exceptions to the project's Java build path (e.g. <code>o.e.jpt.core.tests</code> suppresses any access warnings caused by references to <code>o.e.jpt.core</code>). See [[DTP Resolving Internal Discouraged Access Warnings|the DTP description of this Eclipse feature]].
**Test Plug-ins: Because test plug-ins are not loaded at run-time, there is no need to make test plug-ins friends of the non-test plug-ins. To suppress the <code>Discouraged Access</code> warnings in a test plug-in, add the ''appropriate'' build-time access rule exceptions to the project's Java Build Path (e.g. <code>org.eclipse.jpt.core.tests</code> suppresses any warnings caused by references to <code>org.eclipse.jpt.core</code>). See the [[DTP Resolving Internal Discouraged Access Warnings|DTP description of this Eclipse feature]].
+
***'''Exception''' The test "extension" plug-in, <code>o.e.jpt.core.test.extension.resource</code>, should ''not'' add any access rule exceptions to its project's Java build path, since this plug-in, as an example extension, ''should'' be using Dali's public API (currently, it does not; but that is the goal for Ganymede).
 
+
***Exception: The test "extension" plug-in, <code>org.eclipse.jpt.core.test.extension.resource</code> should ''not'' add any access rule exceptions, since it ''should'' be using Dali's public API (eventually).
+
  
 
*'''WTP ''Discouraged Access'' Warnings'''
 
*'''WTP ''Discouraged Access'' Warnings'''
Dali
+
**As a sub-project of WTP, Dali, ostensibly, is allowed access to the internals of any other WTP sub-project. This requires the appropriate WTP plug-ins to add various Dali plug-ins to their lists of "friends". Since this does not always happen in a timely fashion, we add access rule exceptions as necessary. Currently, only <code>o.e.jpt.core</code> and <code>o.e.jpt.ui</code> require these exceptions.
  
 
*'''External ''Discouraged Access'' Warnings'''
 
*'''External ''Discouraged Access'' Warnings'''
 +
**Because Dali is so tightly integrated with the Eclipse Java IDE, it references the internals of a number of other Eclipse plug-ins, particularly JDT plug-ins. A bug should be filed for each such warning, requesting the appropriate API be made public. Although these warnings could be suppressed (e.g. using the access rule exceptions described above or a Java annotation <code>@SuppressWarnings("restriction")</code>), it is more helpful to leave them visible and commented with a bug number.

Revision as of 14:05, 4 December 2007

DRAFT

For background, see

Currently, Dali has three levels of Discouraged Access warnings to deal with:

  • Internal Discouraged Access Warnings
    • Non-Test Plug-ins We add non-test plug-ins as "friends" of other non-test plug-ins, as appropriate (e.g. all the non-test plug-ins are friends of o.e.jpt.utility; while none of the plug-ins are friends of o.e.jpt.ui).
    • Test Plug-ins Because test plug-ins are not loaded at run-time, there is no need to make them friends of the non-test plug-ins. To suppress the Discouraged Access warnings in a test plug-in, we add the appropriate build-time access rule exceptions to the project's Java build path (e.g. o.e.jpt.core.tests suppresses any access warnings caused by references to o.e.jpt.core). See the DTP description of this Eclipse feature.
      • Exception The test "extension" plug-in, o.e.jpt.core.test.extension.resource, should not add any access rule exceptions to its project's Java build path, since this plug-in, as an example extension, should be using Dali's public API (currently, it does not; but that is the goal for Ganymede).
  • WTP Discouraged Access Warnings
    • As a sub-project of WTP, Dali, ostensibly, is allowed access to the internals of any other WTP sub-project. This requires the appropriate WTP plug-ins to add various Dali plug-ins to their lists of "friends". Since this does not always happen in a timely fashion, we add access rule exceptions as necessary. Currently, only o.e.jpt.core and o.e.jpt.ui require these exceptions.
  • External Discouraged Access Warnings
    • Because Dali is so tightly integrated with the Eclipse Java IDE, it references the internals of a number of other Eclipse plug-ins, particularly JDT plug-ins. A bug should be filed for each such warning, requesting the appropriate API be made public. Although these warnings could be suppressed (e.g. using the access rule exceptions described above or a Java annotation @SuppressWarnings("restriction")), it is more helpful to leave them visible and commented with a bug number.