[ 
https://issues.apache.org/jira/browse/SOLR-1688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794722#action_12794722
 ] 

Chris A. Mattmann commented on SOLR-1688:
-----------------------------------------

Hi Yonik:

It wasn't a huge deal for me regarding public or private for the 
FieldCacheSources. I had some weird Eclipse error that pointed out that 
StrFieldSource was a class defined inside of another java file (originally I 
thought it was an inner class, but later found out it wasn't) as part of 
SOLR-1586. That led me to looking at this issue, and like I said the troubling 
part isn't that it's an inner class, versus an outer class (although outer 
classes are certainly cleaner for anything that will be used outside of the 
package). The troubling part is that some of these classes, e.g., 
DoubleFieldSource, FloatFieldSource, are defined as outer, public classes in an 
entirely different package (o.a.solr.search.function), whereas some of them 
(e.g., StrFieldSource, SortableDoubleFieldSource) are defined as outer classes 
inside of their FieldType constituents. That's inconsistent.

Furthermore, the base class, FieldCacheSource, and ultimately its parent, 
ValueSource, are both intrinsically tied to the o.a.solr.search.function 
package, and are both public outer classes defined in their own java file(s). 
This is also inconsistent.

The patch I attached associates all FieldCacheSources in the 
o.a.solr.search.function package (where the rest of them are defined and where 
their parents are also defined) and IMO fixes up these inconsistencies.

Cheers,
Chris

> Inner class FieldCacheSources should be refactored into their own classes
> -------------------------------------------------------------------------
>
>                 Key: SOLR-1688
>                 URL: https://issues.apache.org/jira/browse/SOLR-1688
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>    Affects Versions: 1.4
>         Environment: indep. of env.
>            Reporter: Chris A. Mattmann
>             Fix For: 1.5
>
>         Attachments: SOLR-1688.Mattmann.122609.patch.txt
>
>
> While working on SOLR-1586 I noticed that outside of class level access (or 
> package level), you can't really reference FieldCacheSources that are defined 
> inside of their FieldType constituents (e.g., in the case of StrFieldSource 
> as defined in StrField). What's more troubling is that the 
> FieldType/FieldCacheSources are defined in an inconsistent fashion: some are 
> done as inner classes, e.g., StrFieldSource and SortableFloatFieldSource, 
> while others are defined as individual classes (e.g., FloatFIeldSource). This 
> patch will make them all consistent and define each FieldCacheSource as an 
> outside class, present in o.a.solr.search.function.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to