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

Generated Java file start with a blank line - JFormatter#write(JDefinedClass c) #1667

Open
BlackBoxThe opened this issue Oct 19, 2022 · 2 comments

Comments

@BlackBoxThe
Copy link

In the Java class JFormatter this line of code "force" to add an empty line before the package line.

There is a reason for that ?

If not is it possible to suppress the call of nl() before d(pkg); ?

Example of rendering java class generated with :


package my.company

import ...

/**
* Javadoc
*/

@Xml...
@XmlRootElement
public class MyClass{

Thanks

@BlackBoxThe BlackBoxThe changed the title Java file start with a blank line Generated Java file start with a blank line - JFormatter#write(JDefinedClass c) Oct 19, 2022
@antoniosanct
Copy link
Contributor

antoniosanct commented Sep 11, 2023

@BlackBoxThe

I guess that forces newline to write space after JAXB (optional) declaration. If you want to use JAXB (optional) declaration and first nl() doesn't exist, the proper JAXB declaration and package declaration wouldn't have space between lines. I think it's correct that nl() before that .d(pkg).

Regards,
Antonio.

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

No branches or pull requests

2 participants