You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2016/05/19 09:35:03 UTC
[03/50] lucene-solr:jira/solr-9045: LUCENE-7278: DRPT: fix bug in
assert statement
LUCENE-7278: DRPT: fix bug in assert statement
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/1d35bd0e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1d35bd0e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1d35bd0e
Branch: refs/heads/jira/solr-9045
Commit: 1d35bd0ea8beb635997c3cf131ded8ebe58d15a9
Parents: 06034c2
Author: David Smiley <ds...@apache.org>
Authored: Thu May 12 23:03:32 2016 -0400
Committer: David Smiley <ds...@apache.org>
Committed: Thu May 12 23:03:32 2016 -0400
----------------------------------------------------------------------
lucene/CHANGES.txt | 3 ++-
.../apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1d35bd0e/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 9578f7d..99b7bbf 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -23,7 +23,8 @@ New Features
queries with excluded bounds. (Adrien Grand)
* LUCENE-7278: Spatial-extras DateRangePrefixTree's Calendar is now configurable, to
- e.g. clear the Gregorian Change Date. (David Smiley)
+ e.g. clear the Gregorian Change Date. Also, toString(cal) is now identical to
+ DateTimeFormatter.ISO_INSTANT. (David Smiley)
API Changes
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1d35bd0e/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java
----------------------------------------------------------------------
diff --git a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java
index 9db3427..4d3ef3b 100644
--- a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java
+++ b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java
@@ -256,10 +256,10 @@ public class DateRangePrefixTree extends NumberRangePrefixTree {
int assertEra = -1;
assert (assertEra = (((Calendar)cal.clone()).get(Calendar.ERA))) >= 0;//a trick to only get this if assert enabled
//note: Calendar.ERA == 0;
- for (int f = field+1; f <= Calendar.MILLISECOND; f++) {
+ for (int f = field + 1; f <= Calendar.MILLISECOND; f++) {
cal.clear(f);
}
- assert ((Calendar)cal.clone()).get(Calendar.ERA) == assertEra : "Calendar underflow";
+ assert field + 1 == Calendar.ERA || ((Calendar)cal.clone()).get(Calendar.ERA) == assertEra : "Calendar underflow";
}
/** Converts {@code value} from a {@link Calendar} or {@link Date} to a {@link Shape}. Other arguments