Skip to content

Commit

Permalink
Merge pull request #50 from pescuma/jackson
Browse files Browse the repository at this point in the history
Updates Jackson to 2.2.3
  • Loading branch information
kohsuke committed Oct 2, 2013
2 parents bbc78ff + 4712d2c commit d82af9f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 16 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.9</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kohsuke/github/GHEventInfo.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.kohsuke.github;

import org.codehaus.jackson.node.ObjectNode;

import java.io.IOException;
import java.util.Date;

import com.fasterxml.jackson.databind.node.ObjectNode;

/**
* Represents an event.
*
Expand Down
22 changes: 20 additions & 2 deletions src/main/java/org/kohsuke/github/GHIssue.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class GHIssue {
protected String closed_at;
protected int comments;
protected String body;
protected List<String> labels;
protected List<Label> labels;
protected GHUser user;
protected String title, created_at, html_url;
protected GHIssue.PullRequest pull_request;
Expand All @@ -58,6 +58,24 @@ public class GHIssue {
protected int id;
protected GHUser closed_by;

public static class Label {
private String url;
private String name;
private String color;

public String getUrl() {
return url;
}

public String getName() {
return name;
}

public String getColor() {
return color;
}
}

/*package*/ GHIssue wrap(GHRepository owner) {
this.owner = owner;
this.root = owner.root;
Expand Down Expand Up @@ -111,7 +129,7 @@ public GHIssueState getState() {
return Enum.valueOf(GHIssueState.class, state.toUpperCase(Locale.ENGLISH));
}

public Collection<String> getLabels() {
public Collection<Label> getLabels() {
if(labels == null){
return Collections.EMPTY_LIST;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kohsuke/github/GHPullRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public Date getMergedAt() {
}

@Override
public Collection<String> getLabels() {
public Collection<Label> getLabels() {
return super.getLabels();
}

Expand Down
17 changes: 9 additions & 8 deletions src/main/java/org/kohsuke/github/GitHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@
*/
package org.kohsuke.github;

import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import org.codehaus.jackson.map.DeserializationConfig.Feature;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.introspect.VisibilityChecker.Std;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.*;

import java.io.File;
import java.io.FileInputStream;
Expand All @@ -47,7 +42,13 @@
import java.util.Properties;
import java.util.TimeZone;

import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.*;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.introspect.VisibilityChecker.Std;
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;

/**
* Root of the GitHub API.
Expand Down Expand Up @@ -397,7 +398,7 @@ public boolean isCredentialValid() throws IOException {

static {
MAPPER.setVisibilityChecker(new Std(NONE, NONE, NONE, NONE, ANY));
MAPPER.getDeserializationConfig().set(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}

private static final String GITHUB_URL = "https://api.github.com";
Expand Down

0 comments on commit d82af9f

Please sign in to comment.