Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:53 Go to next message
Alexander Levsha is currently offline Alexander LevshaFriend
Messages: 5
Registered: December 2013
Junior Member
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 13:55]

Report message to a moderator

Re: Restricting Target Platform's API usage when developing Eclipse plugins [message #1756135 is a reply to message #1755953] Mon, 13 March 2017 03:32 Go to previous messageGo to next message
Vivien Jovet is currently offline Vivien JovetFriend
Messages: 11
Registered: February 2017
Junior Member
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 06:06 Go to previous message
Alexander Levsha is currently offline Alexander LevshaFriend
Messages: 5
Registered: December 2013
Junior Member
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: Sat Apr 20 00:26:57 GMT 2024

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

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

Back to the top