Bug 256034 - Need library access restrictions for members, and based on annotation values
Summary: Need library access restrictions for members, and based on annotation values
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 336237 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-20 16:23 EST by Randy Hudson CLA
Modified: 2011-02-09 14:23 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2008-11-20 16:23:27 EST
This is related to bug 107783.

I need to restrict access to System Libraries using the pattern:
   **/*[@since="1.5"]
   **/*#*[@since="1.5"]
(where # is a new segment separator (borrowed from javadoc syntax) between a class one of its members (e.g. a method)) 

I can currently take advantage of 1.5 language features while targeting a lesser, 1.4-level JRE at runtime. However, to leverage things like generics in Collections, I need to compile against 1.5 System Libraries. This work great (Thanks Olivier!), but currently requires extreme care. To guarantee the goal of running on a 1.4 JRE *and* class library, I need to avoid accessing stuff like:
   - Class: java.lang.StringBuilder
   - Method: java.lang.Integer#valueOf(int)

To phrase the problem in a completely different way, I would like to be able to compile against one set of Libraries, and then I need to verify that I can also *LINK* against a different set of libraries (which I don't need to be able to compile against). That is, I am binary, but *not* source, -compatible with the second set of libraries.
Comment 1 Randy Hudson CLA 2008-11-20 16:28:34 EST
> That is, I am binary, but *not* source, -compatible with the
> second set of libraries.

Let me restate:

I *believe* that I am binary-compatible with some other set of libraries, and I would like JDT to enforce this during build.
Comment 2 Olivier Thomann CLA 2008-11-21 10:37:09 EST
Randy, Api Tools can help you with this.
Check the next integration build.
Comment 3 Olivier Thomann CLA 2011-02-09 14:23:54 EST
*** Bug 336237 has been marked as a duplicate of this bug. ***