Skip to content

Commit e959f3e

Browse files
committed
hide SymfonyTempCodeInsightFixtureTestCase deprecation; for having no replacement
1 parent 53fe147 commit e959f3e

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/SymfonyTempCodeInsightFixtureTestCase.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*
2626
* @author Daniel Espendiller <daniel@espendiller.net>
2727
*/
28+
@SuppressWarnings("deprecation")
2829
abstract public class SymfonyTempCodeInsightFixtureTestCase extends UsefulTestCase {
2930
private Project project;
3031

@@ -83,26 +84,24 @@ protected VirtualFile[] createFiles(@NotNull String... files) {
8384
protected VirtualFile createFile(@NotNull String file, @Nullable String content) {
8485
final VirtualFile[] childData = new VirtualFile[1];
8586

86-
ApplicationManager.getApplication().runWriteAction(new Runnable() {
87-
@Override
88-
public void run() {
89-
try {
90-
String[] paths = file.split("/");
91-
92-
if(paths.length == 0) {
93-
childData[0] = getProject().getBaseDir().createChildData(this, file);
94-
} else {
95-
childData[0] = VfsUtil.createDirectoryIfMissing(
96-
getProject().getBaseDir(),
97-
StringUtils.join(Arrays.copyOf(paths, paths.length - 1), "/")
98-
).createChildData(this, paths[paths.length - 1]);
99-
}
100-
101-
if(content != null) {
102-
childData[0].setBinaryContent(content.getBytes());
103-
}
104-
} catch (IOException ignored) {
87+
ApplicationManager.getApplication().runWriteAction(() -> {
88+
try {
89+
String[] paths = file.split("/");
90+
VirtualFile baseDir = getProject().getBaseDir();
91+
92+
if(paths.length == 0) {
93+
childData[0] = baseDir.createChildData(SymfonyTempCodeInsightFixtureTestCase.this, file);
94+
} else {
95+
childData[0] = VfsUtil.createDirectoryIfMissing(
96+
baseDir,
97+
StringUtils.join(Arrays.copyOf(paths, paths.length - 1), "/")
98+
).createChildData(SymfonyTempCodeInsightFixtureTestCase.this, paths[paths.length - 1]);
10599
}
100+
101+
if(content != null) {
102+
childData[0].setBinaryContent(content.getBytes());
103+
}
104+
} catch (IOException ignored) {
106105
}
107106
});
108107

0 commit comments

Comments
 (0)