Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove resolve classpath when fetching a raw classpath #3531

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

laeubi
Copy link
Contributor

@laeubi laeubi commented Jan 7, 2025

@laeubi
Copy link
Contributor Author

laeubi commented Jan 7, 2025

@iloveeclipse @jarthana please review/merge

@iloveeclipse
Copy link
Member

@jarthana and @szarnekow : any objections?

Assuming that the raw classpath (and resolved anyway) should be set before any clients can start to play with JDT classpath related code, if some clients are run into the problem after this change would indicate client issue.

@jarthana jarthana self-requested a review January 8, 2025 04:19
@jarthana jarthana merged commit b79bd1d into eclipse-jdt:master Jan 8, 2025
10 checks passed
@iloveeclipse
Copy link
Member

iloveeclipse commented Jan 8, 2025

I see one PDE test fail which probably could be related:
https://download.eclipse.org/eclipse/downloads/drops4/I20250108-0430/testresults/html/org.eclipse.pde.ui.tests_ep435I-unit-win32-x86_64-java21_win32.win32.x86_64_21.html

testImportLinksMultiple[Import binary]

C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot\lib\jrt-fs.jar is not on its project's build path

Java Model Exception: Error in Java Model (code 1006): C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot\lib\jrt-fs.jar is not on its project's build path
at org.eclipse.jdt.internal.core.PackageFragmentRoot.getRawClasspathEntry(PackageFragmentRoot.java:621)
at org.eclipse.pde.ui.tests.imports.BaseImportTestCase.assertSourceAttached(BaseImportTestCase.java:202)
at org.eclipse.pde.ui.tests.imports.BaseImportTestCase.verifyProject(BaseImportTestCase.java:189)
at org.eclipse.pde.ui.tests.imports.BaseImportTestCase.testImportLinksMultiple(BaseImportTestCase.java:120)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)

However these tests run fine locally. I guess MT or timing issue.

Code does basically this:

IJavaProject jProject = JavaCore.create(project);
		for (IPackageFragmentRoot root : jProject.getPackageFragmentRoots()) {
			IClasspathEntry entry = root.getRawClasspathEntry();
			if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY
					|| (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER)
					&& !entry.getPath().equals(PDECore.REQUIRED_PLUGINS_CONTAINER_PATH)) {
				assertNotNull("Missing source attachement for entry " + entry, root.getSourceAttachmentPath());
			}
		}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants