diff options
author | Kevin Sawicki | 2011-05-09 00:29:12 +0000 |
---|---|---|
committer | Kevin Sawicki | 2011-05-09 00:29:12 +0000 |
commit | e33c18496108f47a746e38fc15080d87160e6d2a (patch) | |
tree | 245477953c2ce0877791b91a513b2f95b3b5b35b /org.eclipse.mylyn.github.core/src | |
parent | 5304013c52035e09910f19db44372f1add48ae4d (diff) | |
download | egit-github-e33c18496108f47a746e38fc15080d87160e6d2a.tar.gz egit-github-e33c18496108f47a746e38fc15080d87160e6d2a.tar.xz egit-github-e33c18496108f47a746e38fc15080d87160e6d2a.zip |
Prevent null pointer exceptions on date getter methods.
Change-Id: I6d3843531c0b7fef6c52a5a484c07440ae224c93
Signed-off-by: Kevin Sawicki <kevin@github.com>
Diffstat (limited to 'org.eclipse.mylyn.github.core/src')
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 7743443a..a1c1bfe5 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 1d9e2b87..41e81fec 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 80640f26..0c92c9a2 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 5024f4e9..adedd2d4 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; } /** |