Skip to content

Commit

Permalink
[JENKINS-9367] revisting the fix --- changing the access modifier is …
Browse files Browse the repository at this point in the history
…an incompatible change.
  • Loading branch information
kohsuke committed Apr 18, 2011
1 parent 16580b5 commit bd1f2aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/hudson/model/ListView.java
Expand Up @@ -91,8 +91,7 @@ public ListView(String name, ViewGroup owner) {
this.owner = owner;
}

protected Object readResolve() {
super.readResolve();
private Object readResolve() {
if(includeRegex!=null)
includePattern = Pattern.compile(includeRegex);
initColumns();
Expand Down
26 changes: 15 additions & 11 deletions core/src/main/java/hudson/model/View.java
Expand Up @@ -129,15 +129,6 @@ protected View(String name, ViewGroup owner) {
this.owner = owner;
}

protected Object readResolve() {
if (properties == null) {
properties = new PropertyList(this);
} else {
properties.setOwner(this);
}
return this;
}

/**
* Gets all the items in this collection in a read-only view.
*/
Expand Down Expand Up @@ -206,6 +197,19 @@ public String getDescription() {
* @since 1.406
*/
public DescribableList<ViewProperty,ViewPropertyDescriptor> getProperties() {
// readResolve was the best place to do this, but for compatibility reasons,
// this class can no longer have readResolve() (the mechanism itself isn't suitable for class hierarchy)
// see JENKINS-9431
//
// until we have that, putting this logic here.
synchronized (this) {
if (properties == null) {
properties = new PropertyList(this);
} else {
properties.setOwner(this);
}
}

return properties;
}

Expand Down Expand Up @@ -236,7 +240,7 @@ public void save() throws IOException {
*/
@Exported(name="property",inline=true)
public List<ViewProperty> getAllProperties() {
return properties.toList();
return getProperties().toList();
}

public ViewDescriptor getDescriptor() {
Expand Down Expand Up @@ -637,7 +641,7 @@ public final synchronized void doConfigSubmit( StaplerRequest req, StaplerRespon

JSONObject json = req.getSubmittedForm();

properties.rebuild(req, req.getSubmittedForm(), getApplicablePropertyDescriptors());
getProperties().rebuild(req, req.getSubmittedForm(), getApplicablePropertyDescriptors());

save();

Expand Down

0 comments on commit bd1f2aa

Please sign in to comment.