[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] MatchQuery


Thanks, will keep this in mind.  As far as the @noextend, the javadoc in the deprecated/internalized MatchQuery class certainly is not explicit about this:

 * @deprecated Clients should use {@link ExpressionMatchQuery} instead.

And the javadoc for IMatchQuery is very explicit about this:

 * @noimplement This interface is not intended to be implemented by clients. Clients
 * creating custom queries must extend {@link ExpressionMatchQuery} instead.



From: Ian Bull <irbull@xxxxxxxxxxxxxxxxx>
To: P2 developer discussions <p2-dev@xxxxxxxxxxx>
Date: 03/09/2010 07:28 PM
Subject: Re: [p2-dev] MatchQuery
Sent by: p2-dev-bounces@xxxxxxxxxxx





You're certainly not required to compile with source set to 1.5. In fact, care has been taken to ensure that you can use p2 with a 1.4 VM.

I'm pretty sure that varags gets translated to an Object array (Object[]), so you can try passing an empty object array as your last parameter.

However, I don't think you want to extend this class.  I'm actually surprised we don't have a @noextend on it.  Instead you should be creating an instance of this class with your own _expression_ that represents the query.

See the wiki page for more information:
http://wiki.eclipse.org/Query_Language_for_p2

cheers,
ian

On Tue, Mar 9, 2010 at 5:41 PM, Thomas M Houser <tmhouser@xxxxxxxxxx> wrote:

The MatchQuery class has been made internal and marked as deprecated.  In the deprecation comment it says to use ExpressionMatchQuery instead.  We compile our code with javacSource=1.4 and javacTarget=1.4.  I can't seem to get any of our subclasses to compile if I use ExpressionMatchQuery as the superclass.  That is, the old MatchQuery class had a default parameterless constructor that was public.  The ExpressionMatchQuery class doesn't.  And the constructors that are public have variable number of arguments:


       
public ExpressionMatchQuery(Class<? extends T> matchingClass, IExpression _expression_, Object... parameters) {

In my subclass, this call to the super constructor does not compile:


       
super(IInstallableUnit.class, ExpressionUtil.TRUE_EXPRESSION);

Are clients of the p2 API now required to compile with javacSource=1.5 and javacTarget=1.5?  Or is there some trick here?

_______________________________________________
p2-dev mailing list

p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev




--
R. Ian Bull | EclipseSource Victoria | +1 250 477 7484

http://eclipsesource.com | http://twitter.com/eclipsesource_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev