Skip to content

Instantly share code, notes, and snippets.

View jodastephen's full-sized avatar

Stephen Colebourne jodastephen

View GitHub Profile
@jodastephen
jodastephen / ThreeTen328
Created September 13, 2013 12:05
Patch for #328
# HG changeset patch
# User scolebourne
# Date 1379073847 -3600
# Node ID 46b86421753a3c3c71167d327a2012e50e45bd94
# Parent 0d78450f712812a6fef52db03e6143cb274494ba
Change until() to accept any compatible temporal
Method until(Temporal,TemporalUnit) now uses from() to convert
Update Javadoc spec
Enhance from() methods where necessary
@jodastephen
jodastephen / ThreeTen#331
Created August 30, 2013 16:59
Patch to implement ChronoPeriod
# HG changeset patch
# User scolebourne
# Date 1377881894 -3600
# Node ID 774445b243ad6e5f9cf2b6a65af0e5ae90ac4f6b
# Parent 66f2d8a694e598397e077a683d773692e7a4fb49
Add ChronoPeriod
Make Period ISO-only, adding a Chronology-specific period concept
Fixes #331, JBS 8023762
@jodastephen
jodastephen / SetAggregatedMojo
Created August 1, 2013 17:18
SetAggregatedMojo added to versions-maven-plugin
package org.codehaus.mojo.versions;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@jodastephen
jodastephen / ThreeTen321
Created July 9, 2013 20:37
Change Chronology to an interface
# HG changeset patch
# User scolebourne
# Date 1373402104 -3600
# Node ID 31e46fdf3f133e075f7084d522ad47e9e3f0a061
# Parent ae87386e002940843fa82efcfc2bf65995ad5c92
Change Chronology to an interface
See #321
diff --git a/src/share/classes/java/time/chrono/AbstractChronology.java b/src/share/classes/java/time/chrono/AbstractChronology.java
new file mode 100644
@jodastephen
jodastephen / ThreeTen315
Created July 1, 2013 14:48
Patch for #315
# HG changeset patch
# User scolebourne
# Date 1372689842 -3600
# Node ID 81d32359e09023be1f642f27181b38137295e457
# Parent e92ef0ad0c59d9e66bde0611640e3eaf96769d3b
Add Temporal.isSupported(TemporalUnit)
See #315
diff --git a/src/share/classes/java/time/Instant.java b/src/share/classes/java/time/Instant.java
--- a/src/share/classes/java/time/Instant.java
@jodastephen
jodastephen / ThreeTenJapaneseTests
Created June 24, 2013 11:20
More tests for Japanese
# HG changeset patch
# User scolebourne
# Date 1372072772 -3600
# Node ID 03444bbacab9f76b1492e21dcb27b94b00f458b1
# Parent fbac779a293ec66a1f141d22b7a10e9078677c07
Enhance Japanese calendar system tests
See #299
diff --git a/test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java b/test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java
--- a/test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java
@jodastephen
jodastephen / ThreeTen318
Created June 24, 2013 09:29
ThreeTen318
# HG changeset patch
# User scolebourne
# Date 1371832843 -3600
# Node ID f7573f51e6f97ad8f3610797215c45a37ced541c
# Parent ab19cc860f048b2cc5f67b63c506860bc981fe1b
Additional tests and fixes for strict/smart/lenient resolving
Issue #318
diff --git a/src/share/classes/java/time/chrono/Chronology.java b/src/share/classes/java/time/chrono/Chronology.java
--- a/src/share/classes/java/time/chrono/Chronology.java
@jodastephen
jodastephen / ThreeTenTimeResolve
Created April 15, 2013 23:06
Resolving of time
diff -r 835edcf9578a src/share/classes/java/time/format/Parsed.java
--- a/src/share/classes/java/time/format/Parsed.java Mon Apr 15 20:58:15 2013 +0100
+++ b/src/share/classes/java/time/format/Parsed.java Tue Apr 16 00:05:20 2013 +0100
@@ -308,17 +308,24 @@
private void resolveTimeFields() {
// simplify fields
if (fieldValues.containsKey(CLOCK_HOUR_OF_DAY)) {
- long ch = fieldValues.remove(CLOCK_HOUR_OF_DAY);
+ long ch = CLOCK_HOUR_OF_DAY.checkValidValue(fieldValues.remove(CLOCK_HOUR_OF_DAY));
updateCheckConflict(CLOCK_HOUR_OF_DAY, HOUR_OF_DAY, ch == 24 ? 0 : ch);
@jodastephen
jodastephen / ThreeTen292
Created April 3, 2013 16:31
Patch for ChronoLocalDate no generics
diff --git a/src/share/classes/java/time/LocalDate.java b/src/share/classes/java/time/LocalDate.java
--- a/src/share/classes/java/time/LocalDate.java
+++ b/src/share/classes/java/time/LocalDate.java
@@ -127,7 +127,7 @@
* @since 1.8
*/
public final class LocalDate
- implements Temporal, TemporalAdjuster, ChronoLocalDate<LocalDate>, Serializable {
+ implements Temporal, TemporalAdjuster, ChronoLocalDate, Serializable {
@jodastephen
jodastephen / FixEras
Created March 10, 2013 22:29
APPLIED: Patch to fix eras in ThreeTen
# HG changeset patch
# User scolebourne
# Date 1362954526 0
# Node ID 248111f161af57d7844891b96ef0ed1f9e588146
# Parent 02b563dff2307edafa5a0b49c5b3ff55e3f8a1de
Enhance and fix eras
Fix range of Japanese and Hijrah, with tests
Unify Javadoc styles
Add Javadoc tables for year-of-era where appropriate