View | Details | Raw Unified | Return to bug 327471 | Differences between
and this patch

Collapse All | Expand All

(-)buildnotes_jdt-core.html (-1 / +3 lines)
Lines 110-116 Link Here
110
</ul>
110
</ul>
111
111
112
<h3>Problem Reports Fixed</h3>
112
<h3>Problem Reports Fixed</h3>
113
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=327143">327143</a>
113
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=327471">327471</a>
114
java.io.EOFException at java.io.DataInputStream.readInt(Unknown Source)
115
<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=327143">327143</a>
114
IndexManager should not accept new jobs if the processing thread is null
116
IndexManager should not accept new jobs if the processing thread is null
115
<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=332619">332619</a>
117
<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=332619">332619</a>
116
Small error in IType#codeComplete Javadoc example
118
Small error in IType#codeComplete Javadoc example
(-)model/org/eclipse/jdt/internal/core/JavaModelManager.java (-31 / +16 lines)
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 {
(-)src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java (+34 lines)
Lines 1034-1039 Link Here
1034
	}
1034
	}
1035
}
1035
}
1036
1036
1037
1038
/*
1039
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=327471
1040
 * [java.io.EOFException at java.io.DataInputStream.readInt(Unknown Source)]
1041
 * This test ensures that there is no exception on a restart of eclipse after
1042
 * the project is closed after the workspace save
1043
 */
1044
public void testContainerInitializer26() throws CoreException {
1045
	try {
1046
		createProject("P1");
1047
		createFile("/P1/lib.jar", "");
1048
		ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P2", "/P1/lib.jar"}));
1049
		IJavaProject p2 = createJavaProject(
1050
				"P2",
1051
				new String[] {},
1052
				new String[] {"org.eclipse.jdt.core.tests.model.TEST_CONTAINER"},
1053
				"");
1054
		ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P2", "/P1"}));
1055
		
1056
		waitForAutoBuild();
1057
		getWorkspace().save(true/*full save*/, null/*no progress*/);		
1058
		p2.getProject().close(null); // close the project after the save and before the shutdown
1059
		JavaModelManager.getJavaModelManager().shutdown();
1060
		
1061
		startLogListening();
1062
		simulateRestart();
1063
		assertLogEquals(""); // no error should be logged
1064
1065
	} finally {
1066
		stopLogListening();
1067
		deleteProject("P1");
1068
		deleteProject("P2");
1069
	}
1070
}
1037
public void testVariableInitializer01() throws CoreException {
1071
public void testVariableInitializer01() throws CoreException {
1038
	try {
1072
	try {
1039
		createProject("P1");
1073
		createProject("P1");

Return to bug 327471