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

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/JavaProject.java (-4 / +11 lines)
Lines 122-133 Link Here
122
122
123
	/**
123
	/**
124
	 * Name of file containing custom project preferences
124
	 * Name of file containing custom project preferences
125
	 * @deprecated WARNING Visibility will be reduce to private before M9
126
	 * 	If you use this variable, change your implementation to avoid future compilation error...
127
	 * @see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=59258">bug 59258</a>
125
	 * @see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=59258">bug 59258</a>
128
	 * TODO (frederic) set visibility from public to private
129
	 */
126
	 */
130
	public static final String PREF_FILENAME = ".jprefs";  //$NON-NLS-1$
127
	private static final String PREF_FILENAME = ".jprefs";  //$NON-NLS-1$
128
	
129
	/**
130
	 * Name of directory containing preferences file
131
	 */
132
	public static final String DEFAULT_PREFERENCES_DIRNAME = ".settings"; //$NON-NLS-1$
133
	
134
	/**
135
	 * Extension for file containing custom project preferences
136
	 */
137
	public static final String JAVA_CORE_PREFS_FILE = JavaCore.PLUGIN_ID+".prefs"; //$NON-NLS-1$
131
	
138
	
132
	/*
139
	/*
133
	 * Value of project's resolved classpath while it is being resolved
140
	 * Value of project's resolved classpath while it is being resolved
(-)model/org/eclipse/jdt/internal/core/DeltaProcessor.java (-2 / +9 lines)
Lines 2177-2186 Link Here
2177
						break;
2177
						break;
2178
				}
2178
				}
2179
				break;
2179
				break;
2180
			case IResource.FOLDER :
2181
				/* check settings change */
2182
				IFolder folder = (IFolder) resource;
2183
				processChildren = folder.getName().equals(JavaProject.DEFAULT_PREFERENCES_DIRNAME);
2184
				break;
2180
			case IResource.FILE :
2185
			case IResource.FILE :
2181
				/* check classpath file change */
2186
				/* check classpath or prefs files change */
2182
				IFile file = (IFile) resource;
2187
				IFile file = (IFile) resource;
2183
				if (file.getName().equals(JavaProject.CLASSPATH_FILENAME)) {
2188
				String fileName = file.getName();
2189
				if (fileName.equals(JavaProject.CLASSPATH_FILENAME) ||
2190
					fileName.equals(JavaProject.JAVA_CORE_PREFS_FILE)) {
2184
					JavaProject javaProject = (JavaProject)JavaCore.create(file.getProject());
2191
					JavaProject javaProject = (JavaProject)JavaCore.create(file.getProject());
2185
					this.state.addClasspathValidation(javaProject);
2192
					this.state.addClasspathValidation(javaProject);
2186
					affectedProjects.add(file.getProject().getFullPath());
2193
					affectedProjects.add(file.getProject().getFullPath());
(-)src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java (-7 / +11 lines)
Lines 441-447 Link Here
441
		Problem[] prob1 = env.getProblemsFor(classTest1);
441
		Problem[] prob1 = env.getProblemsFor(classTest1);
442
		Problem[] prob2 = env.getProblemsFor(classTest2);
442
		Problem[] prob2 = env.getProblemsFor(classTest2);
443
		Problem[] prob3 = env.getProblemsFor(classTest3);
443
		Problem[] prob3 = env.getProblemsFor(classTest3);
444
		assertEquals("too many problems", prob1.length + prob2.length + prob3.length,1); //$NON-NLS-1$
444
		assertEquals("too many problems", prob1.length + prob2.length + prob3.length, 1); //$NON-NLS-1$
445
		if(prob1.length == 1) {
445
		if(prob1.length == 1) {
446
			expectingSpecificProblemFor(classTest1, new Problem("p1", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest1, -1, -1, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$
446
			expectingSpecificProblemFor(classTest1, new Problem("p1", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest1, -1, -1, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$
447
		} else if (prob2.length == 1) {
447
		} else if (prob2.length == 1) {
Lines 465-501 Link Here
465
	}
465
	}
466
466
467
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345
467
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345
468
public void _testMissingLibrary3() throws JavaModelException {
468
public void testMissingLibrary3() throws JavaModelException {
469
	IPath projectPath = env.addProject("Project");
469
	IPath projectPath = env.addProject("Project");
470
	IJavaProject project = env.getJavaProject(projectPath);
470
	IJavaProject project = env.getJavaProject(projectPath);
471
	fullBuild();
471
	fullBuild();
472
	expectingNoProblems();
472
	expectingNoProblems();
473
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.WARNING);
473
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.WARNING);
474
	env.addLibrary(projectPath, projectPath.append("/lib/dummy.jar"), null, null);
474
	env.addLibrary(projectPath, projectPath.append("/lib/dummy.jar"), null, null);
475
	// triggers a build
475
	fullBuild();
476
	expectingSpecificProblemFor(
476
	expectingSpecificProblemFor(
477
		projectPath,
477
		projectPath,
478
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH,
478
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH,
479
				IMarker.SEVERITY_WARNING));
479
				IMarker.SEVERITY_WARNING));
480
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.ERROR);
480
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.ERROR);
481
	cleanBuild();
481
	// force classpath change delta - should not have to do this
482
	IClasspathEntry[] classpath = project.getRawClasspath();
483
	IPath outputLocation;
484
	project.setRawClasspath(null, outputLocation = project.getOutputLocation(), false, null);
485
	project.setRawClasspath(classpath, outputLocation, false, null);
486
	fullBuild();
482
	expectingSpecificProblemFor(
487
	expectingSpecificProblemFor(
483
		projectPath,
488
		projectPath,
484
		new Problem("", "The project cannot be built until build path errors are resolved", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
489
		new Problem("", "The project cannot be built until build path errors are resolved", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
485
	expectingSpecificProblemFor(
490
	expectingSpecificProblemFor(
486
		projectPath,
491
		projectPath,
487
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
492
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
488
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.WARNING);
489
}
493
}
490
	
494
	
491
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345
495
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345
492
public void _testMissingLibrary4() throws JavaModelException {
496
public void testMissingLibrary4() throws JavaModelException {
493
	IPath projectPath = env.addProject("Project");
497
	IPath projectPath = env.addProject("Project");
494
	IJavaProject project = env.getJavaProject(projectPath);
498
	IJavaProject project = env.getJavaProject(projectPath);
495
	fullBuild();
499
	fullBuild();
496
	expectingNoProblems();
500
	expectingNoProblems();
497
	env.addLibrary(projectPath, projectPath.append("/lib/dummy.jar"), null, null);
501
	env.addLibrary(projectPath, projectPath.append("/lib/dummy.jar"), null, null);
498
	// triggers a build
502
	fullBuild();
499
	expectingSpecificProblemFor(
503
	expectingSpecificProblemFor(
500
		projectPath,
504
		projectPath,
501
		new Problem("", "The project cannot be built until build path errors are resolved", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
505
		new Problem("", "The project cannot be built until build path errors are resolved", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));

Return to bug 172345