Commit 74356b63 authored by Marco Konersmann's avatar Marco Konersmann

Clears the cache before code2im execution

parent 3d77d105
......@@ -27,15 +27,15 @@ public class ASTCache {
public float getHitRatio() {
if (requests == 0)
return 0f;
return (float)hits / (float)requests;
return (float) hits / (float) requests;
}
LinkedHashMap<IJavaElement, IPackageFragmentRoot> packageFragmentRoots = new LinkedHashMap<>();
public IPackageFragmentRoot getPackageFragmentRoot(IJavaElement element) {
requests++;
requests++;
IPackageFragmentRoot result = packageFragmentRoots.get(element);
if(result != null)
if (result != null)
hits++;
return result;
}
......@@ -44,4 +44,8 @@ public class ASTCache {
packageFragmentRoots.put(element, fragmentRoot);
}
public void clear() {
packageFragmentRoots.clear();
}
}
......@@ -36,6 +36,7 @@ public class JavaToModelTransformation extends ModelIntegrationConceptTransforma
@Override
protected void doExecute(IProgressMonitor monitor) {
ASTCache.instance().clear(); // Clear the cache for translation support
rootTransformation.setToModel();
// Translate all classes, their attributes, and the containment
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment