JDK 8 Warnings Cleanup Day -- Dec. 1st, 2011

Stuart Marks stuart.marks at oracle.com
Thu Dec 1 17:17:55 PST 2011


Hi Max,

It looks like you filed 7116857 to cover this already. Great.

On the ServicePermission.java change, it seems to me like it would be better to 
change the /*FALLTHROUGH*/ comment to a "break" and then remove 
@SuppressWarnings. Is there a reason we can't do this? It looks like the code 
would behave the same and we can get rid of the warning.

(Incidentally, this is the third time I've reviewed code today that looks 
exactly like this. The other cases are in java.io.FilePermission and 
java.util.PropertyPermission. They each have the /*FALLTHROUGH*/ into a set of 
cases that do nothing but break; and they have similar ("ackbarfaccept") 
comments. It would be nice if these chunks of code could be unified, but they 
differ in a number of fiddly details.)

(The string "ackbarfaccept" occurs in the following files:
1. java/io/FilePermission.java
2. java/net/SocketPermission.java
3. java/util/PropertyPermission.java
4. javax/management/MBeanPermission.java
5. javax/security/auth/kerberos/ServicePermission.java
Hmmm.)

Note that ChrisH has already done the BASE64Decoder.java change.

The other changes look fine.

s'marks

On 11/30/11 1:32 AM, Weijun Wang wrote:
> On 11/29/2011 10:10 AM, Xiomara Jayasena wrote:
>> 6. In order to streamlines the process, Stuart Marks will be consolidating
>> patches and running build and test jobs - thanks to Stuart for doing this!
>
> I cd into several security-related directories, call make clobber, and then
> call make. Only one warning in javax/security, others are inside sun/misc. The
> fix is trivial so I won't create a CR or a webrev.
>
> Thanks
> Max
>
>
> diff --git
> a/src/share/classes/javax/security/auth/kerberos/ServicePermission.java
> b/src/share/classes/javax/security/auth/kerberos/ServicePermission.java
> --- a/src/share/classes/javax/security/auth/kerberos/ServicePermission.java
> +++ b/src/share/classes/javax/security/auth/kerberos/ServicePermission.java
> @@ -301,7 +301,7 @@
> * @param action the action string
> * @return the action mask
> */
> -
> + @SuppressWarnings("fallthrough")
> private static int getMask(String action) {
>
> if (action == null) {
> diff --git a/src/share/classes/sun/misc/BASE64Decoder.java
> b/src/share/classes/sun/misc/BASE64Decoder.java
> --- a/src/share/classes/sun/misc/BASE64Decoder.java
> +++ b/src/share/classes/sun/misc/BASE64Decoder.java
> @@ -102,6 +102,7 @@
> /**
> * Decode one BASE64 atom into 1, 2, or 3 bytes of data.
> */
> + @SuppressWarnings({"fallthrough"})
> protected void decodeAtom(PushbackInputStream inStream, OutputStream outStream,
> int rem)
> throws java.io.IOException
> {
> diff --git a/src/share/classes/sun/misc/CEFormatException.java
> b/src/share/classes/sun/misc/CEFormatException.java
> --- a/src/share/classes/sun/misc/CEFormatException.java
> +++ b/src/share/classes/sun/misc/CEFormatException.java
> @@ -28,7 +28,9 @@
> import java.io.IOException;
>
> public class CEFormatException extends IOException {
> - public CEFormatException(String s) {
> - super(s);
> - }
> + static final long serialVersionUID = -7139121221067081482L;
> + public CEFormatException(String s) {
> + super(s);
> + }
> }
> +
> diff --git a/src/share/classes/sun/misc/CEStreamExhausted.java
> b/src/share/classes/sun/misc/CEStreamExhausted.java
> --- a/src/share/classes/sun/misc/CEStreamExhausted.java
> +++ b/src/share/classes/sun/misc/CEStreamExhausted.java
> @@ -27,4 +27,7 @@
> import java.io.IOException;
>
> /** This exception is thrown when EOF is reached */
> -public class CEStreamExhausted extends IOException { };
> +public class CEStreamExhausted extends IOException {
> + static final long serialVersionUID = -5889118049525891904L;
> +}
> +


More information about the jdk8-dev mailing list