New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jenkins 19082 #898
Closed
Closed
Jenkins 19082 #898
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* | ||
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, | ||
* Erik Ramfelt, Seiji Sogabe, Martin Eigenbrodt, Alan Harder | ||
* | ||
|
@@ -10,10 +10,10 @@ | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
|
@@ -69,7 +69,7 @@ public class ListView extends View implements Saveable { | |
*/ | ||
@GuardedBy("this") | ||
/*package*/ /*almost-final*/ SortedSet<String> jobNames = new TreeSet<String>(CaseInsensitiveComparator.INSTANCE); | ||
|
||
private DescribableList<ViewJobFilter, Descriptor<ViewJobFilter>> jobFilters; | ||
|
||
private DescribableList<ListViewColumn, Descriptor<ListViewColumn>> columns; | ||
|
@@ -78,12 +78,12 @@ public class ListView extends View implements Saveable { | |
* Include regex string. | ||
*/ | ||
private String includeRegex; | ||
|
||
/** | ||
* Whether to recurse in ItemGroups | ||
*/ | ||
private boolean recurse; | ||
|
||
/** | ||
* Compiled include pattern from the includeRegex string. | ||
*/ | ||
|
@@ -148,7 +148,7 @@ public DescribableList<ViewJobFilter, Descriptor<ViewJobFilter>> getJobFilters() | |
public DescribableList<ListViewColumn, Descriptor<ListViewColumn>> getColumns() { | ||
return columns; | ||
} | ||
|
||
/** | ||
* Returns a read-only view of all {@link Job}s in this view. | ||
* | ||
|
@@ -184,19 +184,19 @@ public List<TopLevelItem> getItems() { | |
} | ||
// for sanity, trim off duplicates | ||
items = new ArrayList<TopLevelItem>(new LinkedHashSet<TopLevelItem>(items)); | ||
|
||
return items; | ||
} | ||
|
||
@Override | ||
public boolean contains(TopLevelItem item) { | ||
return getItems().contains(item); | ||
} | ||
|
||
private void includeItems(ItemGroup<? extends TopLevelItem> parent, SortedSet<String> names) { | ||
includeItems(parent, parent, names); | ||
} | ||
|
||
private void includeItems(ItemGroup<? extends TopLevelItem> root, ItemGroup<?> parent, SortedSet<String> names) { | ||
if (includePattern != null) { | ||
for (Item item : parent.getItems()) { | ||
|
@@ -213,13 +213,13 @@ private void includeItems(ItemGroup<? extends TopLevelItem> root, ItemGroup<?> p | |
} | ||
} | ||
} | ||
|
||
public synchronized boolean jobNamesContains(TopLevelItem item) { | ||
if (item == null) return false; | ||
return jobNames.contains(item.getRelativeNameFrom(getOwnerItemGroup())); | ||
} | ||
|
||
|
||
|
||
/** | ||
* Adds the given item to this view. | ||
|
@@ -236,11 +236,11 @@ public void add(TopLevelItem item) throws IOException { | |
public String getIncludeRegex() { | ||
return includeRegex; | ||
} | ||
|
||
public boolean isRecurse() { | ||
return recurse; | ||
} | ||
|
||
/* | ||
* For testing purposes | ||
*/ | ||
|
@@ -329,13 +329,13 @@ protected void submit(StaplerRequest req) throws ServletException, FormException | |
} | ||
} | ||
|
||
setIncludeRegex(req.getParameter("useincluderegex")); | ||
setIncludeRegex(req.getParameter("useincluderegex"), req.getParameter("includeRegex")); | ||
|
||
if (columns == null) { | ||
columns = new DescribableList<ListViewColumn,Descriptor<ListViewColumn>>(this); | ||
} | ||
columns.rebuildHetero(req, json, ListViewColumn.all(), "columns"); | ||
|
||
if (jobFilters == null) { | ||
jobFilters = new DescribableList<ViewJobFilter,Descriptor<ViewJobFilter>>(this); | ||
} | ||
|
@@ -344,9 +344,9 @@ protected void submit(StaplerRequest req) throws ServletException, FormException | |
String filter = Util.fixEmpty(req.getParameter("statusFilter")); | ||
statusFilter = filter != null ? "1".equals(filter) : null; | ||
} | ||
public void setIncludeRegex(String includeRegex) { | ||
if (includeRegex != null) { | ||
|
||
public void setIncludeRegex(String useIncludeRegex, String includeRegex) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method is not meant to know it is called from a form submission, the signature change is unnecessary. |
||
if (useIncludeRegex != null) { | ||
this.includeRegex = Util.nullify(includeRegex); | ||
if (this.includeRegex == null) | ||
this.includePattern = null; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check for nullity of useincluderegex should be done here, no need to pass it to the method.