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

Marshall Schor commented on UIMA-5920:
--------------------------------------

saw some interesting refactorings, but sometimes others might be missed. Here's 
an example:
 In QuickTypeSelectionDialog, the original:
{code:java}
 Collections.sort(types, new Comparator<Type>() {
      @Override
      public int compare(Type o1, Type o2) {
        return o1.getName().compareTo(o2.getName());
      }
    });
{code}
The refactored:
{code:java}
types.sort(new Comparator<Type>() {
      @Override
      public int compare(Type o1, Type o2) {
        return o1.getName().compareTo(o2.getName());
      }
    });
{code}
The improved refactoring (not done by the automated tool) avoids creating a new 
instance of a subclass of Comparator
{code:java}
types.sort((Type o1, Type o2) -> o1.getName().compareTo(o2.getName());
{code}

> Refactor the CAS Editor to use Java 8 features
> ----------------------------------------------
>
>                 Key: UIMA-5920
>                 URL: https://issues.apache.org/jira/browse/UIMA-5920
>             Project: UIMA
>          Issue Type: Improvement
>          Components: CAS Editor
>            Reporter: Joern Kottmann
>            Assignee: Marshall Schor
>            Priority: Minor
>         Attachments: uima-5920.patch
>
>
> All the Cas Editor code was written before more modern features of Java 7 and 
> 8 became available. It would be nice to refactor the source code and make use 
> of modern language features where it makes sense.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to