summaryrefslogtreecommitdiff
path: root/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java')
-rw-r--r--platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java b/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java
index 6deda3d4b70a..6f03fd02446e 100644
--- a/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java
+++ b/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java
@@ -224,7 +224,7 @@ public abstract class UsefulTestCase extends TestCase {
}
public static CompositeException doCheckForSettingsDamage(@NotNull CodeStyleSettings oldCodeStyleSettings,
- @NotNull CodeStyleSettings currentCodeStyleSettings) throws Exception {
+ @NotNull CodeStyleSettings currentCodeStyleSettings) throws Exception {
CompositeException result = new CompositeException();
final CodeInsightSettings settings = CodeInsightSettings.getInstance();
try {
@@ -234,9 +234,13 @@ public abstract class UsefulTestCase extends TestCase {
}
catch (AssertionError error) {
CodeInsightSettings clean = new CodeInsightSettings();
- Element temp = new Element("temp");
- clean.writeExternal(temp);
- settings.loadState(temp);
+ for (Field field : clean.getClass().getFields()) {
+ try {
+ ReflectionUtil.copyFieldValue(clean, settings, field);
+ }
+ catch (Exception ignored) {
+ }
+ }
result.add(error);
}