use of com.liferay.blade.api.SearchResult in project liferay-ide by liferay.
the class WebContentTypeRemoved method searchFile.
@Override
protected List<SearchResult> searchFile(File file, JavaFile javaFileChecker) {
List<SearchResult> searchResults = new ArrayList<>();
// check JournalArticle.getType() and JournalFeed.getType()
List<SearchResult> getTypes = javaFileChecker.findMethodInvocations("JournalArticle", null, "getType", null);
searchResults.addAll(getTypes);
getTypes = javaFileChecker.findMethodInvocations("JournalFeed", null, "getType", null);
searchResults.addAll(getTypes);
// callers of ArticleTypeException's methods
SearchResult exceptionImports = javaFileChecker.findImport("com.liferay.portlet.journal.ArticleTypeException");
if (exceptionImports != null) {
searchResults.add(exceptionImports);
}
List<SearchResult> catchExceptions = javaFileChecker.findCatchExceptions(new String[] { "ArticleTypeException" });
searchResults.addAll(catchExceptions);
// JournalArticleLocalServiceUtil
List<SearchResult> journalArticleLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleLocalServiceUtil", "addArticle", new String[] { "long", "long", "long", "long", "long", "String", "boolean", "double", "java.util.Map<java.util.Locale,java.lang.String>", "java.util.Map<java.util.Locale,java.lang.String>", "String", "String", "String", "String", "String", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "boolean", "int", "int", "int", "int", "int", "boolean", "boolean", "boolean", "String", "File", "java.util.Map<java.lang.String,byte[]>", "String", "ServiceContext" });
searchResults.addAll(journalArticleLocalServiceUtil);
journalArticleLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleLocalServiceUtil", "search", new String[] { "long", "long", "java.util.List<java.lang.Long>", "long", "String", "Double", "String", "String", "String", "Date", "Date", "int", "Date", "int", "int", "OrderByComparator" });
searchResults.addAll(journalArticleLocalServiceUtil);
journalArticleLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleLocalServiceUtil", "search", new String[] { "long", "long", "java.util.List<java.lang.Long>", "long", "String", "Double", "String", "String", "String", "String", "String", "String", "Date", "Date", "int", "Date", "boolean", "int", "int", "OrderByComparator" });
searchResults.addAll(journalArticleLocalServiceUtil);
journalArticleLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleLocalServiceUtil", "search", new String[] { "long", "long", "java.util.List<java.lang.Long>", "long", "String", "Double", "String", "String", "String", "String", "String[]", "String[]", "Date", "Date", "int", "Date", "boolean", "int", "int", "OrderByComparator" });
searchResults.addAll(journalArticleLocalServiceUtil);
journalArticleLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleLocalServiceUtil", "search", new String[] { "long", "long", "java.util.List<Long>", "long", "String", "String", "String", "String", "String", "String", "String", "String", "LinkedHashMap<String,Object>", "boolean", "int", "int", "Sort" });
searchResults.addAll(journalArticleLocalServiceUtil);
journalArticleLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleLocalServiceUtil", "searchCount", new String[] { "long", "long", "java.util.List<java.lang.Long>", "long", "String", "Double", "String", "String", "String", "Date", "Date", "int", "Date" });
searchResults.addAll(journalArticleLocalServiceUtil);
journalArticleLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleLocalServiceUtil", "searchCount", new String[] { "long", "long", "java.util.List<java.lang.Long>", "long", "String", "Double", "String", "String", "String", "String", "String", "String", "Date", "Date", "int", "Date", "boolean" });
searchResults.addAll(journalArticleLocalServiceUtil);
journalArticleLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleLocalServiceUtil", "searchCount", new String[] { "long", "long", "java.util.List<java.lang.Long>", "long", "String", "Double", "String", "String", "String", "String", "String[]", "String[]", "Date", "Date", "int", "Date", "boolean" });
searchResults.addAll(journalArticleLocalServiceUtil);
journalArticleLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleLocalServiceUtil", "updateArticle", new String[] { "long", "long", "long", "String", "double", "java.util.Map<java.util.Locale,java.lang.String>", "java.util.Map<java.util.Locale,java.lang.String>", "String", "String", "String", "String", "String", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "boolean", "int", "int", "int", "int", "int", "boolean", "boolean", "boolean", "String", "File", "java.util.Map<java.lang.String,byte[]>", "String", "ServiceContext" });
searchResults.addAll(journalArticleLocalServiceUtil);
// JournalArticleServiceUtil
List<SearchResult> journalArticleServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleServiceUtil", "addArticle", new String[] { "long", "long", "long", "long", "String", "boolean", "java.util.Map<java.util.Locale,java.lang.String>", "java.util.Map<java.util.Locale,java.lang.String>", "String", "String", "String", "String", "String", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "boolean", "int", "int", "int", "int", "int", "boolean", "boolean", "boolean", "String", "File", "java.util.Map<java.lang.String,byte[]>", "String", "ServiceContext" });
searchResults.addAll(journalArticleServiceUtil);
journalArticleServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleServiceUtil", "addArticle", new String[] { "long", "long", "long", "long", "String", "boolean", "java.util.Map<java.util.Locale,java.lang.String>", "java.util.Map<java.util.Locale,java.lang.String>", "String", "String", "String", "String", "String", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "boolean", "int", "int", "int", "int", "int", "boolean", "boolean", "String", "ServiceContext" });
searchResults.addAll(journalArticleServiceUtil);
journalArticleServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleServiceUtil", "search", new String[] { "long", "long", "java.util.List<Long>", "long", "String", "Double", "String", "String", "String", "Date", "Date", "int", "Date", "int", "int", "OrderByComparator" });
searchResults.addAll(journalArticleServiceUtil);
journalArticleServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleServiceUtil", "search", new String[] { "long", "long", "java.util.List<java.lang.Long>", "long", "String", "Double", "String", "String", "String", "String", "String", "String", "Date", "Date", "int", "Date", "boolean", "int", "int", "OrderByComparator" });
searchResults.addAll(journalArticleServiceUtil);
journalArticleServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleServiceUtil", "search", new String[] { "long", "long", "java.util.List<java.lang.Long>", "long", "String", "Double", "String", "String", "String", "String", "String[]", "String[]", "Date", "Date", "int", "Date", "boolean", "int", "int", "OrderByComparator" });
searchResults.addAll(journalArticleServiceUtil);
journalArticleServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleServiceUtil", "searchCount", new String[] { "long", "long", "java.util.List<Long>", "long", "String", "Double", "String", "String", "String", "Date", "Date", "int", "Date" });
searchResults.addAll(journalArticleServiceUtil);
journalArticleServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleServiceUtil", "searchCount", new String[] { "long", "long", "java.util.List<Long>", "long", "String", "Double", "String", "String", "String", "String", "String", "String", "Date", "Date", "int", "Date", "boolean" });
searchResults.addAll(journalArticleServiceUtil);
journalArticleServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleServiceUtil", "searchCount", new String[] { "long", "long", "java.util.List<Long>", "long", "String", "Double", "String", "String", "String", "String", "String[]", "String[]", "Date", "Date", "int", "Date", "boolean" });
searchResults.addAll(journalArticleServiceUtil);
journalArticleServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalArticleServiceUtil", "updateArticle", new String[] { "long", "long", "String", "double", "java.util.Map<java.util.Locale,java.lang.String>", "java.util.Map<java.util.Locale,java.lang.String>", "String", "String", "String", "String", "String", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "boolean", "int", "int", "int", "int", "int", "boolean", "boolean", "boolean", "String", "File", "java.util.Map<java.lang.String,byte[]>", "String", "ServiceContext" });
searchResults.addAll(journalArticleServiceUtil);
// JournalFeedLocalServiceUtil
List<SearchResult> journalFeedLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalFeedLocalServiceUtil", "addFeed", new String[] { "long", "long", "String", "boolean", "String", "String", "String", "String", "String", "String", "int", "String", "String", "String", "String", "String", "String", "double", "ServiceContext" });
searchResults.addAll(journalFeedLocalServiceUtil);
journalFeedLocalServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalFeedLocalServiceUtil", "updateFeed", new String[] { "long", "String", "String", "String", "String", "String", "String", "String", "int", "String", "String", "String", "String", "String", "String", "double", "ServiceContext" });
searchResults.addAll(journalFeedLocalServiceUtil);
// JournalFeedServiceUtil
List<SearchResult> journalFeedServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalFeedServiceUtil", "addFeed", new String[] { "long", "String", "boolean", "String", "String", "String", "String", "String", "String", "int", "String", "String", "String", "String", "String", "String", "double", "ServiceContext" });
searchResults.addAll(journalFeedServiceUtil);
journalFeedServiceUtil = javaFileChecker.findMethodInvocations(null, "JournalFeedServiceUtil", "updateFeed", new String[] { "long", "String", "String", "String", "String", "String", "String", "String", "int", "String", "String", "String", "String", "String", "String", "double", "ServiceContext" });
searchResults.addAll(journalFeedServiceUtil);
return searchResults;
}
use of com.liferay.blade.api.SearchResult in project liferay-ide by liferay.
the class MVCPortletClassInPortletXML method searchFile.
@Override
protected List<SearchResult> searchFile(File file, XMLFile xmlFileChecker) {
if (!"portlet.xml".equals(file.getName())) {
return Collections.emptyList();
}
List<SearchResult> results = new ArrayList<>();
Collection<SearchResult> tags = xmlFileChecker.findElement("portlet-class", "com.liferay.util.bridges.mvc.MVCPortlet");
for (SearchResult tagResult : tags) {
tagResult.autoCorrectContext = _KEY;
}
results.addAll(tags);
return results;
}
use of com.liferay.blade.api.SearchResult in project liferay-ide by liferay.
the class PropertiesFileMigrator method analyze.
@Override
public List<Problem> analyze(File file) {
List<Problem> problems = new ArrayList<>();
PropertiesFileChecker propertiesFileChecker = new PropertiesFileChecker(file);
for (String key : properties) {
List<SearchResult> results = propertiesFileChecker.findProperties(key);
if (results != null) {
String sectionHtml = MarkdownParser.getSection("BREAKING_CHANGES.markdown", sectionKey);
for (SearchResult searchResult : results) {
problems.add(new Problem(problemTitle, problemSummary, problemType, problemTickets, file, searchResult.startLine, searchResult.startOffset, searchResult.endOffset, sectionHtml, searchResult.autoCorrectContext, Problem.STATUS_NOT_RESOLVED, Problem.DEFAULT_MARKER_ID, Problem.MARKER_ERROR));
}
}
}
return problems;
}
use of com.liferay.blade.api.SearchResult in project liferay-ide by liferay.
the class RenamePortalKernelImports method searchFile.
@Override
public List<SearchResult> searchFile(File file, JavaFile javaFile) {
List<SearchResult> searchResults = new ArrayList<>();
List<SearchResult> importResult = javaFile.findImports(_imports.keySet().toArray(new String[0]));
if (ListUtil.isNotEmpty(importResult)) {
for (SearchResult result : importResult) {
// make sure that our import is not in list of fixed imports
boolean skip = false;
if (result.searchContext != null) {
for (String fixed : _imports.values().toArray(new String[0])) {
if (result.searchContext.contains(fixed)) {
skip = true;
break;
}
}
}
if (!skip) {
result.autoCorrectContext = getPrefix() + _getImportNameFromResult(result);
searchResults.add(result);
}
}
}
return _removeDuplicate(searchResults);
}
Aggregations