If you require 'n1.package = n2.package', then 'and' it with your exists
predicate
Your search will go quicker if you do Package.allInstances, then
do subloops of the package classifiers thereby rendering the same
package test redundant and excluding interpackage explorations from
the search domain.
Regards
Ed Willink
On 02/06/2010 16:26, pkojo wrote:
> Hi
>
> I am trying to find duplicate classes in a package, when I run my query
> it provides all duplicate classes from all packages of the model.
>
> My question is how can I find duplicate classes in a single package.
>
> right now I am running following query by selecting Packages as a
> context in eclipse OCL Interpreter console.
>
>
> Class.allInstances()->select(n1|Class.allInstances()->exists(n2|n1 <>n2
> and n1.name = n2.name))->asSet()->select(oclIsTypeOf(Class))
>
>
> Thanks in advance,
Hi Ed,
Thanks for the response but I did not get your point. can you please explain it with example query.
Quote:
If you require 'n1.package = n2.package', then 'and' it with your exists predicate
from this it looks that you are talking about duplicate packages. but I am looking for duplicate classes in a same package. I am running that query on a package.
Thanks,
pkojo