mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
[extract method] IDEA-318013: check explicit parent of identifier instead of search
GitOrigin-RevId: d632f6dfffdbfe8912882f30c9bd203e95362a54
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fe6f93dcc9
commit
f2ff1ff151
@@ -0,0 +1,21 @@
|
||||
package org.example;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
class Parent {
|
||||
public boolean test(Collection<File> files) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class Child extends Parent {
|
||||
|
||||
@Override
|
||||
public boolean test(Collection<File> files) {
|
||||
return files.stream().allMatch(file -> {
|
||||
String name = file.getName();
|
||||
return <selection>name.endsWith("jar") || name.endsWith("tar")</selection>;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.example;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
class Parent {
|
||||
public boolean test(Collection<File> files) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class Child extends Parent {
|
||||
|
||||
@Override
|
||||
public boolean test(Collection<File> files) {
|
||||
return files.stream().allMatch(file -> {
|
||||
String name = file.getName();
|
||||
return isaBoolean(name);
|
||||
});
|
||||
}
|
||||
|
||||
private static boolean isaBoolean(String name) {
|
||||
return name.endsWith("jar") || name.endsWith("tar");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user