From deba1c4d146ef81b3fbf6e9ba7083428a3c48d65 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Sat, 26 Oct 2013 21:07:10 +0200 Subject: [PATCH] @NotNull annotations for *DateFormat --- java/jdkAnnotations/java/text/annotations.xml | 60 ++++++++++++++++++- .../intellij/util/text/SyncDateFormat.java | 12 ++-- 2 files changed, 64 insertions(+), 8 deletions(-) diff --git a/java/jdkAnnotations/java/text/annotations.xml b/java/jdkAnnotations/java/text/annotations.xml index c1514c8cfd02..96eb67c3add7 100644 --- a/java/jdkAnnotations/java/text/annotations.xml +++ b/java/jdkAnnotations/java/text/annotations.xml @@ -1,5 +1,20 @@ + + + + + + + + + + + + + + + @@ -32,12 +47,51 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/platform/util/src/com/intellij/util/text/SyncDateFormat.java b/platform/util/src/com/intellij/util/text/SyncDateFormat.java index 55aece746e34..48cc2510fd51 100644 --- a/platform/util/src/com/intellij/util/text/SyncDateFormat.java +++ b/platform/util/src/com/intellij/util/text/SyncDateFormat.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ package com.intellij.util.text; +import org.jetbrains.annotations.NotNull; + import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -28,15 +30,15 @@ import java.util.TimeZone; public class SyncDateFormat { private final DateFormat myDelegate; - public SyncDateFormat(DateFormat delegate) { + public SyncDateFormat(@NotNull DateFormat delegate) { myDelegate = delegate; } - public synchronized Date parse(String s) throws ParseException { + public synchronized Date parse(@NotNull String s) throws ParseException { return myDelegate.parse(s); } - public synchronized String format(Date date) { + public synchronized String format(@NotNull Date date) { return myDelegate.format(date); } @@ -44,7 +46,7 @@ public class SyncDateFormat { return myDelegate.format(time); } - public synchronized void setTimeZone(final TimeZone timeZone) { + public synchronized void setTimeZone(@NotNull final TimeZone timeZone) { myDelegate.setTimeZone(timeZone); }