Hmm..., try it:
git co 4bc3477fbf9be688c14bbb07f5982d5f4b615591
git apply LUCENE-7277-20160518.patch
results in errors for me:
error: patch failed: lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java:421
error: lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java: patch does not apply
error: patch failed: lucene/core/src/java/org/apache/lucene/search/MatchNoDocsQuery.java:25
error: lucene/core/src/java/org/apache/lucene/search/MatchNoDocsQuery.java: patch does not apply
error: patch failed: lucene/core/src/java/org/apache/lucene/search/PointInSetQuery.java:315
error: lucene/core/src/java/org/apache/lucene/search/PointInSetQuery.java: patch does not apply
error: patch failed: lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java:230
error: lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java: patch does not apply
error: patch failed: lucene/core/src/java/org/apache/lucene/search/Query.java:74
error: lucene/core/src/java/org/apache/lucene/search/Query.java: patch does not apply
error: patch failed: lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java:153
error: lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java: patch does not apply
error: patch failed: lucene/core/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java:102
error: lucene/core/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java: patch does not apply
error: patch failed: lucene/join/src/java/org/apache/lucene/search/join/PointInSetIncludingScoreQuery.java:299
error: lucene/join/src/java/org/apache/lucene/search/join/PointInSetIncludingScoreQuery.java: patch does not apply
error: patch failed: lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java:475
error: lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java: patch does not apply
error: patch failed: lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/ComplexPhraseQueryParser.java:420
error: lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/ComplexPhraseQueryParser.java: patch does not apply
error: patch failed: lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java:67
error: lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java: patch does not apply
error: patch failed: solr/core/src/java/org/apache/solr/search/QueryWrapperFilter.java:89
error: solr/core/src/java/org/apache/solr/search/QueryWrapperFilter.java: patch does not apply
In case replacing getClass().hashCode() by something like getClass().getName().hashCode() is preferred for easier testing, it would probably be better to add that in a companion method to sameClassAs(), for example classHash().
Yep, I agree. Could even be lazily initialized once, much like the hash in Boolean query.
As to AssertionError or UOE, do we have a standard for that? I have seen UOE in a few places, so I used that.
I don't think there's a standard for such things – IllegalStateException, UOE, RuntimeException, InternalError... all these are used to signal unreachable code (or code that "theoretically" shouldn't execute). Not anything specific to Lucene, the inconsistency is everywhere, in the JDK too. I prefer new AssertionError("Reason") because this is an error (not an exception) and it cannot be confused with legitimate exceptions thrown by the java linker (unlike UOE)... but it's really my personal call, not a rule
I would not mind rebasing the local branch to update the patch, but I'll have very little time the coming days.
I can take over if you make that branch available somewhere (github?).