Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 158072 Details for
Bug 301658
[query] IUQuery overrides getID and changes the semantics of the method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
clipboard.txt (text/plain), 16.89 KB, created by
Ian Bull
on 2010-02-03 12:53:08 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Ian Bull
Created:
2010-02-03 12:53:08 EST
Size:
16.89 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.metadata >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF,v >retrieving revision 1.30 >diff -u -r1.30 MANIFEST.MF >--- META-INF/MANIFEST.MF 13 Jan 2010 17:22:36 -0000 1.30 >+++ META-INF/MANIFEST.MF 3 Feb 2010 17:51:53 -0000 >@@ -54,7 +54,6 @@ > org.eclipse.pde.ui, > org.eclipse.equinox.p2.repository.tools, > org.eclipse.pde.core", >- org.eclipse.equinox.internal.p2.query;x-friends:="org.eclipse.equinox.p2.ql,org.eclipse.equinox.p2.ui", > org.eclipse.equinox.internal.provisional.p2.metadata; > x-friends:="org.eclipse.equinox.p2.artifact.optimizers, > org.eclipse.equinox.p2.artifact.processors, >Index: src/org/eclipse/equinox/internal/p2/query/QueryHelpers.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/query/QueryHelpers.java >diff -N src/org/eclipse/equinox/internal/p2/query/QueryHelpers.java >--- src/org/eclipse/equinox/internal/p2/query/QueryHelpers.java 13 Jan 2010 17:22:50 -0000 1.2 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,58 +0,0 @@ >-/******************************************************************************* >-* Copyright (c) 2009 EclipseSource and others. All rights reserved. This >-* program and the accompanying materials are made available under the terms of >-* the Eclipse Public License v1.0 which accompanies this distribution, and is >-* available at http://www.eclipse.org/legal/epl-v10.html >-* >-* Contributors: >-* EclipseSource - initial API and implementation >-******************************************************************************/ >-package org.eclipse.equinox.internal.p2.query; >- >- >-import java.lang.reflect.InvocationTargetException; >-import java.lang.reflect.Method; >-import org.eclipse.equinox.p2.query.IQuery; >- >-/** >- * Static helper methods for the Query API. >- * >- * @noextend This class is not intended to be subclassed by clients. >- */ >-public class QueryHelpers { >- /** >- * Gets the ID for a Query. >- * >- * @noreference This method is not intended to be referenced by clients. >- */ >- public static String getId(IQuery<?> query) { >- return query.getClass().getName(); >- } >- >- /** >- * Gets a particular property of a query. >- * @param query The query to retrieve the property from >- * @param property The property to retrieve >- * >- * @noreference This method is not intended to be referenced by clients. >- */ >- public static Object getProperty(IQuery<?> query, String property) { >- Class<?> clazz = query.getClass(); >- Object result = null; >- try { >- Method method = clazz.getMethod("get" + property, new Class[0]); //$NON-NLS-1$ >- result = method.invoke(query, new Object[0]); >- } catch (SecurityException e) { >- return null; >- } catch (NoSuchMethodException e) { >- return null; >- } catch (IllegalArgumentException e) { >- return null; >- } catch (IllegalAccessException e) { >- return null; >- } catch (InvocationTargetException e) { >- return null; >- } >- return result; >- } >-} >Index: src/org/eclipse/equinox/p2/query/CompoundQuery.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQuery.java,v >retrieving revision 1.3 >diff -u -r1.3 CompoundQuery.java >--- src/org/eclipse/equinox/p2/query/CompoundQuery.java 13 Jan 2010 21:19:54 -0000 1.3 >+++ src/org/eclipse/equinox/p2/query/CompoundQuery.java 3 Feb 2010 17:51:53 -0000 >@@ -14,7 +14,6 @@ > import java.lang.reflect.Array; > import java.util.*; > import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.equinox.internal.p2.query.QueryHelpers; > > /** > * A query that combines a group of sub-queries.<P> >@@ -97,21 +96,6 @@ > } > > /** >- * Gets the ID for this Query. >- */ >- public String getId() { >- return QueryHelpers.getId(this); >- } >- >- /** >- * Gets a particular property of the query. >- * @param property The property to retrieve >- */ >- public Object getProperty(String property) { >- return QueryHelpers.getProperty(this, property); >- } >- >- /** > * The compound query instantiated when all queries are Match Queries. > */ > private static class MatchCompoundQuery<T> extends CompoundQuery<T> implements IMatchQuery<T> { >Index: src/org/eclipse/equinox/p2/query/ContextQuery.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/ContextQuery.java,v >retrieving revision 1.2 >diff -u -r1.2 ContextQuery.java >--- src/org/eclipse/equinox/p2/query/ContextQuery.java 13 Jan 2010 17:22:19 -0000 1.2 >+++ src/org/eclipse/equinox/p2/query/ContextQuery.java 3 Feb 2010 17:51:53 -0000 >@@ -10,7 +10,6 @@ > package org.eclipse.equinox.p2.query; > > import java.util.Iterator; >-import org.eclipse.equinox.internal.p2.query.QueryHelpers; > > /** > * ContextQuery is the abstract superclass for Queries that require the entire >@@ -43,18 +42,4 @@ > */ > public abstract IQueryResult<T> perform(Iterator<T> iterator); > >- /** >- * Gets the ID for this Query. >- */ >- public String getId() { >- return QueryHelpers.getId(this); >- } >- >- /** >- * Gets a particular property of the query. >- * @param property The property to retrieve >- */ >- public Object getProperty(String property) { >- return QueryHelpers.getProperty(this, property); >- } > } >Index: src/org/eclipse/equinox/p2/query/IQuery.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/IQuery.java,v >retrieving revision 1.3 >diff -u -r1.3 IQuery.java >--- src/org/eclipse/equinox/p2/query/IQuery.java 13 Jan 2010 21:36:44 -0000 1.3 >+++ src/org/eclipse/equinox/p2/query/IQuery.java 3 Feb 2010 17:51:53 -0000 >@@ -39,17 +39,4 @@ > */ > public abstract IQueryResult<T> perform(Iterator<T> iterator); > >- /** >- * Gets a unique identifier for this query. >- * @return a unique identifier for this query >- */ >- public String getId(); >- >- /** >- * Gets a particular property of the query. >- * @param property The property to retrieve >- * @return The value of the retrieved property, or <code>null</code> >- * if no such property is defined. >- */ >- public Object getProperty(String property); > } >Index: src/org/eclipse/equinox/p2/query/MatchQuery.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/MatchQuery.java,v >retrieving revision 1.2 >diff -u -r1.2 MatchQuery.java >--- src/org/eclipse/equinox/p2/query/MatchQuery.java 13 Jan 2010 17:22:20 -0000 1.2 >+++ src/org/eclipse/equinox/p2/query/MatchQuery.java 3 Feb 2010 17:51:53 -0000 >@@ -11,7 +11,6 @@ > package org.eclipse.equinox.p2.query; > > import java.util.Iterator; >-import org.eclipse.equinox.internal.p2.query.QueryHelpers; > > /** > * This class represents the superclass of most of p2's queries. Every element >@@ -41,21 +40,6 @@ > public abstract boolean isMatch(T candidate); > > /** >- * Gets the ID for this Query. >- */ >- public String getId() { >- return QueryHelpers.getId(this); >- } >- >- /** >- * Gets a particular property of the query. >- * @param property The property to retrieve >- */ >- public Object getProperty(String property) { >- return QueryHelpers.getProperty(this, property); >- } >- >- /** > * Performs this query on the given iterator, passing all objects in the iterator > * that match the criteria of this query to the given result. > */ >Index: src/org/eclipse/equinox/p2/query/PipedQuery.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/PipedQuery.java,v >retrieving revision 1.4 >diff -u -r1.4 PipedQuery.java >--- src/org/eclipse/equinox/p2/query/PipedQuery.java 14 Jan 2010 17:04:57 -0000 1.4 >+++ src/org/eclipse/equinox/p2/query/PipedQuery.java 3 Feb 2010 17:51:53 -0000 >@@ -11,7 +11,6 @@ > package org.eclipse.equinox.p2.query; > > import java.util.*; >-import org.eclipse.equinox.internal.p2.query.QueryHelpers; > > /** > * A PipedQuery is a composite query in which each sub-query is executed in succession. >@@ -47,20 +46,6 @@ > } > > /*(non-Javadoc) >- * @see org.eclipse.equinox.p2.query.IQuery#getId() >- */ >- public String getId() { >- return QueryHelpers.getId(this); >- } >- >- /*(non-Javadoc) >- * @see org.eclipse.equinox.p2.query.IQuery#getProperty(java.lang.String) >- */ >- public Object getProperty(String property) { >- return QueryHelpers.getProperty(this, property); >- } >- >- /*(non-Javadoc) > * @see org.eclipse.equinox.p2.query.ICompositeQuery#getQueries() > */ > public List<IQuery<T>> getQueries() { >#P org.eclipse.equinox.p2.ql >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ql/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 13 Jan 2010 12:59:44 -0000 1.9 >+++ META-INF/MANIFEST.MF 3 Feb 2010 17:51:54 -0000 >@@ -14,7 +14,6 @@ > org.eclipse.equinox.internal.p2.metadata, > org.eclipse.equinox.internal.p2.metadata.expression, > org.eclipse.equinox.internal.p2.metadata.expression.parser, >- org.eclipse.equinox.internal.p2.query, > org.eclipse.equinox.internal.provisional.p2.metadata, > org.eclipse.equinox.p2.metadata, > org.eclipse.equinox.p2.metadata.expression, >Index: src/org/eclipse/equinox/p2/ql/QLQuery.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLQuery.java,v >retrieving revision 1.4 >diff -u -r1.4 QLQuery.java >--- src/org/eclipse/equinox/p2/ql/QLQuery.java 13 Jan 2010 12:59:43 -0000 1.4 >+++ src/org/eclipse/equinox/p2/ql/QLQuery.java 3 Feb 2010 17:51:54 -0000 >@@ -11,7 +11,6 @@ > package org.eclipse.equinox.p2.ql; > > import java.util.Locale; >-import org.eclipse.equinox.internal.p2.query.QueryHelpers; > import org.eclipse.equinox.p2.query.IQuery; > > /** >@@ -34,14 +33,4 @@ > this.locale = locale; > } > >- /** >- * Gets the ID for this Query. >- */ >- public String getId() { >- return QueryHelpers.getId(this); >- } >- >- public Object getProperty(String property) { >- return QueryHelpers.getProperty(this, property); >- } > } >#P org.eclipse.equinox.p2.tests >Index: src/org/eclipse/equinox/p2/tests/core/PropertyLookupQuery1.java >=================================================================== >RCS file: src/org/eclipse/equinox/p2/tests/core/PropertyLookupQuery1.java >diff -N src/org/eclipse/equinox/p2/tests/core/PropertyLookupQuery1.java >--- src/org/eclipse/equinox/p2/tests/core/PropertyLookupQuery1.java 13 Jan 2010 17:28:23 -0000 1.3 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,27 +0,0 @@ >-/******************************************************************************* >-* Copyright (c) 2009 EclipseSource and others. All rights reserved. This >-* program and the accompanying materials are made available under the terms of >-* the Eclipse Public License v1.0 which accompanies this distribution, and is >-* available at http://www.eclipse.org/legal/epl-v10.html >-* >-* Contributors: >-* EclipseSource - initial API and implementation >-******************************************************************************/ >-package org.eclipse.equinox.p2.tests.core; >- >-import org.eclipse.equinox.p2.query.MatchQuery; >- >-public class PropertyLookupQuery1 extends MatchQuery { >- >- public String getSomeProperty() { >- return "foo"; >- } >- >- public String getThatProperty(Object param) { >- return "bar"; >- } >- >- public boolean isMatch(Object candidate) { >- return false; >- } >-} >Index: src/org/eclipse/equinox/p2/tests/core/PropertyLookupQuery2.java >=================================================================== >RCS file: src/org/eclipse/equinox/p2/tests/core/PropertyLookupQuery2.java >diff -N src/org/eclipse/equinox/p2/tests/core/PropertyLookupQuery2.java >--- src/org/eclipse/equinox/p2/tests/core/PropertyLookupQuery2.java 13 Jan 2010 17:28:23 -0000 1.3 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,25 +0,0 @@ >-/******************************************************************************* >-* Copyright (c) 2009 EclipseSource and others. All rights reserved. This >-* program and the accompanying materials are made available under the terms of >-* the Eclipse Public License v1.0 which accompanies this distribution, and is >-* available at http://www.eclipse.org/legal/epl-v10.html >-* >-* Contributors: >-* EclipseSource - initial API and implementation >-******************************************************************************/ >-package org.eclipse.equinox.p2.tests.core; >- >-import java.util.Iterator; >-import org.eclipse.equinox.p2.query.Collector; >-import org.eclipse.equinox.p2.query.ContextQuery; >- >-public class PropertyLookupQuery2 extends ContextQuery { >- >- public String getSomeOtherProperty() { >- return "bar"; >- } >- >- public Collector perform(Iterator iterator) { >- return null; >- } >-} >Index: src/org/eclipse/equinox/p2/tests/core/QueryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java,v >retrieving revision 1.8 >diff -u -r1.8 QueryTest.java >--- src/org/eclipse/equinox/p2/tests/core/QueryTest.java 13 Jan 2010 17:28:23 -0000 1.8 >+++ src/org/eclipse/equinox/p2/tests/core/QueryTest.java 3 Feb 2010 17:51:55 -0000 >@@ -99,37 +99,6 @@ > assertTrue("1.4", query.areHooksExecutedProperly()); > } > >- public void testPropertyLookupMatchQuery() { >- IQuery query1 = new PropertyLookupQuery1(); >- Object property = query1.getProperty("SomeProperty"); >- assertEquals("1.0", "foo", property); >- } >- >- public void testPropertyLookupContextQuery() { >- IQuery query1 = new PropertyLookupQuery2(); >- Object property = query1.getProperty("SomeOtherProperty"); >- assertEquals("1.0", "bar", property); >- } >- >- public void testPropertyLookupInvalidProperty1() { >- IQuery query1 = new PropertyLookupQuery1(); >- Object property = query1.getProperty("ThisProperty"); >- assertEquals("1.0", null, property); >- } >- >- public void testPropertyLookupInvalidProperty2() { >- IQuery query1 = new PropertyLookupQuery1(); >- Object property = query1.getProperty("SomeOtherProperty"); >- assertEquals("1.0", null, property); >- } >- >- public void testIDLookup() { >- IQuery query1 = new PropertyLookupQuery1(); >- IQuery query2 = new PropertyLookupQuery2(); >- assertEquals("1.0", "org.eclipse.equinox.p2.tests.core.PropertyLookupQuery1", query1.getId()); >- assertEquals("1.0", "org.eclipse.equinox.p2.tests.core.PropertyLookupQuery2", query2.getId()); >- } >- > public void testPerformHooksOnQueryFail() { > List items = Arrays.asList("red", new Object()); > PerformHookQuery query = new PerformHookQuery(); >#P org.eclipse.equinox.p2.ui >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.46 >diff -u -r1.46 MANIFEST.MF >--- META-INF/MANIFEST.MF 24 Jan 2010 06:24:44 -0000 1.46 >+++ META-INF/MANIFEST.MF 3 Feb 2010 17:51:56 -0000 >@@ -13,7 +13,6 @@ > org.eclipse.equinox.internal.p2.metadata, > org.eclipse.equinox.internal.p2.metadata.query, > org.eclipse.equinox.internal.p2.metadata.repository, >- org.eclipse.equinox.internal.p2.query, > org.eclipse.equinox.internal.p2.repository.helpers, > org.eclipse.equinox.internal.provisional.configurator, > org.eclipse.equinox.internal.provisional.p2.core, >Index: src/org/eclipse/equinox/internal/p2/ui/RepositoryLocationQuery.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/RepositoryLocationQuery.java,v >retrieving revision 1.2 >diff -u -r1.2 RepositoryLocationQuery.java >--- src/org/eclipse/equinox/internal/p2/ui/RepositoryLocationQuery.java 13 Jan 2010 17:28:45 -0000 1.2 >+++ src/org/eclipse/equinox/internal/p2/ui/RepositoryLocationQuery.java 3 Feb 2010 17:51:56 -0000 >@@ -13,7 +13,6 @@ > > import java.net.URI; > import java.util.Iterator; >-import org.eclipse.equinox.internal.p2.query.QueryHelpers; > import org.eclipse.equinox.p2.query.*; > import org.eclipse.equinox.p2.repository.IRepository; > >@@ -27,21 +26,6 @@ > */ > public class RepositoryLocationQuery implements IQuery<URI> { > >- /** >- * Gets the ID for this Query. >- */ >- public String getId() { >- return QueryHelpers.getId(this); >- } >- >- /** >- * Gets a particular property of the query. >- * @param property The property to retrieve >- */ >- public Object getProperty(String property) { >- return QueryHelpers.getProperty(this, property); >- } >- > public IQueryResult<URI> perform(Iterator<URI> iterator) { > Collector<URI> result = new Collector<URI>(); > while (iterator.hasNext()) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 301658
: 158072