Skip to content

Commit

Permalink
Merge branch 'AdrianAcala-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jodastephen committed Jan 1, 2016
2 parents f415294 + 83c7de5 commit aaf4396
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 21 deletions.
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
</developer>
</developers>
<contributors>
<contributor>
<name>Adrian Acala</name>
<url>https://github.com/AdrianAcala</url>
</contributor>
<contributor>
<name>Guy Allard</name>
</contributor>
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/org/joda/time/chrono/IslamicChronology.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,10 @@ long setYear(long instant, int year) {
int dayOfYear = getDayOfYear(instant, thisYear);
int millisOfDay = getMillisOfDay(instant);

if (dayOfYear > 354) {
// Current year is leap, and day is leap.
if (!isLeapYear(year)) {
// Current year is leap, and day is leap.
if (dayOfYear > 354 && !isLeapYear(year)) {
// Moving to a non-leap year, leap day doesn't exist.
dayOfYear--;
}
}

instant = getYearMonthDayMillis(year, 1, dayOfYear);
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/org/joda/time/chrono/LimitChronology.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ public static LimitChronology getInstance(Chronology base,
lowerLimit = lowerLimit == null ? null : lowerLimit.toDateTime();
upperLimit = upperLimit == null ? null : upperLimit.toDateTime();

if (lowerLimit != null && upperLimit != null) {
if (!lowerLimit.isBefore(upperLimit)) {
throw new IllegalArgumentException
("The lower limit must be come before than the upper limit");
}
if (lowerLimit != null && upperLimit != null && !lowerLimit.isBefore(upperLimit)) {
throw new IllegalArgumentException
("The lower limit must be come before than the upper limit");
}

return new LimitChronology(base, (DateTime)lowerLimit, (DateTime)upperLimit);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/joda/time/convert/StringConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public long getDurationMillis(Object object) {
if (str.charAt(i) >= '0' && str.charAt(i) <= '9') {
// ok
} else if (i == 0 && str.charAt(0) == '-') {
// ok
negative = true;
// ok
negative = true;
} else if (i > (negative ? 1 : 0) && str.charAt(i) == '.' && dot == -1) {
// ok
dot = i;
Expand All @@ -136,7 +136,7 @@ public long getDurationMillis(Object object) {
}
millis = Integer.parseInt(str);
} else if (negative) {
seconds = Long.parseLong(str.substring(firstDigit, str.length()));
seconds = Long.parseLong(str.substring(firstDigit, str.length()));
} else {
seconds = Long.parseLong(str);
}
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,9 @@ public DateTimeZone toDateTimeZone(String id, boolean outputID) {
rs = new RuleSet(rs);

while ((next = rs.nextTransition(millis, saveMillis)) != null) {
if (addTransition(transitions, next)) {
if (tailZone != null) {
// Got the extra transition before DSTZone.
break;
}
if (addTransition(transitions, next) && tailZone != null) {
// Got the extra transition before DSTZone.
break;
}
millis = next.getMillis();
saveMillis = next.getSaveMillis();
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/org/joda/time/tz/ZoneInfoCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,8 @@ public Map<String, DateTimeZone> compile(File outputDir, File[] sources) throws
}

if (outputDir != null) {
if (!outputDir.exists()) {
if (!outputDir.mkdirs()) {
throw new IOException("Destination directory doesn't exist and cannot be created: " + outputDir);
}
if (!outputDir.exists() && !outputDir.mkdirs()) {
throw new IOException("Destination directory doesn't exist and cannot be created: " + outputDir);
}
if (!outputDir.isDirectory()) {
throw new IOException("Destination is not a directory: " + outputDir);
Expand Down

0 comments on commit aaf4396

Please sign in to comment.