[
https://issues.apache.org/jira/browse/LUCENE-6719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14654570#comment-14654570
]
Hoss Man commented on LUCENE-6719:
----------------------------------
bq. I think it's OK to upgrade from int to Integer return value.
Hmmm ... depends on your definition of "OK" ... changing the return type
definitely breaks backcompat on the method sig.
{noformat}
hossman@tray:~/tmp$ cat Foo.java
public class Foo {
public static int foo() { return 42; }
// public static Integer foo() { return 42; }
}
hossman@tray:~/tmp$ cat Bar.java
public class Bar {
public static void main(String[] args) {
int i = Foo.foo();
System.out.println(i);
}
}
hossman@tray:~/tmp$ javac Foo.java
hossman@tray:~/tmp$ javac Bar.java
hossman@tray:~/tmp$ java Bar
42
hossman@tray:~/tmp$ echo "edit Foo"
edit Foo
hossman@tray:~/tmp$ cat Foo.java
public class Foo {
// public static int foo() { return 42; }
public static Integer foo() { return 42; }
}
hossman@tray:~/tmp$ javac Foo.java
hossman@tray:~/tmp$ java Bar
Exception in thread "main" java.lang.NoSuchMethodError: Foo.foo()I
at Bar.main(Bar.java:3)
{noformat}
> NumericUtils.getMinLong and NumericUtils.getMaxLong have undefined behavior
> when no docs have value - throw NPE
> ---------------------------------------------------------------------------------------------------------------
>
> Key: LUCENE-6719
> URL: https://issues.apache.org/jira/browse/LUCENE-6719
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Hoss Man
> Attachments: LUCENE-6719.patch, LUCENE-6719.patch
>
>
> Tracked down a possible cause of SOLR-7866 to situations where a (numeric)
> field doesn't have any values in an index and you try to get the min/max.
> javadocs for NumericUtils.getMinLong and NumericUtils.getMaxLong don't
> actually say what that method will do in this case, throw NPE when it happens
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]