Skip to content

fix: Corrected a problem where the version was null in the desktop version.#1643

Merged
jcpitre merged 3 commits intomasterfrom
1606-report-generated-from-desktop-app-not-showing-version-number
Jan 16, 2024
Merged

fix: Corrected a problem where the version was null in the desktop version.#1643
jcpitre merged 3 commits intomasterfrom
1606-report-generated-from-desktop-app-not-showing-version-number

Conversation

@jcpitre
Copy link
Copy Markdown
Contributor

@jcpitre jcpitre commented Jan 15, 2024

Summary:
closes #1606
The version in the html report was null with the desktop version of the validator.

Expected behavior:

It should be the current version.

Please make sure these boxes are checked before submitting your pull request - thanks!

@jcpitre jcpitre linked an issue Jan 15, 2024 that may be closed by this pull request
@jcpitre jcpitre marked this pull request as draft January 15, 2024 23:06
@github-actions
Copy link
Copy Markdown
Contributor

✅ Rule acceptance tests passed.
New Errors: 0 out of 1479 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Errors: 0 out of 1479 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
New Warnings: 0 out of 1479 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Warnings: 0 out of 1479 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
0 out of 1479 sources (~0 %) are corrupted.
Commit: f709461
Download the full acceptance test report here (report will disappear after 90 days).
✅ Rule acceptance tests passed.

@jcpitre jcpitre changed the title Corrected a problem where the version was null in the desktop version. fix: Corrected a problem where the version was null in the desktop version. Jan 16, 2024
@jcpitre
Copy link
Copy Markdown
Contributor Author

jcpitre commented Jan 16, 2024

This is the Exception that caused the problem.

SEVERE: Error resolving version infojava.lang.RuntimeException: Unable to invoke no-args constructor for class org.mobilitydata.gtfsvalidator.util.VersionResolver$VersionResponse. Registering an InstanceCreator with Gson for this type may fix this problem.
	at [email protected]/com.google.gson.internal.ConstructorConstructor$14.construct(Unknown Source)
	at [email protected]/com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(Unknown Source)
	at [email protected]/com.google.gson.Gson.fromJson(Unknown Source)
	at [email protected]/com.google.gson.Gson.fromJson(Unknown Source)
	at [email protected]/org.mobilitydata.gtfsvalidator.util.VersionResolver.resolveLatestReleaseVersion(Unknown Source)
	at [email protected]/org.mobilitydata.gtfsvalidator.util.VersionResolver.lambda$resolve$0(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsupportedOperationException: Cannot allocate class org.mobilitydata.gtfsvalidator.util.VersionResolver$VersionResponse
	at [email protected]/com.google.gson.internal.UnsafeAllocator$4.newInstance(Unknown Source)
	... 10 more

I suspect it has to do with the fact that the jars have to be converted to java modules to be able to use jpackage. jpackage creates the installers.
Java modules must have a different way to manage class loaders that resulted in the Exception. This is partly speculation on my part.

Addendum:
Now that I think of it, it seems that the way it was before was wrong and I don't know how it worked.
VersionResolver had a package visibility. Then how come the class could be used in a call to a method from outside the package gson.fromJson(in, VersionResponse.class) ?

@jcpitre jcpitre marked this pull request as ready for review January 16, 2024 05:03
@jcpitre jcpitre requested a review from bdferris-v2 January 16, 2024 05:03
@github-actions
Copy link
Copy Markdown
Contributor

✅ Rule acceptance tests passed.
New Errors: 0 out of 1477 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Errors: 0 out of 1477 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
New Warnings: 0 out of 1477 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Warnings: 0 out of 1477 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
2 out of 1479 sources (~0 %) are corrupted.
Corrupted sources:
us-maryland-bwi-thurgood-marshall-airport-bwi-shuttle-gtfs-490
us-massachusetts-peter-pan-gtfs-496
Commit: 69c96b6
Download the full acceptance test report here (report will disappear after 90 days).
✅ Rule acceptance tests passed.

Copy link
Copy Markdown
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bdferris-v2
Copy link
Copy Markdown
Collaborator

bdferris-v2 commented Jan 16, 2024

If this really is the fix, then I'm also not sure why it worked before. Which is to say, maybe it never did in a packaged application, as you mentioned.

@github-actions
Copy link
Copy Markdown
Contributor

✅ Rule acceptance tests passed.
New Errors: 0 out of 1479 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Errors: 0 out of 1479 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
New Warnings: 0 out of 1479 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Warnings: 0 out of 1479 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
0 out of 1479 sources (~0 %) are corrupted.
Commit: 0129f95
Download the full acceptance test report here (report will disappear after 90 days).
✅ Rule acceptance tests passed.

@jcpitre jcpitre merged commit c19527b into master Jan 16, 2024
@jcpitre jcpitre deleted the 1606-report-generated-from-desktop-app-not-showing-version-number branch January 16, 2024 21:02
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.

Report generated from desktop app not showing version number

3 participants