Community
Participate
Working Groups
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;
Hi David...we'll look at this for next week.
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.
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.
Created attachment 196668 [details] Patch is attached
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.
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.