aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-02-20 22:30:43 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2012-02-20 22:30:43 +0100
commit22dfc24e49896cfa4c77e11a0e60e67c21f6db33 (patch)
tree19ed694f064008333147a9edc37253229cd45f40 /sonar-plugin-api
parent726c17ed044d5e23a4ee1465a8a8c487ac1a9646 (diff)
downloadsonarqube-22dfc24e49896cfa4c77e11a0e60e67c21f6db33.tar.gz
sonarqube-22dfc24e49896cfa4c77e11a0e60e67c21f6db33.zip
Fix some quality flaws, particularly on newly inspected code
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java
index 9daa954e3b4..7bb29c0db98 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java
@@ -19,6 +19,9 @@
*/
package org.sonar.api.utils;
+import java.io.NotSerializableException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.text.DateFormat;
@@ -78,14 +81,13 @@ public final class DateUtils {
}
static class ThreadSafeDateFormat extends DateFormat {
- private static final long serialVersionUID = -8856468429474634301L;
private final String format;
ThreadSafeDateFormat(String format) {
this.format = format;
}
- private final transient ThreadLocal<Reference<DateFormat>> cache = new ThreadLocal<Reference<DateFormat>>() {
+ private final ThreadLocal<Reference<DateFormat>> cache = new ThreadLocal<Reference<DateFormat>>() {
public Reference<DateFormat> get() {
Reference<DateFormat> softRef = super.get();
if (softRef == null || softRef.get() == null) {
@@ -107,5 +109,13 @@ public final class DateUtils {
public Date parse(String source, ParsePosition pos) {
return getDateFormat().parse(source, pos);
}
+
+ private void readObject(ObjectInputStream ois) throws NotSerializableException {
+ throw new NotSerializableException();
+ }
+
+ private void writeObject(ObjectOutputStream ois) throws NotSerializableException {
+ throw new NotSerializableException();
+ }
}
}