Skip to content

Commit

Permalink
Checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
jodastephen committed Feb 22, 2012
1 parent aa13a78 commit 0993b37
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 34 deletions.
10 changes: 5 additions & 5 deletions src/main/java/org/joda/time/DateTimeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,12 @@ public static final boolean isContiguous(ReadablePartial partial) {
* @since 2.0
*/
public static final DateFormatSymbols getDateFormatSymbols(Locale locale) {
try {
Method method = DateFormatSymbols.class.getMethod("getInstance", new Class[] {Locale.class});
return (DateFormatSymbols) method.invoke(null, new Object[] {locale});
try {
Method method = DateFormatSymbols.class.getMethod("getInstance", new Class[] {Locale.class});
return (DateFormatSymbols) method.invoke(null, new Object[] {locale});
} catch (Exception ex) {
return new DateFormatSymbols(locale);
}
return new DateFormatSymbols(locale);
}
}

//-----------------------------------------------------------------------
Expand Down
40 changes: 20 additions & 20 deletions src/main/java/org/joda/time/base/BasePeriod.java
Original file line number Diff line number Diff line change
Expand Up @@ -546,12 +546,12 @@ protected void mergePeriod(ReadablePeriod period) {
* @throws IllegalArgumentException if an unsupported field's value is non-zero
*/
protected int[] mergePeriodInto(int[] values, ReadablePeriod period) {
for (int i = 0, isize = period.size(); i < isize; i++) {
DurationFieldType type = period.getFieldType(i);
int value = period.getValue(i);
checkAndUpdate(type, values, value);
}
return values;
for (int i = 0, isize = period.size(); i < isize; i++) {
DurationFieldType type = period.getFieldType(i);
int value = period.getValue(i);
checkAndUpdate(type, values, value);
}
return values;
}

/**
Expand All @@ -575,20 +575,20 @@ protected void addPeriod(ReadablePeriod period) {
* @throws IllegalArgumentException if an unsupported field's value is non-zero
*/
protected int[] addPeriodInto(int[] values, ReadablePeriod period) {
for (int i = 0, isize = period.size(); i < isize; i++) {
DurationFieldType type = period.getFieldType(i);
int value = period.getValue(i);
if (value != 0) {
int index = indexOf(type);
if (index == -1) {
throw new IllegalArgumentException(
"Period does not support field '" + type.getName() + "'");
} else {
values[index] = FieldUtils.safeAdd(getValue(index), value);
}
}
}
return values;
for (int i = 0, isize = period.size(); i < isize; i++) {
DurationFieldType type = period.getFieldType(i);
int value = period.getValue(i);
if (value != 0) {
int index = indexOf(type);
if (index == -1) {
throw new IllegalArgumentException(
"Period does not support field '" + type.getName() + "'");
} else {
values[index] = FieldUtils.safeAdd(getValue(index), value);
}
}
}
return values;
}

//-----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2542,9 +2542,9 @@ public int parseInto(DateTimeParserBucket bucket, String text, int position) {
String best = null;
for (String id : ALL_IDS) {
if (str.startsWith(id)) {
if (best == null || id.length() > best.length()) {
best = id;
}
if (best == null || id.length() > best.length()) {
best = id;
}
}
}
if (best != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/joda/time/tz/FixedDateTimeZone.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public boolean equals(Object obj) {
return true;
}
if (obj instanceof FixedDateTimeZone) {
FixedDateTimeZone other = (FixedDateTimeZone)obj;
FixedDateTimeZone other = (FixedDateTimeZone) obj;
return
getID().equals(other.getID()) &&
iStandardOffset == other.iStandardOffset &&
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/joda/time/tz/ZoneInfoProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,16 @@ private DateTimeZone loadZoneData(String id) {
DateTimeZone tz = DateTimeZoneBuilder.readFrom(in, id);
iZoneInfoMap.put(id, new SoftReference<DateTimeZone>(tz));
return tz;
} catch (IOException e) {
uncaughtException(e);
} catch (IOException ex) {
uncaughtException(ex);
iZoneInfoMap.remove(id);
return null;
} finally {
try {
if (in != null) {
in.close();
}
} catch (IOException e) {
} catch (IOException ex) {
}
}
}
Expand All @@ -256,7 +256,7 @@ private static Map<String, Object> loadZoneInfoMap(InputStream in) throws IOExce
} finally {
try {
din.close();
} catch (IOException e) {
} catch (IOException ex) {
}
}
map.put("UTC", new SoftReference<DateTimeZone>(DateTimeZone.UTC));
Expand All @@ -282,7 +282,7 @@ private static void readZoneInfoMap(DataInputStream din, Map<String, Object> zim
for (int i=0; i<size; i++) {
try {
zimap.put(pool[din.readUnsignedShort()], pool[din.readUnsignedShort()]);
} catch (ArrayIndexOutOfBoundsException e) {
} catch (ArrayIndexOutOfBoundsException ex) {
throw new IOException("Corrupt zone info map");
}
}
Expand Down

0 comments on commit 0993b37

Please sign in to comment.