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

MT-hardening builder.ClasspathJar.knownPackageNames #3250 #3255

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

jukzi
Copy link
Contributor

@jukzi jukzi commented Nov 5, 2024

  • use Set
  • cache a unmodifiable copy
  • simplify PackageCacheEntry to record
  • add missing final/volatile modifiers
  • remove ClasspathJrt.PackageCache (only module names had been used)
  • don't calculate unused location of module.info
  • remove closeZipFileAtEnd (was always true when zipfile!=null)

#3250

@@ -71,13 +67,6 @@ public ClasspathJrtWithReleaseOption(String zipFilename, AccessRuleSet accessRul
this.externalAnnotationPath = externalAnnotationPath.toString();
}
this.release = getReleaseOptionFromCompliance(release);
JrtFileSystem systemForRelease = null;
Copy link
Member

Choose a reason for hiding this comment

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

Why is this code removed? How it relates to the MT cleanup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Compiler complained the code is unused after refactoring (to compute only modules not packages)

@iloveeclipse
Copy link
Member

I'm away from keyboard till next Monday, but looking on the touched code & failed test cases I would recommend to be careful, the module/JRT code evolved a lot over time with all the extra cases for every new Java version / feature added to the undocumented JRT file system.

@jarthana and @stephan-herrmann should know what I mean and should be able to help with the review, but first the tests should be green again :-)

* use Set<String>
* cache a unmodifiable copy
* simplify PackageCacheEntry to record
* add missing final/volatile modifiers
* remove ClasspathJrt.PackageCache (only module names had been used)
* don't calculate unused location of module.info
* remove closeZipFileAtEnd (was always true when zipfile!=null)

eclipse-jdt#3250
@jukzi
Copy link
Contributor Author

jukzi commented Nov 6, 2024

should be green again

tests failed because i used modulesCache.keySet(), instead of modulesCache.get(jrt.getKey()).keySet() in getModuleNames(). Unfortunatly both are Set<String> now, while one contains the jrt filenames and ther later the modulenames

And remove duplicate code in
ClasspathJrtWithReleaseOption.getModuleNames()
@jukzi
Copy link
Contributor Author

jukzi commented Nov 8, 2024

If anybody wants to review, please do it by Monday or leave a message.

@jukzi jukzi merged commit 9398905 into eclipse-jdt:master Nov 12, 2024
10 checks passed
@jukzi jukzi deleted the knownPackageNames branch November 12, 2024 07:47
});

return entry.packageSet;
}
protected String readJarContent(final SimpleSet packageSet) {
String modInfo = null;
/** overloaded */
Copy link
Contributor

Choose a reason for hiding this comment

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

@jukzi this comment looks plain wrong.

Additionally a reference to the issue / PR is missing from the commit comment.

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.

4 participants