mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
anonymous -> lambda
This commit is contained in:
@@ -47,12 +47,7 @@ public class ClassMappingNameConverter extends ResolvingConverter.StringConverte
|
||||
DomElement parent = context.getInvocationElement().getParent();
|
||||
assert parent != null;
|
||||
List<DomElement> children = DomUtil.getDefinedChildren(parent, true, true);
|
||||
DomElement classElement = ContainerUtil.find(children, new Condition<DomElement>() {
|
||||
@Override
|
||||
public boolean value(DomElement domElement) {
|
||||
return domElement.getAnnotation(MappingClass.class) != null;
|
||||
}
|
||||
});
|
||||
DomElement classElement = ContainerUtil.find(children, domElement -> domElement.getAnnotation(MappingClass.class) != null);
|
||||
if (classElement == null) return Collections.emptyList();
|
||||
Object value = ((GenericDomValue)classElement).getValue();
|
||||
if (value == null) return Collections.emptyList();
|
||||
|
||||
+2
-10
@@ -113,11 +113,7 @@ public abstract class AbstractMethodResolveConverter<ParentType extends DomEleme
|
||||
Set<PsiMethod> methodList = new LinkedHashSet<PsiMethod>();
|
||||
Processor<PsiMethod> processor = CommonProcessors.notNullProcessor(Processors.cancelableCollectProcessor(methodList));
|
||||
processMethods(context, processor, s -> {
|
||||
final List<PsiMethod> list = ContainerUtil.findAll(getVariants(s), new Condition<PsiMethod>() {
|
||||
public boolean value(final PsiMethod object) {
|
||||
return acceptMethod(object, context);
|
||||
}
|
||||
});
|
||||
final List<PsiMethod> list = ContainerUtil.findAll(getVariants(s), object -> acceptMethod(object, context));
|
||||
return list.toArray(new PsiMethod[list.size()]);
|
||||
});
|
||||
return methodList;
|
||||
@@ -183,11 +179,7 @@ public abstract class AbstractMethodResolveConverter<ParentType extends DomEleme
|
||||
@Nullable
|
||||
public static PsiMethod findMethod(final PsiClass psiClass, final String methodName, @Nullable final AbstractMethodParams methodParameters) {
|
||||
if (psiClass == null || methodName == null) return null;
|
||||
return ContainerUtil.find(psiClass.findMethodsByName(methodName, true), new Condition<PsiMethod>() {
|
||||
public boolean value(final PsiMethod object) {
|
||||
return methodParamsMatchSignature(methodParameters, object);
|
||||
}
|
||||
});
|
||||
return ContainerUtil.find(psiClass.findMethodsByName(methodName, true), object -> methodParamsMatchSignature(methodParameters, object));
|
||||
}
|
||||
|
||||
public static boolean methodParamsMatchSignature(@Nullable final AbstractMethodParams params, final PsiMethod psiMethod) {
|
||||
|
||||
+2
-10
@@ -100,11 +100,7 @@ public class GenericDomValueConvertersRegistry {
|
||||
}
|
||||
|
||||
public void registerConverter(@NotNull Converter<?> provider, @NotNull final PsiType type) {
|
||||
registerConverter(provider, new Condition<Pair<PsiType, GenericDomValue>>() {
|
||||
public boolean value(final Pair<PsiType, GenericDomValue> pair) {
|
||||
return Comparing.equal(pair.getFirst(), type);
|
||||
}
|
||||
});
|
||||
registerConverter(provider, pair -> Comparing.equal(pair.getFirst(), type));
|
||||
}
|
||||
|
||||
public void registerConverter(@NotNull Converter<?> provider, @NotNull Condition<Pair<PsiType, GenericDomValue>> condition) {
|
||||
@@ -124,11 +120,7 @@ public class GenericDomValueConvertersRegistry {
|
||||
|
||||
public void registerConverter(@NotNull Converter<?> provider, @NotNull Class type) {
|
||||
final String name = type.getCanonicalName();
|
||||
registerConverter(provider, new Condition<Pair<PsiType, GenericDomValue>>() {
|
||||
public boolean value(final Pair<PsiType, GenericDomValue> pair) {
|
||||
return pair.first != null && Comparing.equal(name, pair.first.getCanonicalText());
|
||||
}
|
||||
});
|
||||
registerConverter(provider, pair -> pair.first != null && Comparing.equal(name, pair.first.getCanonicalText()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user