From 82eb7a6d87a66cf816bd2b5f0d74fe790e93aece Mon Sep 17 00:00:00 2001 From: weijun Date: Mon, 6 Dec 2010 10:48:57 +0800 Subject: [PATCH] 6992964: FindBugs warnings in com.sun.security.auth.module.UnixSystem.java Reviewed-by: mullan --- .../classes/com/sun/security/auth/module/NTSystem.java | 6 ++---- .../com/sun/security/auth/module/SolarisSystem.java | 7 ++----- .../classes/com/sun/security/auth/module/UnixSystem.java | 7 ++----- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/share/classes/com/sun/security/auth/module/NTSystem.java b/src/share/classes/com/sun/security/auth/module/NTSystem.java index 82cdd8531..5ed6c357d 100644 --- a/src/share/classes/com/sun/security/auth/module/NTSystem.java +++ b/src/share/classes/com/sun/security/auth/module/NTSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ package com.sun.security.auth.module; -import javax.security.auth.login.LoginException; - /** *

This class implementation retrieves and makes available NT * security information for the current user. @@ -124,7 +122,7 @@ public class NTSystem { * @return the group SIDs for the current NT user. */ public String[] getGroupIDs() { - return groupIDs; + return groupIDs == null ? null : groupIDs.clone(); } /** diff --git a/src/share/classes/com/sun/security/auth/module/SolarisSystem.java b/src/share/classes/com/sun/security/auth/module/SolarisSystem.java index 028b80a13..622671bd3 100644 --- a/src/share/classes/com/sun/security/auth/module/SolarisSystem.java +++ b/src/share/classes/com/sun/security/auth/module/SolarisSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,6 @@ package com.sun.security.auth.module; -import javax.security.auth.*; -import javax.security.auth.login.*; - /** *

This class implementation retrieves and makes available Solaris * UID/GID/groups information for the current user. @@ -92,6 +89,6 @@ public class SolarisSystem { * @return the supplementary groups for the current Solaris user. */ public long[] getGroups() { - return groups; + return groups == null ? null : groups.clone(); } } diff --git a/src/share/classes/com/sun/security/auth/module/UnixSystem.java b/src/share/classes/com/sun/security/auth/module/UnixSystem.java index d000cc800..b902cc9e3 100644 --- a/src/share/classes/com/sun/security/auth/module/UnixSystem.java +++ b/src/share/classes/com/sun/security/auth/module/UnixSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,6 @@ package com.sun.security.auth.module; -import javax.security.auth.*; -import javax.security.auth.login.*; - /** *

This class implementation retrieves and makes available Unix * UID/GID/groups information for the current user. @@ -92,6 +89,6 @@ public class UnixSystem { * @return the supplementary groups for the current Unix user. */ public long[] getGroups() { - return groups; + return groups == null ? null : groups.clone(); } } -- GitLab