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

Quick fix added for invalid characters in MANIFEST header #1625

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nburnwal09
Copy link

This is to provide quick fix for invalid header name in MANIFEST.MF
It will provide fix by removing all the invalid characters (characters other than alpha numeric characters, '-' and '_')
for eg. in the below image, added a space after 'Require-Bundle' header
the added quick fix label is 'Remove invalid characters from header'. Once user clicks on 'Finish', it updates the header

image

Attaching another example
image

Copy link

Test Results

   285 files  +   285     285 suites  +285   51m 29s ⏱️ + 51m 29s
 3 608 tests + 3 608   3 532 ✅ + 3 532   76 💤 + 76  0 ❌ ±0 
11 016 runs  +11 016  10 785 ✅ +10 785  231 💤 +231  0 ❌ ±0 

Results for commit 34cea75. ± Comparison against base commit 515f996.

@iloveeclipse
Copy link
Member

invalid header name

You probably mean attribute? See official wording at java.util.jar.Manifest.
If so, please change the wording overall - e.g. "Remove invalid characters from attribute name" etc.

@laeubi
Copy link
Contributor

laeubi commented Feb 21, 2025

The OSGi speci always uses Bundle Headers as wording.

https://docs.osgi.org/reference/bundle-headers.html

Even Orcale name things in the main section "Header":

https://docs.oracle.com/javase/tutorial/deployment/jar/defman.html

These lines show that a manifest's entries take the form of "header: value" pairs. The name of a header is separated from its value by a colon. The default manifest conforms to version 1.0 of the manifest specification and was created by the 1.7.0_06 version of the JDK

So I think talking about "attributes" would be highly confusing.

@nburnwal09
Copy link
Author

nburnwal09 commented Feb 24, 2025

As far as I have understood, the work 'attribute' would mean both, the "key: value" pair. But I have provided fix for removing invalid characters only from key(Header part).
So, have labeled it as 'Remove invalid characters from header'
Kindly confirm on this, and if it is okay, could you please approve this PR?
@laeubi

@laeubi
Copy link
Contributor

laeubi commented Feb 24, 2025

The Jar Specification explicitly allows both values:

information contained within the manifest file and signature files is represented as so-called "name: value" pairs inspired by the RFC822 standard. We also call these pairs headers or attributes.
Groups of name-value pairs are known as a "section"

So I think both can be used but "Header" is much more commonly understood.

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