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

NPE in VersionUtil #1410

Merged
merged 1 commit into from
Sep 21, 2024
Merged

NPE in VersionUtil #1410

merged 1 commit into from
Sep 21, 2024

Conversation

Bananeweizen
Copy link
Contributor

Take same strategy as for a version string: Don't report an error for null values, assuming this just means absence of a version range.

java.lang.NullPointerException: Cannot invoke "String.length()" because "str" is null
at java.base/java.util.StringTokenizer.(StringTokenizer.java:199)
at org.osgi.framework.VersionRange.(VersionRange.java:137)
at org.eclipse.pde.internal.core.util.VersionUtil.validateVersionRange(VersionUtil.java:45)
at org.eclipse.pde.internal.core.builders.BundleErrorReporter.validateFragmentHost(BundleErrorReporter.java:480)
at org.eclipse.pde.internal.core.builders.BundleErrorReporter.validate(BundleErrorReporter.java:164)
at org.eclipse.pde.internal.core.builders.ErrorReporter.validateContent(ErrorReporter.java:109)
at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.validateManifestFile(ManifestConsistencyChecker.java:318)
at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.validateProject(ManifestConsistencyChecker.java:272)
at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.build(ManifestConsistencyChecker.java:194)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1077)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:296)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:352)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:441)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:444)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:555)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:503)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:585)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:595)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:484)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$6.run(SetupTaskPerformer.java:3909)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Take same strategy as for a version string: Don't report an error for
null values, assuming this just means absence of a version range.

java.lang.NullPointerException: Cannot invoke "String.length()" because
"str" is null
	at java.base/java.util.StringTokenizer.<init>(StringTokenizer.java:199)
	at org.osgi.framework.VersionRange.<init>(VersionRange.java:137)
	at org.eclipse.pde.internal.core.util.VersionUtil.validateVersionRange(VersionUtil.java:45)
	at org.eclipse.pde.internal.core.builders.BundleErrorReporter.validateFragmentHost(BundleErrorReporter.java:480)
	at org.eclipse.pde.internal.core.builders.BundleErrorReporter.validate(BundleErrorReporter.java:164)
	at org.eclipse.pde.internal.core.builders.ErrorReporter.validateContent(ErrorReporter.java:109)
	at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.validateManifestFile(ManifestConsistencyChecker.java:318)
	at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.validateProject(ManifestConsistencyChecker.java:272)
	at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.build(ManifestConsistencyChecker.java:194)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1077)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:296)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:352)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:441)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:444)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:555)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:503)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:585)
	at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:595)
	at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:484)
	at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$6.run(SetupTaskPerformer.java:3909)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Copy link

Test Results

  190 files   -    95    190 suites   - 95   35m 45s ⏱️ - 23m 1s
3 581 tests ±    0  3 505 ✅ ±    0   76 💤 ± 0  0 ❌ ±0 
7 290 runs   - 3 645  7 137 ✅  - 3 567  153 💤  - 78  0 ❌ ±0 

Results for commit b631794. ± Comparison against base commit b00c27d.

@merks merks merged commit e2e358f into eclipse-pde:master Sep 21, 2024
13 of 17 checks passed
@merks
Copy link
Contributor

merks commented Sep 21, 2024

It looks like the only issues are are related to Tycho 4.0.9

@Bananeweizen
Copy link
Contributor Author

Thanks @merks for clarification. I had a similar thought but wasn't sure enough to go ahead.

@Bananeweizen Bananeweizen deleted the npe_versionrange branch September 21, 2024 06:33
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.

2 participants