Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 59455 Details for
Bug 174920
[model] closing a single project causes all variables and containers to be saved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
HEAD_javamodelmgr_closeprj.txt (text/plain), 4.28 KB, created by
Eric Jodet
on 2007-02-21 02:47:06 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Eric Jodet
Created:
2007-02-21 02:47:06 EST
Size:
4.28 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v >retrieving revision 1.353 >diff -u -r1.353 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 2 Feb 2007 14:47:50 -0000 1.353 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 16 Feb 2007 15:08:10 -0000 >@@ -3019,14 +3019,14 @@ > } > } > >- private void saveVariablesAndContainers() throws CoreException { >+ private void saveVariablesAndContainers(ISaveContext context) throws CoreException { > File file = getVariableAndContainersFile(); > DataOutputStream out = null; > try { > out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file))); > out.writeInt(VARIABLES_AND_CONTAINERS_FILE_VERSION); > if (VARIABLES_AND_CONTAINERS_FILE_VERSION != 1) >- new VariablesAndContainersSaveHelper(out).save(); >+ new VariablesAndContainersSaveHelper(out).save(context); > else { > // old code retained for performance comparisons > >@@ -3120,27 +3120,39 @@ > this.stringIds = new HashtableOfObjectToInt(); > } > >- void save() throws IOException, JavaModelException { >- saveProjects(JavaModelManager.this.getJavaModel().getJavaProjects()); >- >- // remove variables that should not be saved >- HashMap varsToSave = null; >- Iterator iterator = JavaModelManager.this.variables.entrySet().iterator(); >- IEclipsePreferences defaultPreferences = getDefaultPreferences(); >- while (iterator.hasNext()) { >- Map.Entry entry = (Map.Entry) iterator.next(); >- String varName = (String) entry.getKey(); >- if (defaultPreferences.get(CP_VARIABLE_PREFERENCES_PREFIX + varName, null) != null // don't save classpath variables from the default preferences as there is no delta if they are removed >- || CP_ENTRY_IGNORE_PATH.equals(entry.getValue())) { >- >- if (varsToSave == null) >- varsToSave = new HashMap(JavaModelManager.this.variables); >- varsToSave.remove(varName); >- } >- >+ void save(ISaveContext context) throws IOException, JavaModelException { >+ IProject project = context.getProject(); >+ if (project == null) { // save all projects if none specified (snapshot or full save) >+ saveProjects(JavaModelManager.this.getJavaModel().getJavaProjects()); >+ } >+ else { >+ saveProjects(new IJavaProject[] {JavaCore.create(project)}); > } > >- saveVariables(varsToSave != null ? varsToSave : JavaModelManager.this.variables); >+ switch (context.getKind()) { >+ case ISaveContext.FULL_SAVE : >+ case ISaveContext.SNAPSHOT : >+ // remove variables that should not be saved >+ HashMap varsToSave = null; >+ Iterator iterator = JavaModelManager.this.variables.entrySet().iterator(); >+ IEclipsePreferences defaultPreferences = getDefaultPreferences(); >+ while (iterator.hasNext()) { >+ Map.Entry entry = (Map.Entry) iterator.next(); >+ String varName = (String) entry.getKey(); >+ if (defaultPreferences.get(CP_VARIABLE_PREFERENCES_PREFIX + varName, null) != null // don't save classpath variables from the default preferences as there is no delta if they are removed >+ || CP_ENTRY_IGNORE_PATH.equals(entry.getValue())) { >+ >+ if (varsToSave == null) >+ varsToSave = new HashMap(JavaModelManager.this.variables); >+ varsToSave.remove(varName); >+ } >+ } >+ saveVariables(varsToSave != null ? varsToSave : JavaModelManager.this.variables); >+ >+ break; >+ default : >+ // do nothing >+ } > } > > private void saveAccessRule(ClasspathAccessRule rule) throws IOException { >@@ -3321,11 +3333,13 @@ > */ > public void saving(ISaveContext context) throws CoreException { > >- // save variable and container values on snapshot/full save >- long start = -1; >+ long start = -1; > if (VERBOSE) > start = System.currentTimeMillis(); >- saveVariablesAndContainers(); >+ >+ // save variable and container values on snapshot/full save >+ saveVariablesAndContainers(context); >+ > if (VERBOSE) > traceVariableAndContainers("Saved", start); //$NON-NLS-1$ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 174920
:
59455
|
59569
|
61053
|
62232