-
Notifications
You must be signed in to change notification settings - Fork 106
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
avoid static imports in Java sample code #140
base: main
Are you sure you want to change the base?
Conversation
in case this code is copied to an IDE the imports are missing and you have a bit of a challenge to find the right import for the static imports (VS Code Java extension does not support it at all at the moment). Alternatively we could also use the new 'focus' feature for code blocks and include the static import statements as 'unfocused' but have them included in the clipboard after clicking the copy button.
I think the static imports improve readability but should be mentioned somewhere |
java/development/index.md
Outdated
@Autowired | ||
@Qualifier(CatalogService_.CDS_NAME) | ||
private CqnService catalogService; | ||
@Autowired |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid tabs as they are rendered with 8 (!) spaces
Some of the statically imported symbols are ambiguous when being imported to an IDE. Even worse, VS Code has no way to resolve the imports with a code action. So, either we avoid static imports (first commit) or have the imports as part of the code block (but blur them) in order to guide the readers eye. |
Can this be merged? I had the feeling it's not final, that's why I'm asking. |
Let's at least update with the base branch. @agoerler merge or talk? ;) |
talk :-) |
in case this code is copied to an IDE the imports are missing and you have a bit of a challenge to find the right import for the static imports (VS Code Java extension does not support it at all at the moment).
Alternatively we could also use the new 'focus' feature for code blocks and include the static import statements as 'unfocused' but have them included in the clipboard after clicking the copy button.