提交 3cd35cf8 编写于 作者: K kohsuke

bringing the pseudo immutability back.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23308 71c3de6d-444a-0410-be80-ed276b4c234a
上级 fdba356f
...@@ -59,6 +59,9 @@ import javax.servlet.ServletException; ...@@ -59,6 +59,9 @@ import javax.servlet.ServletException;
/** /**
* {@link JobProperty} to associate ACL for each project. * {@link JobProperty} to associate ACL for each project.
*
* <p>
* Once created (and initialized), this object becomes immutable.
*/ */
public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> { public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> {
...@@ -70,10 +73,6 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> { ...@@ -70,10 +73,6 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> {
return useProjectSecurity; return useProjectSecurity;
} }
protected void setUseProjectSecurity(boolean useProjectSecurity) {
this.useProjectSecurity = useProjectSecurity;
}
/** /**
* List up all permissions that are granted. * List up all permissions that are granted.
* *
...@@ -126,7 +125,7 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> { ...@@ -126,7 +125,7 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> {
formData = formData.getJSONObject("useProjectSecurity"); formData = formData.getJSONObject("useProjectSecurity");
if(!formData.isNullObject()) { if(!formData.isNullObject()) {
amp.setUseProjectSecurity(true); amp.useProjectSecurity = true;
for (Map.Entry<String, Object> r : (Set<Map.Entry<String, Object>>) formData.getJSONObject("data").entrySet()) { for (Map.Entry<String, Object> r : (Set<Map.Entry<String, Object>>) formData.getJSONObject("data").entrySet()) {
String sid = r.getKey(); String sid = r.getKey();
if (r.getValue() instanceof JSONObject) { if (r.getValue() instanceof JSONObject) {
...@@ -251,8 +250,7 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> { ...@@ -251,8 +250,7 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> {
String prop = reader.peekNextChild(); String prop = reader.peekNextChild();
if (prop!=null && prop.equals("useProjectSecurity")) { if (prop!=null && prop.equals("useProjectSecurity")) {
reader.moveDown(); reader.moveDown();
Boolean useSecurity = (Boolean) context.convertAnother(as, Boolean.class); as.useProjectSecurity = (Boolean) context.convertAnother(as, Boolean.class);
as.setUseProjectSecurity(useSecurity);
reader.moveUp(); reader.moveUp();
} }
while (reader.hasMoreChildren()) { while (reader.hasMoreChildren()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册