From 3cd35cf8e4a2895f37d89307fa650601f7df536c Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 29 Oct 2009 00:24:42 +0000 Subject: [PATCH] bringing the pseudo immutability back. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23308 71c3de6d-444a-0410-be80-ed276b4c234a --- .../hudson/security/AuthorizationMatrixProperty.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/hudson/security/AuthorizationMatrixProperty.java b/core/src/main/java/hudson/security/AuthorizationMatrixProperty.java index 70aacd07d0..5b5b70bb4b 100644 --- a/core/src/main/java/hudson/security/AuthorizationMatrixProperty.java +++ b/core/src/main/java/hudson/security/AuthorizationMatrixProperty.java @@ -59,6 +59,9 @@ import javax.servlet.ServletException; /** * {@link JobProperty} to associate ACL for each project. + * + *

+ * Once created (and initialized), this object becomes immutable. */ public class AuthorizationMatrixProperty extends JobProperty> { @@ -70,10 +73,6 @@ public class AuthorizationMatrixProperty extends JobProperty> { return useProjectSecurity; } - protected void setUseProjectSecurity(boolean useProjectSecurity) { - this.useProjectSecurity = useProjectSecurity; - } - /** * List up all permissions that are granted. * @@ -126,7 +125,7 @@ public class AuthorizationMatrixProperty extends JobProperty> { formData = formData.getJSONObject("useProjectSecurity"); if(!formData.isNullObject()) { - amp.setUseProjectSecurity(true); + amp.useProjectSecurity = true; for (Map.Entry r : (Set>) formData.getJSONObject("data").entrySet()) { String sid = r.getKey(); if (r.getValue() instanceof JSONObject) { @@ -251,8 +250,7 @@ public class AuthorizationMatrixProperty extends JobProperty> { String prop = reader.peekNextChild(); if (prop!=null && prop.equals("useProjectSecurity")) { reader.moveDown(); - Boolean useSecurity = (Boolean) context.convertAnother(as, Boolean.class); - as.setUseProjectSecurity(useSecurity); + as.useProjectSecurity = (Boolean) context.convertAnother(as, Boolean.class); reader.moveUp(); } while (reader.hasMoreChildren()) { -- GitLab