Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339317 - ForbiddenReference in wsdl UI wizard
Summary: ForbiddenReference in wsdl UI wizard
Status: RESOLVED FIXED
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: wst.wsdl (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.3.1   Edit
Assignee: Atosa Khoddamhazrati CLA
QA Contact: Keith Chong CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 350592
  Show dependency tree
 
Reported: 2011-03-09 01:10 EST by David Williams CLA
Modified: 2011-08-24 18:18 EDT (History)
1 user (show)

See Also:


Attachments
Patch is attached (2.75 KB, patch)
2011-05-26 10:55 EDT, Atosa Khoddamhazrati CLA
keith.chong.ca: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2011-03-09 01:10:27 EST
This "forbidden reference" started showing up recently in our build logs (pasted at end of this comment), in both maintenance and Indigo. Maybe you changed something, but, my first guess is it has simply been hidden before by our "access rules", which I have now turned off ... so we get twice as many "discouraged access" warnings ... and this one extra forbidden Reference. 

Forbidden References are serious since, presumably, the code would not work at runtime, if ordinary OSGi classloading is used. 

I've not looked at the the code in question, but can be because of something in wsdl ui bundle, or could be because org.eclipse.wst.ws.service.policy.ui does not export it. 

= = = =


Source File: org/eclipse/wst/wsdl/ui/internal/wizards/NewWSDLWizard.java
    5. WARNING: ForbiddenReference
    Access restriction: The type ServicePoliciesPropertyPage is not accessible due to restriction on classpath entry /opt/public/webtools/projects/wtp-R3.3.0-I/workdir/plugins/org.eclipse.wst.ws.service.policy.ui/@dot
    NewWSDLWizard.java :
    53 : import org.eclipse.wst.ws.internal.service.policy.ui.properties.ServicePoliciesPropertyPage;
Comment 1 Keith Chong CLA 2011-05-12 14:16:58 EDT
Hi David...we'll look at this for next week.
Comment 2 Atosa Khoddamhazrati CLA 2011-05-16 17:57:46 EDT
Method openProjectWSIProperties()in NewWSDLWizard.java is referencing PAGE_ID String in ServicePoliciesPropertyPage, but ServicePoliciesPropertyPage is defined in org.eclipse.wst.ws.internal.service.policy.ui.properties which is an internal package and is not exported.
As it is not advised to export internal packages and org.eclipse.wst.wsdl.ui requires org.eclipse.wst.ws.ui, A worksround can be to add the PAGE_ID to WSICompliancePreferencePage and in NEWWSDLWizard.java reference the new ID in the WSICompliancePreferencePage rather than the ServicePoliciesPropertyPage wich is not accessible.
Comment 3 Keith Chong CLA 2011-05-26 09:57:42 EDT
Hi Atosa,

Thanks.  Looking at this some more, we could move the String page id into an exported package in org.eclipse.wst.ws.service.policy.ui.

I tried the properties page from the wizard and it seems to be working fine.

So, let's defer this to the next release.  Please attach your patch.
Comment 4 Atosa Khoddamhazrati CLA 2011-05-26 10:55:23 EDT
Created attachment 196668 [details]
Patch is attached
Comment 5 David Williams CLA 2011-05-26 11:20:28 EDT
Kind of an interesting case ... I guess the "code works" because the string is inlined during compilation (compilation doesn't really following any access rules, as far as I know, that is entirely a runtime concept). But, sounds like the string is intended as "API" of sorts, so best to export it (or, have in exported package). 

It is a little tricky to "change in maintenance", since if string is inlined during compilation, then any "consumers" need to be sure to be re-compiled/redistributed as well as the bundle the string is in. I've no idea if that's relevent in this case ... but since the string appears to contain a package name ("org.eclipse.wst.ws.internal.ui.wsi.preferences.") then it might be? 

Wouldn't it sort of be like adding API in maintenance release in 3.3.1? Not impossible ... but, might be good to do before the initial release? 

I'm just asking.
Comment 6 Keith Chong CLA 2011-08-24 18:18:23 EDT
The string wasn't intended to be API.  A new string has been added to an already exported package.  The 3.3.1 build does not have this warning any longer.   Resolving bug.