use of com.liferay.blade.upgrade.liferay70.PropertiesFileChecker in project liferay-ide by liferay.
the class LiferayVersionsProperties method analyze.
@Override
public List<Problem> analyze(File file) {
List<Problem> problems = new ArrayList<>();
if (file.getName().equals("liferay-plugin-package.properties")) {
PropertiesFileChecker propertiesFileChecker = new PropertiesFileChecker(file);
List<KeyInfo> keys = propertiesFileChecker.getInfos("liferay-versions");
if (ListUtil.isNotEmpty(keys)) {
String versions = keys.get(0).value;
if (!versions.matches(".*7\\.[0-9]\\.[0-9].*")) {
List<SearchResult> results = propertiesFileChecker.findProperties("liferay-versions");
if (results != null) {
String sectionHtml = problemSummary;
for (SearchResult searchResult : results) {
searchResult.autoCorrectContext = _PREFIX + "liferay-versions";
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.upgrade.liferay70.PropertiesFileChecker 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;
}
Aggregations