mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[ann] Default template inspection fixed to work on multi-catch sections
This commit is contained in:
@@ -96,4 +96,16 @@
|
||||
<description>Default File template</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>X.java</file>
|
||||
<line>63</line>
|
||||
<package>x</package>
|
||||
<class>
|
||||
<name>X</name>
|
||||
<display_name>X</display_name>
|
||||
</class>
|
||||
<problem_class>Default File Template Usage</problem_class>
|
||||
<description>Default File template</description>
|
||||
</problem>
|
||||
|
||||
</problems>
|
||||
+9
-2
@@ -1,5 +1,5 @@
|
||||
package x;
|
||||
import java.io.File;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
@@ -23,7 +23,7 @@ public class X implements Runnable{
|
||||
}
|
||||
}
|
||||
|
||||
private void g() {
|
||||
private void g() throws EOFException, FileNotFoundException {
|
||||
//To change body of created methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@@ -56,5 +56,12 @@ public class X implements Runnable{
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
private void multi() {
|
||||
try {
|
||||
g();
|
||||
} catch (EOFException | FileNotFoundException ex) {
|
||||
ex.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
@@ -2,9 +2,19 @@ package com.intellij.codeInspection;
|
||||
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.codeInspection.defaultFileTemplateUsage.DefaultFileTemplateUsageInspection;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.testFramework.InspectionTestCase;
|
||||
|
||||
public class DefaultFileTemplateInspectionTest extends InspectionTestCase {
|
||||
@Override
|
||||
protected Sdk getTestProjectSdk() {
|
||||
final Sdk sdk = super.getTestProjectSdk();
|
||||
LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_7);
|
||||
return sdk;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return JavaTestUtil.getJavaTestDataPath() + "/inspection";
|
||||
|
||||
Reference in New Issue
Block a user