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:16:00 UTC
[jira] [Updated] (OFBIZ-11833) Replace anonymous types with lambda
expressions
[ https://issues.apache.org/jira/browse/OFBIZ-11833?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pawan Verma updated OFBIZ-11833:
--------------------------------
Description:
Generally, something like that:
{code:java}
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;
}
});
{code}
is replaced with
{code:java}
(PrivilegedAction<ClassLoader>) () -> {
ClassLoader cl = null;
try
{ cl = Thread.currentThread().getContextClassLoader(); }
catch (SecurityException e) {
Debug.logError(e, e.getMessage(), MODULE);
}
return cl;
});
{code}
was:
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;
});
> 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
> Priority: Minor
>
> Generally, something like that:
> {code:java}
> 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;
> }
> });
> {code}
> is replaced with
> {code:java}
> (PrivilegedAction<ClassLoader>) () -> {
> ClassLoader cl = null;
> try
> { cl = Thread.currentThread().getContextClassLoader(); }
> catch (SecurityException e) {
> Debug.logError(e, e.getMessage(), MODULE);
> }
> return cl;
> });
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)