[jira] [Created] (OFBIZ-11833) Replace anonymous types with lambda expressions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (OFBIZ-11833) Replace anonymous types with lambda expressions

Nicolas Malin (Jira)
Pawan Verma created OFBIZ-11833:
-----------------------------------

             Summary: Replace anonymous types with lambda expressions
                 Key: OFBIZ-11833
                 URL: https://issues.apache.org/jira/browse/OFBIZ-11833
             Project: OFBiz
          Issue Type: Improvement
          Components: ALL COMPONENTS
    Affects Versions: Trunk
            Reporter: Pawan Verma
            Assignee: Pawan Verma


Generally, something like that:
new PrivilegedAction<ClassLoader>() \{
    @Override
    public ClassLoader run() {
        ClassLoader cl = null;
        try {
            cl = Thread.currentThread().getContextClassLoader();
        } catch (SecurityException e) \{
            Debug.logError(e, e.getMessage(), MODULE);
        }
        return cl;
    }
});
is replaced with
(PrivilegedAction<ClassLoader>) () -> \{
    ClassLoader cl = null;
    try {
        cl = Thread.currentThread().getContextClassLoader();
    } catch (SecurityException e) \{
        Debug.logError(e, e.getMessage(), MODULE);
    }
    return cl;
});
 



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