diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionActionMetaData.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionActionMetaData.java
index 3b9ef426e7b9..57795443c9c3 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionActionMetaData.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionActionMetaData.java
@@ -25,6 +25,8 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.PluginId;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeManager;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.ObjectUtils;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -33,6 +35,7 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
+import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
@@ -154,7 +157,8 @@ public final class IntentionActionMetaData {
String[] children;
Exception cause = null;
try {
- children = new File(descriptionDirectory.toURI()).list();
+ URI uri = descriptionDirectory.toURI();
+ children = uri.isOpaque()? null : ObjectUtils.notNull(new File(uri).list(), ArrayUtil.EMPTY_STRING_ARRAY);
}
catch (URISyntaxException e) {
cause = e;
@@ -164,8 +168,8 @@ public final class IntentionActionMetaData {
cause = e;
children = null;
}
- LOG.error("URLs not found for prefix: '"+prefix+"', suffix: '"+suffix+"'; in directory: '"+descriptionDirectory+"'; directory contents: "+
- (children == null ? null : Arrays.asList(children)), cause);
+ LOG.error("URLs not found for available file types and prefix: '"+prefix+"', suffix: '"+suffix+"';" +
+ " in directory: '"+descriptionDirectory+ "'" + (children == null? "" : "; directory contents: "+ Arrays.asList(children)), cause);
return new TextDescriptor[0];
}
return urls.toArray(new TextDescriptor[urls.size()]);
diff --git a/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/after.java.template b/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/after.java.template
deleted file mode 100644
index 67fb495564cd..000000000000
--- a/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/after.java.template
+++ /dev/null
@@ -1,10 +0,0 @@
-import java.sql.*;
-
-public class Test {
- public void runScript(Statement st) throws SQLException {
- st.execute("create table some_table (id integer primary key)");
- st.execute("insert into some_table values(1)");
- st.execute("select * from some_table");
- st.execute("drop table some_table");
- }
-}
\ No newline at end of file
diff --git a/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/after.txt.template b/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/after.txt.template
new file mode 100644
index 000000000000..c4b64e5069ac
--- /dev/null
+++ b/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/after.txt.template
@@ -0,0 +1,3 @@
+...
+ sqlStatement.execute("select * from some_table");
+...
diff --git a/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/before.java.template b/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/before.java.template
deleted file mode 100644
index f6ee718db163..000000000000
--- a/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/before.java.template
+++ /dev/null
@@ -1,10 +0,0 @@
-import java.sql.*;
-
-public class Test {
- public void runScript(Statement st) throws SQLException {
- st.execute("create table some_table (id integer primary key)");
- st.execute("insert into some_table values(1)");
- st.execute("select * from some_table");
- st.execute("drop table some_table");
- }
-}
\ No newline at end of file
diff --git a/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/before.txt.template b/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/before.txt.template
new file mode 100644
index 000000000000..c4b64e5069ac
--- /dev/null
+++ b/platform/platform-resources-en/src/intentionDescriptions/QuickEditAction/before.txt.template
@@ -0,0 +1,3 @@
+...
+ sqlStatement.execute("select * from some_table");
+...
diff --git a/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/after.java.template b/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/after.java.template
deleted file mode 100644
index 67fb495564cd..000000000000
--- a/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/after.java.template
+++ /dev/null
@@ -1,10 +0,0 @@
-import java.sql.*;
-
-public class Test {
- public void runScript(Statement st) throws SQLException {
- st.execute("create table some_table (id integer primary key)");
- st.execute("insert into some_table values(1)");
- st.execute("select * from some_table");
- st.execute("drop table some_table");
- }
-}
\ No newline at end of file
diff --git a/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/after.txt.template b/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/after.txt.template
new file mode 100644
index 000000000000..c4b64e5069ac
--- /dev/null
+++ b/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/after.txt.template
@@ -0,0 +1,3 @@
+...
+ sqlStatement.execute("select * from some_table");
+...
diff --git a/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/before.java.template b/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/before.java.template
deleted file mode 100644
index f6ee718db163..000000000000
--- a/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/before.java.template
+++ /dev/null
@@ -1,10 +0,0 @@
-import java.sql.*;
-
-public class Test {
- public void runScript(Statement st) throws SQLException {
- st.execute("create table some_table (id integer primary key)");
- st.execute("insert into some_table values(1)");
- st.execute("select * from some_table");
- st.execute("drop table some_table");
- }
-}
\ No newline at end of file
diff --git a/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/before.txt.template b/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/before.txt.template
new file mode 100644
index 000000000000..c4b64e5069ac
--- /dev/null
+++ b/plugins/IntelliLang/src/intentionDescriptions/EditInjectionSettingsAction/before.txt.template
@@ -0,0 +1,3 @@
+...
+ sqlStatement.execute("select * from some_table");
+...
diff --git a/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/after.java.template b/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/after.java.template
deleted file mode 100644
index 67fb495564cd..000000000000
--- a/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/after.java.template
+++ /dev/null
@@ -1,10 +0,0 @@
-import java.sql.*;
-
-public class Test {
- public void runScript(Statement st) throws SQLException {
- st.execute("create table some_table (id integer primary key)");
- st.execute("insert into some_table values(1)");
- st.execute("select * from some_table");
- st.execute("drop table some_table");
- }
-}
\ No newline at end of file
diff --git a/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/after.txt.template b/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/after.txt.template
new file mode 100644
index 000000000000..c4b64e5069ac
--- /dev/null
+++ b/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/after.txt.template
@@ -0,0 +1,3 @@
+...
+ sqlStatement.execute("select * from some_table");
+...
diff --git a/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/before.java.template b/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/before.java.template
deleted file mode 100644
index f6ee718db163..000000000000
--- a/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/before.java.template
+++ /dev/null
@@ -1,10 +0,0 @@
-import java.sql.*;
-
-public class Test {
- public void runScript(Statement st) throws SQLException {
- st.execute("create table some_table (id integer primary key)");
- st.execute("insert into some_table values(1)");
- st.execute("select * from some_table");
- st.execute("drop table some_table");
- }
-}
\ No newline at end of file
diff --git a/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/before.txt.template b/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/before.txt.template
new file mode 100644
index 000000000000..c4b64e5069ac
--- /dev/null
+++ b/plugins/IntelliLang/src/intentionDescriptions/InjectLanguageAction/before.txt.template
@@ -0,0 +1,3 @@
+...
+ sqlStatement.execute("select * from some_table");
+...
diff --git a/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/after.java.template b/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/after.java.template
deleted file mode 100644
index 67fb495564cd..000000000000
--- a/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/after.java.template
+++ /dev/null
@@ -1,10 +0,0 @@
-import java.sql.*;
-
-public class Test {
- public void runScript(Statement st) throws SQLException {
- st.execute("create table some_table (id integer primary key)");
- st.execute("insert into some_table values(1)");
- st.execute("select * from some_table");
- st.execute("drop table some_table");
- }
-}
\ No newline at end of file
diff --git a/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/after.txt.template b/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/after.txt.template
new file mode 100644
index 000000000000..c4b64e5069ac
--- /dev/null
+++ b/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/after.txt.template
@@ -0,0 +1,3 @@
+...
+ sqlStatement.execute("select * from some_table");
+...
diff --git a/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/before.java.template b/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/before.java.template
deleted file mode 100644
index f6ee718db163..000000000000
--- a/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/before.java.template
+++ /dev/null
@@ -1,10 +0,0 @@
-import java.sql.*;
-
-public class Test {
- public void runScript(Statement st) throws SQLException {
- st.execute("create table some_table (id integer primary key)");
- st.execute("insert into some_table values(1)");
- st.execute("select * from some_table");
- st.execute("drop table some_table");
- }
-}
\ No newline at end of file
diff --git a/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/before.txt.template b/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/before.txt.template
new file mode 100644
index 000000000000..c4b64e5069ac
--- /dev/null
+++ b/plugins/IntelliLang/src/intentionDescriptions/UnInjectLanguageAction/before.txt.template
@@ -0,0 +1,3 @@
+...
+ sqlStatement.execute("select * from some_table");
+...