mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
exception filter: check that module ref is before class fq name
This commit is contained in:
@@ -35,4 +35,11 @@ public class ExceptionFilterTest extends JavaCodeInsightFixtureTestCase {
|
||||
assertNotNull(aClass);
|
||||
assertEquals(psiClass, aClass);
|
||||
}
|
||||
|
||||
public void testNonClassInTheLine() throws Exception {
|
||||
ExceptionWorker worker = new ExceptionWorker(new ExceptionInfoCache(GlobalSearchScope.allScope(getProject())));
|
||||
String line = "2016-12-20 10:58:36,617 [ 5740] INFO - llij.ide.plugins.PluginManager - Loaded bundled plugins: Android Support (10.2.2), Ant Support (1.0), Application Servers View (0.2.0), AspectJ Support (1.2), CFML Support (3.53), CSS Support (163.7743.44), CVS Integration (11), Cloud Foundry integration (1.0), CloudBees integration (1.0), Copyright (8.1), Coverage (163.7743.44), DSM Analysis (1.0.0), Database Tools and SQL (1.0), Eclipse Integration (3.0), EditorConfig (163.7743.44), Emma (163.7743.44), Flash/Flex Support (163.7743.44)";
|
||||
worker.execute(line, line.length());
|
||||
assertNull(worker.getPsiClass());
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ public class ExceptionWorker {
|
||||
final int dotIdx = line.lastIndexOf('.', lParenIdx);
|
||||
if (dotIdx < 0 || dotIdx < startIdx) return null;
|
||||
int moduleIdx = line.indexOf('/');
|
||||
int classNameIdx = moduleIdx > -1 && moduleIdx < lParenIdx ? moduleIdx + 1 : startIdx + 1 + (startIdx >= 0 ? AT.length() : 0);
|
||||
int classNameIdx = moduleIdx > -1 && moduleIdx < lParenIdx && moduleIdx < dotIdx ? moduleIdx + 1 : startIdx + 1 + (startIdx >= 0 ? AT.length() : 0);
|
||||
|
||||
// class, method, link
|
||||
return Trinity.create(new TextRange(classNameIdx, handleSpaces(line, dotIdx, -1)),
|
||||
|
||||
Reference in New Issue
Block a user