-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8347840: Fix testlibrary compilation warnings #23143
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back lmesnik! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@lmesnik 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. |
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.
Overall looks good - sometimes a bit of a puzzler understanding what warning is being addressed. :)
Only one thing I'm concerned may be an issue. Also a couple of suggestions.
Thanks
@@ -107,7 +107,7 @@ public static ArrayDiff<?> of(Object first, Object second) { | |||
* @throws NullPointerException if at least one of the arrays is null | |||
* @return an ArrayDiff instance for the two arrays and formatting parameters provided | |||
*/ | |||
@SuppressWarnings("rawtypes") | |||
@SuppressWarnings({"rawtypes", "unchecked"}) |
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.
Just wondering where the unchecked warning arises in the code?
/** | ||
/* | ||
* | ||
* @author Bill Foote | ||
*/ |
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.
@@ -43,4 +43,5 @@ public interface ReadBuffer extends AutoCloseable { | |||
public short getShort(long pos) throws IOException; | |||
public int getInt(long pos) throws IOException; | |||
public long getLong(long pos) throws IOException; | |||
public void close() throws IOException; |
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.
Why was this redefined to throw IOException rather than just Exception?
if ((X) ex == ex) { | ||
throw (X) ex; | ||
} |
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.
This doesn't make sense to me.
@@ -93,7 +93,6 @@ public static Snapshot readFile(String heapFile, boolean callStack, | |||
return r.read(); | |||
} else if ((i >>> 8) == GZIP_HEADER_MAGIC) { | |||
// Possible gziped file, try decompress it and get the stack trace. | |||
in.close(); |
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.
It is not obvious to me that there may not be a reason for closing all of the streams before opening new ones below.
@@ -166,7 +165,6 @@ public static String getStack(String heapFile, int debugLevel) | |||
return r.printStackTraces(); | |||
} else if ((i >>> 8) == GZIP_HEADER_MAGIC) { | |||
// Possible gziped file, try decompress it and get the stack trace. | |||
in.close(); |
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.
It is not obvious to me that there may not be a reason for closing all of the streams before opening new ones below.
@@ -94,6 +94,7 @@ private static void callback() { | |||
* Runs the given task on a virtual thread pinned to its carrier. If called from a | |||
* virtual thread then it invokes the task directly. | |||
*/ | |||
@SuppressWarnings("unchecked") |
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.
If you change the code to the follow, same in VThreadRunner then it would avoid the the SW on the method and avoid the other change you have to VThreadRunner.
@SuppressWarnings("unchecked")
var x = (X) ex;
throw x;
There few compiler warning disabled in the testlibary build.
They should be fixed or localized and removed from build to prevent new possible issues.
The main goal is to avoid new such issues in the testlibrary.
Tested with tier1-5 to ensure that all tests were passed.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23143/head:pull/23143
$ git checkout pull/23143
Update a local copy of the PR:
$ git checkout pull/23143
$ git pull https://git.openjdk.org/jdk.git pull/23143/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23143
View PR using the GUI difftool:
$ git pr show -t 23143
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23143.diff
Using Webrev
Link to Webrev Comment