mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
detect old header too
This commit is contained in:
+1
@@ -54,6 +54,7 @@ public class FileHeaderChecker {
|
||||
TIntObjectHashMap<String> offsetToProperty = new TIntObjectHashMap<String>();
|
||||
String templateText = template.getText().trim();
|
||||
String regex = templateToRegex(templateText, offsetToProperty);
|
||||
regex = StringUtil.replace(regex, "with", "(?:with|by)");
|
||||
regex = ".*("+regex+").*";
|
||||
String fileText = file.getText();
|
||||
Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
|
||||
|
||||
+8
-1
@@ -8,7 +8,14 @@
|
||||
<description>Default File template</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<problem>
|
||||
<file>X2.java</file>
|
||||
<line>4</line>
|
||||
<problem_class>Default File Template Usage</problem_class>
|
||||
<description>Default File template</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>X.java</file>
|
||||
<line>17</line>
|
||||
<package>x</package>
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package x;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
* User: Alexey
|
||||
* Date: 02.12.2005
|
||||
* Time: 0:24:14
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class X2 {
|
||||
}
|
||||
Reference in New Issue
Block a user