Lines 3965-4002
Link Here
|
3965 |
} |
3965 |
} |
3966 |
|
3966 |
|
3967 |
void save(ISaveContext context) throws IOException, JavaModelException { |
3967 |
void save(ISaveContext context) throws IOException, JavaModelException { |
3968 |
IProject project = context.getProject(); |
3968 |
saveProjects(getJavaModel().getJavaProjects()); |
3969 |
if (project == null) { // save all projects if none specified (snapshot or full save) |
3969 |
// remove variables that should not be saved |
3970 |
saveProjects(getJavaModel().getJavaProjects()); |
3970 |
HashMap varsToSave = null; |
3971 |
} |
3971 |
Iterator iterator = JavaModelManager.this.variables.entrySet().iterator(); |
3972 |
else { |
3972 |
IEclipsePreferences defaultPreferences = getDefaultPreferences(); |
3973 |
saveProjects(new IJavaProject[] {JavaCore.create(project)}); |
3973 |
while (iterator.hasNext()) { |
3974 |
} |
3974 |
Map.Entry entry = (Map.Entry) iterator.next(); |
3975 |
|
3975 |
String varName = (String) entry.getKey(); |
3976 |
switch (context.getKind()) { |
3976 |
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 |
3977 |
case ISaveContext.FULL_SAVE : |
3977 |
|| CP_ENTRY_IGNORE_PATH.equals(entry.getValue())) { |
3978 |
// TODO (eric) - investigate after 3.3 if variables should be saved for a SNAPSHOT |
3978 |
|
3979 |
case ISaveContext.SNAPSHOT : |
3979 |
if (varsToSave == null) |
3980 |
// remove variables that should not be saved |
3980 |
varsToSave = new HashMap(JavaModelManager.this.variables); |
3981 |
HashMap varsToSave = null; |
3981 |
varsToSave.remove(varName); |
3982 |
Iterator iterator = JavaModelManager.this.variables.entrySet().iterator(); |
3982 |
} |
3983 |
IEclipsePreferences defaultPreferences = getDefaultPreferences(); |
|
|
3984 |
while (iterator.hasNext()) { |
3985 |
Map.Entry entry = (Map.Entry) iterator.next(); |
3986 |
String varName = (String) entry.getKey(); |
3987 |
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 |
3988 |
|| CP_ENTRY_IGNORE_PATH.equals(entry.getValue())) { |
3989 |
|
3990 |
if (varsToSave == null) |
3991 |
varsToSave = new HashMap(JavaModelManager.this.variables); |
3992 |
varsToSave.remove(varName); |
3993 |
} |
3994 |
} |
3995 |
saveVariables(varsToSave != null ? varsToSave : JavaModelManager.this.variables); |
3996 |
break; |
3997 |
default : |
3998 |
// do nothing |
3999 |
} |
3983 |
} |
|
|
3984 |
saveVariables(varsToSave != null ? varsToSave : JavaModelManager.this.variables); |
4000 |
} |
3985 |
} |
4001 |
|
3986 |
|
4002 |
private void saveAccessRule(ClasspathAccessRule rule) throws IOException { |
3987 |
private void saveAccessRule(ClasspathAccessRule rule) throws IOException { |