UtilLoggingXmlLogImporter extends AbstractPluginableElement implements LogImporter { protected String extractFileName(String clazz) { int clazzStart = StringUtils.lastIndexOf(clazz, '.') + 1; clazzStart = Math.max(0, clazzStart); int clazzEnd = StringUtils.indexOf(clazz, '$'); if (clazzEnd < 0) { clazzEnd = clazz.length(); } return StringUtils.substring(clazz, clazzStart, clazzEnd); } UtilLoggingXmlLogImporter(); @Override void init(Properties properties); @Override void importLogs(InputStream in, LogDataCollector collector, ParsingContext parsingContext); void decodeEvents(final String document, LogDataCollector collector, ParsingContext parsingContext); @Override String getKeyStrokeAccelelator(); @Override int getMnemonic(); @Override Icon getIcon(); @Override TableColumns[] getTableColumnsToUse(); @Override void initParsingContext(ParsingContext parsingContext); @Override int getApiVersion();  }
@Test public void testExtractFileName() { assertEquals("Class", importer.extractFileName("package.Class")); assertEquals("MyClass", importer.extractFileName("MyClass")); assertEquals("MyClass", importer.extractFileName("MyClass$Internal")); assertEquals("MyClass", importer.extractFileName("package.MyClass$Internal")); assertEquals("MyClass", importer.extractFileName("package.MyClass$Internal$DoubleInternal")); assertEquals("MyClass", importer.extractFileName("package..s.b.sdf.d.MyClass$Internal")); assertEquals("MyClass", importer.extractFileName("package..s.b.sdf.d.MyClass")); }