[ 
https://issues.apache.org/jira/browse/LUCENE-7901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Smiley updated LUCENE-7901:
---------------------------------
    Attachment: LUCENE-7901.patch

Thanks [~gerlowskija]!

I enhanced it further to add null checks to the setters too.  
Objects.requireNonNull is fine even if you don't get the custom message, IMO.  
I did a bit more house-keeping of fixing some indentation and adjusting field 
order to match the constructor.  I moved package level FragmentQueue to an 
inner class here where it belongs; it's undesired to have multiple top level 
classes in one source file.

[~anshumg] Is it alright if I commit this to 7.0? It helps _avoid_ a more 
serious problem as referenced in the description (which further can be a 
potential DOS attack) but it itself is merely a minor improvement to error 
checking.

> original/default Highlighter's constructor should throw if passed null args
> ---------------------------------------------------------------------------
>
>                 Key: LUCENE-7901
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7901
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/highlighter
>            Reporter: David Smiley
>            Priority: Minor
>         Attachments: LUCENE-7901.patch, LUCENE-7901.patch
>
>
> The default/original Highlighter has a constructor that takes several 
> parameters, including an Encoder.  If per chance these are null, we'll throw 
> an exception later at highlight time but it's nicer to get an exception 
> eagerly.  It will also avoid the LUCENE-6979 trap.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to