Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[Fixed JENKINS-12307] Refactoring.
  • Loading branch information
uhafner committed May 30, 2012
1 parent ef880b8 commit f9ca3bb34e792769544a4599c8e52cd3b9f0b375
@@ -3,7 +3,6 @@
import hudson.Extension;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import hudson.plugins.warnings.parser.ParserDescription;
import hudson.plugins.warnings.parser.ParserRegistry;
import hudson.util.ListBoxModel;

@@ -76,17 +75,12 @@ public static class DescriptorImpl extends Descriptor<ConsoleParser> {
* @return the model of the list box
*/
public ListBoxModel doFillParserNameItems() {
ListBoxModel items = new ListBoxModel();
for (ParserDescription parser : ParserRegistry.getAvailableParsers()) {
items.add(parser.getGroup());
}
return items;
return ParserRegistry.getParsersAsListModel();
}

@Override
public String getDisplayName() {
return StringUtils.EMPTY;
}
}

}
@@ -5,7 +5,6 @@
import hudson.model.AbstractDescribableImpl;
import hudson.model.AbstractProject;
import hudson.model.Descriptor;
import hudson.plugins.warnings.parser.ParserDescription;
import hudson.plugins.warnings.parser.ParserRegistry;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
@@ -99,11 +98,7 @@ public static class DescriptorImpl extends Descriptor<ParserConfiguration> {
* @return the model of the list box
*/
public ListBoxModel doFillParserNameItems() {
ListBoxModel items = new ListBoxModel();
for (ParserDescription parser : ParserRegistry.getAvailableParsers()) {
items.add(parser.getGroup());
}
return items;
return ParserRegistry.getParsersAsListModel();
}

@Override
@@ -8,6 +8,7 @@
import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.warnings.WarningsDescriptor;
import hudson.plugins.warnings.GroovyParser;
import hudson.util.ListBoxModel;

import java.io.File;
import java.io.FileInputStream;
@@ -73,6 +74,19 @@ private static void addParsersWithDeprecatedApi(final Hudson instance, final Lis
}
}

/**
* Returns the available parsers as a list model.
*
* @return the model of the list box
*/
public static ListBoxModel getParsersAsListModel() {
ListBoxModel items = new ListBoxModel();
for (ParserDescription parser : getAvailableParsers()) {
items.add(parser.getGroup());
}
return items;
}

/**
* Returns all available parsers groups, sorted alphabetically.
*

0 comments on commit f9ca3bb

Please sign in to comment.