--
You received this message because you are subscribed to the Google Groups "EMF-IncQuery Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/incquery-users/-/RbsfVPqaaxMJ.
To post to this group, send email to incquer...@googlegroups.com.
To unsubscribe from this group, send email to incquery-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/incquery-users?hl=en.
Dear Javier,welcome to the list :-)As for your issue, the main problem is that you are trying to run IncQuery in a standalone Java application, which is not supported (at the moment, this may change in the future). Instead, we recommend you to run this as an OSGi (RCP) application, as described at http://viatra.inf.mit.bme.hu/incquery/new/examples/applicationThen, the exception will go away. This page also includes some example code which you may find useful, as it demonstrates the recommended way of using the IncQuery Java API.(I know that this exception is not a very good indication of this problem, we'll try to improve on this shortly.)An additional remark about your code: as far as I have noticed, you are trying to do a performance benchmark. I highly recommend you to read http://viatra.inf.mit.bme.hu/performance as it discusses a number of common issues that need to be taken into consideration.cheersIstvan
To post to this group, send email to incquery-users@googlegroups.com.
To unsubscribe from this group, send email to incquery-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/incquery-users?hl=en.
--István
I will try to run IncQuery inside an RCP application although it would be a disadvantage on performance against other solutions I am currently benchmarking.
I have already read your suggestions on performance benchmarking but I do not find them convincing.
Based on my little experience on benchmarking, I have found that a Java application may experiment peaks on its memory usage that are not reflected by the totalMemory() method (e.g. intermediate data structures built for querying or other purposes that are freed before the end of the execution). I do not know if IncQuery doesn't produce such peaks, but anyways I find more reliable using JConsole to visually trace the memory usage of a Java application.
Anyway, I suppose that both approaches are valid, it just depends on the goal you seek.
pattern methodWithReturnType(M : MethodDeclaration, S : String)= {
MethodDeclaration.returnType(M, R);
SimpleType(R);
SimpleType.name.fullyQualifiedName(R, S2);
check(S2.equals(S));
}
pattern methodWithReturnType(M : MethodDeclaration, S : String)= {
MethodDeclaration.returnType(M, R);
SimpleType(R);
SimpleType.name.fullyQualifiedName(R, S);
//check(S2.equals(S));
}
package grabats
import "org.amma.dsl.jdt.dom"
import "org.amma.dsl.jdt.primitiveTypes"
//pattern isStatic(M : Modifier)= {
// Modifier.static(M, true);
//}
//
//pattern isPublic(M : Modifier)= {
// Modifier.public(M, true);
//}
//pattern methodOfType(T : TypeDeclaration, M : MethodDeclaration)= {
// TypeDeclaration.bodyDeclarations(T, M);
//}
pattern methodWithReturnType(M : MethodDeclaration, S : String)= {
MethodDeclaration.returnType(M, R);
SimpleType(R);
SimpleType.name.fullyQualifiedName(R, S);
//check(S2.equals(S));
}
pattern grabats(T : TypeDeclaration, M : MethodDeclaration)= {
//find methodOfType(T, M);
TypeDeclaration.bodyDeclarations(T, M);
TypeDeclaration.name.fullyQualifiedName(T, S);
find methodWithReturnType(M, S);
MethodDeclaration.modifiers(M, MF1);
MethodDeclaration.modifiers(M, MF2);
MF1 != MF2 ;
//find isPublic(MF1);
Modifier.public(M, true);
//find isStatic(MF2);
Modifier.static(M, true);
}
After these changes, the evaluation on set0.xmi (on my computer) is instantaneous.
Istvan
pattern grabats(T : TypeDeclaration, M : MethodDeclaration)= {
//find methodOfType(T, M);
TypeDeclaration.bodyDeclarations(T, M);
TypeDeclaration.name.fullyQualifiedName(T, S);
find methodWithReturnType(M, S);
MethodDeclaration.modifiers(M, MF1);
MethodDeclaration.modifiers(M, MF2);
MF1 != MF2 ;
//find isPublic(MF1);
Modifier.public(MF1, true);
//find isStatic(MF2);
Modifier.static(MF2, true);
}