[
https://issues.apache.org/jira/browse/JCR-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487515
]
Marcel Reutegger commented on JCR-804:
--------------------------------------
Hi Ate,
What kind of java compiler are you using? My Sun javac (1.4.2_12) does not show
this error.
I think the relevant section in the JLS is the following:
http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#253028
In our case C is an inner member class. Furthermore we are using an unqualified
class instance creation expression and then it's the second sub case:
"Otherwise, if C is a member of an enclosing class then let O be the innermost
lexically enclosing class of which C is a member, and let n be an integer such
that O is the nth lexically enclosing class of the class in which the class
instance creation expression appears. The immediately enclosing instance of i
is the nth lexically enclosing instance of this."
If C is the RangeQueryScorer class then O is the RangeQuery class. The
enclosing classes of the class in which the class instance creating expression
appears are:
0th: anonymous ScorerFactory class
1st: RangeQueryWeight
2nd: RangeQuery
Therefore n is 2 (because O is the RangeQuery class) and the immediately
enclosing instance of i (i is the instance being created) is RangeQuery.this.
According to the JLS a qualified class instance creation expression is not
necessary here. Thus, both should work:
return new RangeQueryScorer(searcher.getSimilarity(), reader);
as well as:
return RangeQuery.this.new RangeQueryScorer(searcher.getSimilarity(), reader);
> Avoid using MultiTermDocs
> -------------------------
>
> Key: JCR-804
> URL: https://issues.apache.org/jira/browse/JCR-804
> Project: Jackrabbit
> Issue Type: Improvement
> Components: query
> Reporter: Marcel Reutegger
> Priority: Minor
> Fix For: 1.3
>
>
> Similar to MatchAllQuery also RangeQuery and WildcardQuery will result in use
> of MultiTermDocs. Those queries should also use the MultiScorer. See also
> issue JCR-791.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.