Bug 526692 - [content assist] package names of forbidden types suggested in content assist
Summary: [content assist] package names of forbidden types suggested in content assist
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-31 12:26 EDT by Brian de Alwis CLA
Modified: 2017-10-31 12:26 EDT (History)
0 users

See Also:


Attachments
project demonstrating the completion issue (2.19 KB, application/zip)
2017-10-31 12:26 EDT, Brian de Alwis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2017-10-31 12:26:15 EDT
Created attachment 271271 [details]
project demonstrating the completion issue

As part of some development tooling, we create Java projects and add a jar to the project's classpath which contains repackaged classes (classes copied from other jars that have been renamed with a unique prefix, such as com.google.appengine.repackaged.XXX).  As these classes are not intended to be used by users, we set access rules on the IClasspathEntry with IAccessRule.K_NON_ACCESSIBLE for "com/google/appengine/repackaged/**" to forbid references to these repackaged classes. Although this prevents the classes from being found with Open Type, Organize Imports, and Content Assist, the packages are still suggested with Content Assist.

I expected that packages matching rules should not be shown.

Steps to repeat:
This is easily reproduced with a pure Java project referencing JUnit's jar.

  1. Create a new Java project ("test-with-forbidden-packages")
  2. Edit the projects Build Path and add a reference to the JUNIT_HOME/junit.jar.
  3. Add an access rule on junit.jar to forbid references to org/junit/**.
  4. Create a new class ("Main") with a main() method.
  5. Attempt to reference org.junit.runner.Runner by typing "org.junit." and invoke Content Assist.  Although the many sub-packages of org.junit.* are shown, including org.junit.runner, you cannot list any of the types contained in any of these sub packages.

(I've attached a demonstration project)