Skip to content

Commit

Permalink
Merge pull request #34 from StefanSpieker/minor_stuff
Browse files Browse the repository at this point in the history
Refactoring: Use diamond operator and removed unnecessary semicolon and import
  • Loading branch information
froque authored Dec 26, 2022
2 parents 332220c + f082970 commit 58f5cd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import hudson.PluginWrapper;
import hudson.model.Item;
import hudson.model.Job;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

Expand All @@ -16,7 +15,7 @@
public class JobsPerPlugin {

private PluginWrapper plugin;
private Map<String, Item> jobMap = new HashMap<String, Item>();
private Map<String, Item> jobMap = new HashMap<>();


public JobsPerPlugin(PluginWrapper plugin) {
Expand All @@ -29,8 +28,7 @@ public void addProject(Item project) {

@Exported
public List<Item> getProjects() {
ArrayList<Item> projects = new ArrayList<Item>();
projects.addAll(jobMap.values());
ArrayList<Item> projects = new ArrayList<>(jobMap.values());
projects.sort(Comparator.comparing(Item::getName));
return projects;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public Void installPluginUsage() {

try (
OutputStream output = connection.getOutputStream();
PrintWriter writer = new PrintWriter(new OutputStreamWriter(output, charset), true);
PrintWriter writer = new PrintWriter(new OutputStreamWriter(output, charset), true)
) {
// Send binary file.
writer.append("--").append(boundary).append(CRLF);
Expand Down

0 comments on commit 58f5cd2

Please sign in to comment.