Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Restricting Target Platform's API usage when developing Eclipse plugins
Restricting Target Platform's API usage when developing Eclipse plugins [message #1755953] Thu, 09 March 2017 08:53 Go to next message
Eclipse UserFriend
I'm developing an Eclipse plugin and i've run into this problem several times already.

I always keep my Target Platform updated for the latest (stable) Eclipse release so that i test my code against all the recent updates, fixes etc.
However, this may (and have) result in accidental breakage of backward compatibility of my plugin, e.g. when i accidentally use new API that did not exist in the Eclipse version i aim to support.
Or, more sneaky example, in 4.6 Eclipse moved to Java 8 and some interface methods got default implementations. Now when i implement these interfaces my IDE doesn't automatically generate empty implementations for those methods and no error is generated. If i install and run this code against a previous Eclipse version these methods will throw AbstractMethodError since no implementation has been provided.

So my question is: is there a tool to further restrict API my Target Platform provides to some earlier Eclipse API version?
Is API Baseline an appropriate tool for this? Because i couldn't get it to work like this. (It allowed even non-baseline method calls not to mention the more complex default-methods example.)

[Updated on: Thu, 09 March 2017 08:55] by Moderator

Re: Restricting Target Platform's API usage when developing Eclipse plugins [message #1756135 is a reply to message #1755953] Sun, 12 March 2017 23:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
Could you not just create different target platforms and add the software site of the eclipse version that you want?
For example if you add http://download.eclipse.org/eclipse/updates/4.2 software site you would have Eclipse RCP 4.2 etc.
Re: Restricting Target Platform's API usage when developing Eclipse plugins [message #1756140 is a reply to message #1756135] Mon, 13 March 2017 02:06 Go to previous message
Eclipse UserFriend
Yeah i can do that. But this way i have to forgo using APi improvements that are binary compatible, like method generification.

It looks there's no better way so i'll have to decide between that and dropping support for some older versions.
Previous Topic:Mark eclipse editor as not dirty if there aren't any changes
Next Topic:Problems with path to resource
Goto Forum:
  


Current Time: Tue Jul 15 15:14:21 EDT 2025

Powered by FUDForum. Page generated in 0.33883 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top