View | Details | Raw Unified | Return to bug 243692
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/ClasspathTests.java (+24 lines)
Lines 58-63 Link Here
58
import org.eclipse.jdt.internal.core.ClasspathEntry;
58
import org.eclipse.jdt.internal.core.ClasspathEntry;
59
import org.eclipse.jdt.internal.core.JavaModelManager;
59
import org.eclipse.jdt.internal.core.JavaModelManager;
60
import org.eclipse.jdt.internal.core.JavaProject;
60
import org.eclipse.jdt.internal.core.JavaProject;
61
import org.eclipse.team.core.RepositoryProvider;
61
62
62
public class ClasspathTests extends ModifyingResourceTests {
63
public class ClasspathTests extends ModifyingResourceTests {
63
64
Lines 3094-3099 Link Here
3094
		this.deleteProject("P");
3095
		this.deleteProject("P");
3095
	}
3096
	}
3096
}
3097
}
3098
/*
3099
 * Ensures that one can set a raw classpath if a pessimistic repository provider is used
3100
 * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=243692 )
3101
 */
3102
public void testPessimisticProvider() throws CoreException {
3103
	try {
3104
		IJavaProject javaProject = createJavaProject("P", new String[] {"src"}, "bin");
3105
		IProject project = javaProject.getProject();
3106
		try {
3107
			RepositoryProvider.map(project, TestPessimisticProvider.NATURE_ID);
3108
			IClasspathEntry[] rawClasspath = new IClasspathEntry[] {JavaCore.newSourceEntry(new Path("/P/src2"))};
3109
			setClasspath(javaProject, rawClasspath);
3110
			assertClasspathEquals(
3111
				javaProject.getRawClasspath(), 
3112
				"/P/src2[CPE_SOURCE][K_SOURCE][isExported:false]"
3113
			);
3114
		} finally {
3115
			RepositoryProvider.unmap(project);
3116
		}
3117
	} finally {
3118
		deleteProject("P");
3119
	}
3120
}
3097
/**
3121
/**
3098
 * Ensure that reading an empty custom output from the .classpath returns a non-null output location.
3122
 * Ensure that reading an empty custom output from the .classpath returns a non-null output location.
3099
 * (regression test for 28531 Classpath Entry: Output folder can not be set to project)
3123
 * (regression test for 28531 Classpath Entry: Output folder can not be set to project)
(-)model/org/eclipse/jdt/internal/core/JavaModelManager.java (-1 / +1 lines)
Lines 1240-1246 Link Here
1240
						}
1240
						}
1241
					}
1241
					}
1242
				},
1242
				},
1243
				this.project, // use project scheduling rule as this is needed to create the .classpath file if it doesn't exist yet
1243
				workspace.getRuleFactory().modifyRule(this.project), // use project modification rule as this is needed to create the .classpath file if it doesn't exist yet
1244
				IWorkspace.AVOID_UPDATE,
1244
				IWorkspace.AVOID_UPDATE,
1245
				null);
1245
				null);
1246
			} catch (JavaModelException e) {
1246
			} catch (JavaModelException e) {

Return to bug 243692