[ 
https://issues.apache.org/jira/browse/JAMES-2382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17282898#comment-17282898
 ] 

ASF GitHub Bot commented on JAMES-2382:
---------------------------------------

chibenwa commented on pull request #110:
URL: https://github.com/apache/james-project/pull/110#issuecomment-777255182


   Hello @ShangwenWang !
   
   Thanks for your interest on this topic.
   
   This class had been deprecated and removed, support for OSGI dropped.
   
   To answer you, I disagree with `find` and `get` being semantically the same. 
The end result is the same (you get results out of a query), but I would 
associate `get` with something effortless, while `find` would be more 
computational heavy (I can not get it easily so I need to search for it).
   
   Scala maps 
(https://www.scala-lang.org/api/current/scala/collection/Map.html) do rely on 
such a semantic difference:
   
   ```
    def getOrElse[V1 >: V](key: K, default: => V1): V1
   
   Returns the value associated with a key, or a default value if the key is 
not contained in the map.
   ```
   
   and
   
   ```
   def find(p: ((K, V)) => Boolean): Option[(K, V)]
   
   Finds the first element of the map satisfying a predicate, if any.
   
   (iterates on all values)
   ```
   
   My 2 cents,
   
   Benoit


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> Inconsistent method name
> ------------------------
>
>                 Key: JAMES-2382
>                 URL: https://issues.apache.org/jira/browse/JAMES-2382
>             Project: James Server
>          Issue Type: Improvement
>            Reporter: KuiLIU
>            Priority: Major
>
> The following method is named "hasAnnotatedProperty" that is a query of 
> asking whether the propertyDescriptor has the AnnotatedProperty or not.
> Actually, the method returns an AnnotatedProperty found by the 
> propertyDescriptor.
> Thus, the method name "findAnnotatedProperty" should be intuitive than 
> "hasAnnotatedProperty".
> {code:java}
>     private A hasAnnotatedProperty(PropertyDescriptor propertyDescriptor) {
>         Method setter = propertyDescriptor.getWriteMethod();
>         return setter != null ? AnnotationUtils.getAnnotation(setter, 
> getAnnotation()) : null;
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to