You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Pawan Verma (Jira)" <ji...@apache.org> on 2020/06/17 12:15:00 UTC

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

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)