summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-05-08 20:29:12 (EDT)
committerKevin Sawicki2011-05-08 20:29:12 (EDT)
commite33c18496108f47a746e38fc15080d87160e6d2a (patch)
tree245477953c2ce0877791b91a513b2f95b3b5b35b
parent5304013c52035e09910f19db44372f1add48ae4d (diff)
downloadegit-github-e33c18496108f47a746e38fc15080d87160e6d2a.zip
egit-github-e33c18496108f47a746e38fc15080d87160e6d2a.tar.gz
egit-github-e33c18496108f47a746e38fc15080d87160e6d2a.tar.bz2
Prevent null pointer exceptions on date getter methods.refs/changes/64/3364/2
Change-Id: I6d3843531c0b7fef6c52a5a484c07440ae224c93 Signed-off-by: Kevin Sawicki <kevin@github.com>
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java10
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistRevision.java5
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Issue.java14
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Milestone.java9
4 files changed, 14 insertions, 24 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java
index 7743443..a1c1bfe 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java
@@ -68,9 +68,8 @@ public class Gist {
* @return createdAt
*/
public Date getCreatedAt() {
- // see EI_EXPOSE_REP at
- // http://findbugs.sourceforge.net/bugDescriptions.html
- return new Date(this.createdAt.getTime());
+ return this.createdAt != null ? new Date(this.createdAt.getTime())
+ : null;
}
/**
@@ -160,9 +159,8 @@ public class Gist {
* @return updatedAt
*/
public Date getUpdatedAt() {
- // see EI_EXPOSE_REP at
- // http://findbugs.sourceforge.net/bugDescriptions.html
- return new Date(this.updatedAt.getTime());
+ return this.updatedAt != null ? new Date(this.updatedAt.getTime())
+ : null;
}
/**
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistRevision.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistRevision.java
index 1d9e2b8..41e81fe 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistRevision.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistRevision.java
@@ -31,9 +31,8 @@ public class GistRevision {
* @return committedAt
*/
public Date getCommittedAt() {
- // see EI_EXPOSE_REP at
- // http://findbugs.sourceforge.net/bugDescriptions.html
- return new Date(this.committedAt.getTime());
+ return this.committedAt != null ? new Date(this.committedAt.getTime())
+ : null;
}
/**
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Issue.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Issue.java
index 80640f2..0c92c9a 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Issue.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Issue.java
@@ -52,27 +52,23 @@ public class Issue {
* @return closedAt
*/
public Date getClosedAt() {
- // see EI_EXPOSE_REP at
- // http://findbugs.sourceforge.net/bugDescriptions.html
- return new Date(this.closedAt.getTime());
+ return this.closedAt != null ? new Date(this.closedAt.getTime()) : null;
}
/**
* @return createdAt
*/
public Date getCreatedAt() {
- // see EI_EXPOSE_REP at
- // http://findbugs.sourceforge.net/bugDescriptions.html
- return new Date(this.createdAt.getTime());
+ return this.createdAt != null ? new Date(this.createdAt.getTime())
+ : null;
}
/**
* @return updatedAt
*/
public Date getUpdatedAt() {
- // see EI_EXPOSE_REP at
- // http://findbugs.sourceforge.net/bugDescriptions.html
- return new Date(this.updatedAt.getTime());
+ return this.updatedAt != null ? new Date(this.updatedAt.getTime())
+ : null;
}
/**
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Milestone.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Milestone.java
index 5024f4e..adedd2d 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Milestone.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Milestone.java
@@ -43,18 +43,15 @@ public class Milestone {
* @return createdAt
*/
public Date getCreatedAt() {
- // see EI_EXPOSE_REP at
- // http://findbugs.sourceforge.net/bugDescriptions.html
- return new Date(this.createdAt.getTime());
+ return this.createdAt != null ? new Date(this.createdAt.getTime())
+ : null;
}
/**
* @return dueOn
*/
public Date getDueOn() {
- // see EI_EXPOSE_REP at
- // http://findbugs.sourceforge.net/bugDescriptions.html
- return new Date(this.dueOn.getTime());
+ return this.dueOn != null ? new Date(this.dueOn.getTime()) : null;
}
/**