Skip to content

Commit

Permalink
FindBugs: Fix real issue with a method contract violation in ListView…
Browse files Browse the repository at this point in the history
…Column defaults retrieval
  • Loading branch information
oleg-nenashev committed Jul 15, 2016
1 parent 2ac529e commit 8c73550
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/main/java/hudson/views/ListViewColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.sf.json.JSONObject;

/**
* Extension point for adding a column to a table rendering of {@link Item}s, such as {@link ListView}.
Expand Down Expand Up @@ -125,14 +126,14 @@ public static List<ListViewColumn> createDefaultInitialColumnList() {
// OK, set up default list of columns:
// create all instances
ArrayList<ListViewColumn> r = new ArrayList<ListViewColumn>();

final JSONObject emptyJSON = new JSONObject();
for (Descriptor<ListViewColumn> d : ListViewColumn.all())
try {
if (d instanceof ListViewColumnDescriptor) {
ListViewColumnDescriptor ld = (ListViewColumnDescriptor) d;
if (!ld.shownByDefault()) continue; // skip this
}
ListViewColumn lvc = d.newInstance(null, null);
ListViewColumn lvc = d.newInstance(null, emptyJSON);
if (!lvc.shownByDefault()) continue; // skip this

r.add(lvc);
Expand Down

0 comments on commit 8c73550

Please sign in to comment.