Bug 95167 - [content assist] Spurious "Access restriction" error during code assist
Summary: [content assist] Spurious "Access restriction" error during code assist
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-13 12:52 EDT by Nick Edgar CLA
Modified: 2005-05-27 09:08 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2005-05-13 12:52:31 EDT
build I20050512-1200

- OSGi, Runtime, SWT, JFace, UI, Text loaded from head
- open type on AbstractTextEditor
- at start of createPartContro method, type:
PartSite<Ctrl+Space>
- it has no effect in the editor, but the status line flashes in red: Access
restriction: The type SerializableCompatibility is not accessible due to
restriction on required project org.eclipse.swt

The type name doesn't seem to matter.  "abcd" has the same effect.

I notice that org.eclipse.ui.workbench.texteditor's classpath has an access rule
forbidding **/internal/** refs.
Comment 1 Wassim Melhem CLA 2005-05-13 12:56:40 EDT
Nick, that is why we asked people to remove all those "arbitrary" restrictions 
from the .classpath of their plugin projects.  Let PDE tell JDT what is 
restricted and what is not.
Comment 2 Nick Edgar CLA 2005-05-13 14:26:16 EDT
The message is still spurious.  It's talking about a class and a plug-in that
have nothing to do with what I was doing at the time.

Also, the rule lets Text say "I don't want to refer to internals from anyone.",
regardless of what the prerequisites' export rules are.
Comment 3 Dani Megert CLA 2005-05-13 15:09:05 EDT
The org.eclipse.ui.workbench.texteditor/.classpath (rev. 1.8, 12.12.2005) looks
like this:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="output" path="bin"/>
</classpath>

Wassim, I am a bit puzzled. If there is some "arbitrary" internal restriction
then this seems obviously be generated by PDE. Also note that I remove the
internal restrictions on all other Text plug-ins.

Nick, before Wassim starts to investigate/comment: might it be that you did not
have the code from HEAD but maybe checked out before I released the stuff yesterday?

Another problem here is the build path UI: it lets me add my own 'internal'
restrictions without giving any hint that PDE computed its own: the access rule
entry on the build path page reads: 'Access rules: (No restrictions)'. Martin,
this should be addressed. Shipping like this is very confusing.
Comment 4 Philipe Mulet CLA 2005-05-13 15:15:19 EDT
The offending message in status bar comes from JDT/Core, we should investigate
it as I agree it doesn't seem to make much sense.
David - pls ensure we have a bug for this. 

I also heard Martin saying he'd reveal restrictions when expanding containers in
buildpath wizard. 
Comment 5 Wassim Melhem CLA 2005-05-13 15:41:20 EDT
re comment 3:
I was going by Nick's observation that the .classpath file had an explicit 
restriction to forbid **/internal/** which several other plugins had and we 
asked them to remove.  That is what I refer to as 'arbitrary' (i.e. not 
enforced by the PDE container implementation), but your .classpath seems clean.

For the build path UI, ideally, we should not allow anybody to modify the 
container in any way (ie. the Edit...) button should be disabled.  But I think 
this is out of the question for 3.1, as one solution may require at minimum 
the addition of a boolean attribute on the classpath container extension point 
to mark it as read-only.
Comment 6 Nick Edgar CLA 2005-05-13 16:08:29 EDT
Dani's assumption is correct: I hadn't sync'ed, and still had rev 1.7 of the
.classpath loaded, which still had the access rule.

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry excluding="**/internal/**" kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="output" path="bin"/>
</classpath>
Comment 7 Dani Megert CLA 2005-05-13 16:14:22 EDT
>For the build path UI, ideally, we should not allow anybody to modify the 
>container in any way (ie. the Edit...) button should be disabled.  But I think 
>this is out of the question for 3.1
It would be good to address this for 3.1. A must do is to show that there are
some restrictions.
Comment 8 Tom Hofmann CLA 2005-05-18 12:46:22 EDT
Martin has fixed the problem on the build-path UI side: access restrictions for
plug-ins are no longer editable.

Moving to core for the status line issue.
Comment 9 Dani Megert CLA 2005-05-18 12:52:22 EDT
BTW: Martin added code that now shows the access restrictions that get generated
from PDE.
Comment 10 David Audel CLA 2005-05-25 05:31:11 EDT
Status line problem: Fixed and test added
  CompletionTests#testCompletionWithProblem1()

Status line content is the nearest problem of the completion position. But
CompletionEngine did not check if the problem is in the same compilation unit of
the completion.
Comment 11 Maxime Daniel CLA 2005-05-27 07:06:09 EDT
Verified on build I20050527-0010.