Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Extending classes with generics

Indeed, it works.

However, I am wondering if it is really a good idea: working that way
with generics prevents one project to see the generic classes of another
project, correct?
(If I apply the same technique for sat4j, I can no longer use the
generic classes of org.sat4j.core in org.sat4j.pb!!!!)

It is the expected behavior for PDE people for instance reusing p2 bundles.

But inside p2 projects, it would mean inability to share generic code
between bundles...

Daniel

Pascal Rapicault a écrit :
> I have released the changes to the project preference settings in the p2
> projects to enable down compilation in the IDE.
> 
> 
> Inactive hide details for Curtis Windatt---04/01/2010 10:54:45
> PM---Recently a number of the query API were changed to use geneCurtis
> Windatt---04/01/2010 10:54:45 PM---Recently a number of the query API
> were changed to use generics, this causes some annoyances in PDE (as we
> are strictly 1.4), b
> 
> 
> From:	
> Curtis Windatt/Ottawa/IBM@IBMCA
> 
> To:	
> P2 developer discussions <p2-dev@xxxxxxxxxxx>
> 
> Date:	
> 04/01/2010 10:54 PM
> 
> Subject:	
> [p2-dev] Extending classes with generics
> 
> ------------------------------------------------------------------------
> 
> 
> 
> Recently a number of the query API were changed to use generics, this
> causes some annoyances in PDE (as we are strictly 1.4), but up until now
> I can work around them. However, I have a problem extending a class with
> generics, specifically MatchQuery
> 
> IQuery query = new MatchQuery() {
> public boolean isMatch(Object candidate) {
> if (candidate instanceof IInstallableUnit) {
> if (P2Utils.isBundle((IInstallableUnit) candidate)) {
> return true;
> }
> }
> return false;
> }
> };
> 
> The compiler complains that I need to extend the isMatch(T candidate)
> instead, but I am unable to use generics in PDE.
> 
> As a side note, why was size() removed from IQueryResult? It was quite
> convenient for me when creating arrays of InstallableUnitDescriptions
> and other objects that get filled in based on the query result iterator.
> Now I have to grab one of the sets and ask it for the size. Not a big
> deal, but it felt natural to ask the result for its size, since you can
> ask it for an iterator.
> 
> Curtis_______________________________________________
> p2-dev mailing list
> p2-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/p2-dev
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> p2-dev mailing list
> p2-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/p2-dev


-- 
             Daniel Le Berre mailto:leberre@xxxxxxxxxxxxxxxxxxx
             MCF,    CRIL-CNRS UMR 8188,    Universite d'Artois
             http://www.cril.univ-artois.fr/~leberre


Back to the top