Community
Participate
Working Groups
20030107 New project with classpath set to setRawClasspath(new ClasspathEntry[0], new Path("proj/bin"), null); File src/junit/test/X.java: (File is a valid Java file) ICompilationUnit cu= JavaCore.createCompilationUnitFrom(file); if (cu != null) { ICompilationUnit workingCopy= null; try { workingCopy= (ICompilationUnit) cu.getWorkingCopy(); workingCopy.getSource is Empty. As soon as you set the class path to at least one source folder, content can be read. See test case: ClassPathDetectorTest
When opening the working copy (in Openable.openwhenClosed()), opening the buffer was skipped because the working copy had a null IResource. Fixed by moving the check for null in openBuffer(). Added regression test WorkingCopyNonInClasspathTests.testGetSource()
Verified.