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
8301443: Clean broken comments from Windows code #12305
Conversation
👋 Welcome back jwaters! A progress list of the required criteria for merging this PR into |
@TheShermanTanker The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
@wangweij Sorry for the abrupt tag, but would the sspi.cpp change be fine with you? It seems like the comment is intended to signal a newline so the compile command's second half on the next line is read properly, but Visual C++ will simply interpret it as the object file \.o, which isn't correct, but I don't quite know the context behind that comment so I thought I'd ask first (On top of the fact that cmd doesn't allow newline formatted commands at all) |
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.
Except for the change in sspi.cpp
, it looks good to me.
// cl -I %OPENJDK%\src\java.security.jgss\share\native\libj2gss\ sspi.cpp \ | ||
// cl -I %OPENJDK%\src\java.security.jgss\share\native\libj2gss\ sspi.cpp | ||
// -link -dll -out:sspi_bridge.dll |
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.
I think the backslash \
should remain there: it's a command line and \
is used to wrap the long line.
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.
I did think about that too when I first saw it, but the command this is often run from is the Windows CMD, which does not accept \
to escape to the next line. MSYS bash does not have the required environment set up outside of configure time to run cl
either, but I have not tested with WSL yet. I suppose one could do the complicated setup required to be able to run this from the winenv provided bash, but that seems like a lot of hassle, enough that to me someone trying to compile sspi_bridge.dll by itself wouldn't really bother with the process. On top of that cl.exe will actually interpret the backslash as the literal object file \.o
for some weird reason. I've already pinged the original author of the file @wangweij above to ask for guidance on this as such
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.
I have no objection to the code change. Or maybe you can change it to the windows line extension character ^
.
I was using this command for quick recompiling while writing this code, and it's in a cmd.exe
window launched with a start menu item named something like "Visual Studio Developing Environment". I wrote it inside here to remind myself if I need to rework on it.
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.
I used to have Visual Studio compilers available in my Cygwin environment. Now I don't, I just point the configure
script to the batch file which configures the environment.
If this command is supposed to be run in cmd.exe
, then ^
makes more sense: one could just copy & paste the command.
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.
I've just tried copying and pasting the command with ^ instead of \ and cmd doesn't seem to be correctly reading the compile command either even with ^, is there something I'm missing here?
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.
I don't know. I'm quite sure I was using the full command in cmd.exe
after calling some vcvars64.bat
. I added the \
character because it's a little long to be recorded here. I don't really care which separator is used. You can remove the \
character. We don't need to spend too much time on this.
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.
Honestly, with all of this confusion around the command line, I think I'd rather just avoid the issue entirely by turning this into a multiline comment so the backslash doesn't cause compiler warnings
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.
I don't know what the error message you get, but ^
definitely works for me as continuation line marker in cmd.exe
.
C:\dev\jdk-dev>cl -I %OPENJDK%\src\java.security.jgss\share\native\libj2gss\ sspi.cpp ^
More? -link -dll -out:sspi_bridge.dll
'cl' is not recognized as an internal or external command,
operable program or batch file.
This More?
prompt identifies the continuation line.
Anyway, we decided to leave it as is but convert to multi-line comment, which is fine with me.
@TheShermanTanker This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 11 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/* | ||
HWND hList = GetListHandle(); | ||
if (hList != NULL) { | ||
long flags = SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS; | ||
/* | ||
* Fix for bug 4046446. | ||
* / | ||
SetWindowPos(hList, 0, 0, 0, w, h, flags); | ||
} | ||
*/ | ||
// | ||
// HWND hList = GetListHandle(); | ||
// if (hList != NULL) { | ||
// long flags = SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS; | ||
// /* | ||
// * Fix for bug 4046446. | ||
// */ | ||
// SetWindowPos(hList, 0, 0, 0, w, h, flags); | ||
// } | ||
// |
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.
Maybe it's time to remove this commented out code? It's been commented out since 2007 when the code moved to Mercurial.
If you decide to remove it, please submit a new issue to communicate the intention clearly.
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.
Perhaps, but I'll leave that to the discretion of the client libs group. Are the new changes fine with you though?
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.
I'd rather remove the offending commented out code than change its formatting.
Could you submit a bug, please, and assign it to me?
There's a closed test associated with JDK-4046446, it can be open-sourced. Then it'll be safe to remove the commented out code.
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.
Alright here you go :) https://bugs.openjdk.org/browse/JDK-8301994
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.
Alright here you go :) https://bugs.openjdk.org/browse/JDK-8301994
Thank you, @TheShermanTanker.
Do you still want to keep the changes?
If it's not too critical, I would rather prefer you revert the changes to awt_List.cpp
.
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.
No worries, I'm fine with reverting awt_List.cpp
, I can set my local branch up to avoid a rebase conflict when the commented code does get deleted rather easily
On the other hand, could I trouble you for a quick review of #12405? It's just a constructor from libawt that I happened to overlook in my previous Pull Request on initialization orders. Sorry for the trouble!
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.
Thanks for the review! Are the other changes here ok with you in the meantime?
// cl -I %OPENJDK%\src\java.security.jgss\share\native\libj2gss\ sspi.cpp \ | ||
// cl -I %OPENJDK%\src\java.security.jgss\share\native\libj2gss\ sspi.cpp | ||
// -link -dll -out:sspi_bridge.dll |
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.
I don't know what the error message you get, but ^
definitely works for me as continuation line marker in cmd.exe
.
C:\dev\jdk-dev>cl -I %OPENJDK%\src\java.security.jgss\share\native\libj2gss\ sspi.cpp ^
More? -link -dll -out:sspi_bridge.dll
'cl' is not recognized as an internal or external command,
operable program or batch file.
This More?
prompt identifies the continuation line.
Anyway, we decided to leave it as is but convert to multi-line comment, which is fine with me.
/integrate |
Going to push as commit 70f3150.
Your commit was automatically rebased without conflicts. |
@TheShermanTanker Pushed as commit 70f3150. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Several comments are technically broken in Windows code, this change cleans up the broken comments that managed to slip past reviewers during Integration
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12305/head:pull/12305
$ git checkout pull/12305
Update a local copy of the PR:
$ git checkout pull/12305
$ git pull https://git.openjdk.org/jdk pull/12305/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12305
View PR using the GUI difftool:
$ git pr show -t 12305
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12305.diff