Compare commits

...

1 Commits

Author SHA1 Message Date
bhe-talendbj
3275b29f35 fix(TUP-29165): Add cache for all of current project nodes (#3827)
* fix(TUP-29165): Add cache for all of current project nodes

* fix(TUP-29165): Add cache for loaded nodes

* fix(TUP-29165): Not cache emfproject

* fix(TUP-29165): add projectlabel to key

* fix(TUP-29165): add object as key
2020-11-30 16:44:52 +08:00

View File

@@ -20,6 +20,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.resources.IFile;
@@ -94,6 +95,8 @@ public final class ProjectManager {
private Set<Project> tempProjects;
private WeakHashMap<IRepositoryViewObject, Boolean> cachedObjects = new WeakHashMap<IRepositoryViewObject, Boolean>();
private ProjectManager() {
beforeLogonRecords = new HashSet<String>();
logonRecords = new HashSet<String>();
@@ -451,9 +454,15 @@ public final class ProjectManager {
if (object == null) {
return true;
}
if (cachedObjects.containsKey(object)) {
return cachedObjects.get(object);
}
org.talend.core.model.properties.Project emfProject = getProject(object.getProperty().getItem());
org.talend.core.model.properties.Project curProject = curP.getEmfProject();
return emfProject.equals(curProject);
boolean ret = emfProject.equals(curProject);
cachedObjects.put(object, ret);
return ret;
} else {
IProjectRepositoryNode root = node.getRoot();