Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [incquery-dev] query specification registry

Hi,

if you mean find the generated PatternGroup classes, then no, we have no such method. Actually, the generic pattern groups are created by calling this method in the registry (generated pattern groups have their matchers hardcoded).

The strange code is not a bug (it still does the correct thing), but rather a remaining fragment of caching pattern groups in a map and returning that when called multiple times. That approach was problematic since for a given FQN, we have the directly contained and the whole subtree to store.

I think you can safely remove the if-then-else structure, as this caching is not really needed, we can always put something like this back when required.

You can use the registry to get all patterns that are registered in the extension point registry (or if someone stealthily registered it). It does not use the target platform, so if you start a runtime Eclipse, in that the registry will contain patterns from the EMF-IncQuery projects included in the run configuration (I think that was what you said as well).

Finally, if you want to find pattern groups that are in the workspace, you can simply go through the Workspace and (1) look at each project and check for incquery nature, (2) look at the list of exported packages (3) in each non-util package there will be a single class that has the same name as an EIQ file.

I'll leave you all with that funny thought: what happens if you have a xymatch.eiq file with a xy named pattern inside?

   Ábel Hegedüs

Fault Tolerant Systems Research Group
Department of Measurement and Information Systems
Budapest University of Technology and Economics


On 8 June 2013 20:38, Tamas Szabo <tamas.szabo@xxxxxxxxx> wrote:
Hi

I have found some strange code in the QuerySpecificationRegistry class, method
private static Set<IQuerySpecification<? extends IncQueryMatcher<? extends IPatternMatch>>> getPatternGroupOrSubTree(String packageFQN, boolean includeSubPackages).

In the body a new HashMap is created then it is checked whether it contains the key passed as an argument. This will always be false, then comes the rest of the lookup.
This registry contains the specifications from the plugins from the run config right?
Is there a way to query the pattern groups in the runtime (from those plugins that are only present in the runtime workspace)?

Regards,
Tomi
_______________________________________________
incquery-dev mailing list
incquery-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/incquery-dev


Back to the top