mirror of
https://gitee.com/dcren/initializr.git
synced 2025-04-24 18:04:58 +08:00
Polish "Polish local variables and lambda names"
Closes gh-752
This commit is contained in:
parent
47d5bd25cd
commit
a61d85f711
@ -65,7 +65,8 @@ public class AbstractProjectRequestPostProcessor implements ProjectRequestPostPr
|
||||
*/
|
||||
protected Dependency getDependency(ProjectRequest request, String id) {
|
||||
return request.getResolvedDependencies().stream()
|
||||
.filter((dependency) -> id.equals(dependency.getId())).findFirst().orElse(null);
|
||||
.filter((dependency) -> id.equals(dependency.getId())).findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -55,15 +55,15 @@ public class SpringBootMetadataReader {
|
||||
* @return the versions
|
||||
*/
|
||||
public List<DefaultMetadataElement> getBootVersions() {
|
||||
ArrayNode projectReleases = (ArrayNode) this.content.get("projectReleases");
|
||||
ArrayNode releases = (ArrayNode) this.content.get("projectReleases");
|
||||
List<DefaultMetadataElement> list = new ArrayList<>();
|
||||
for (JsonNode jsonNode : projectReleases) {
|
||||
for (JsonNode node : releases) {
|
||||
DefaultMetadataElement version = new DefaultMetadataElement();
|
||||
version.setId(jsonNode.get("version").textValue());
|
||||
String name = jsonNode.get("versionDisplayName").textValue();
|
||||
version.setName(jsonNode.get("snapshot").booleanValue() ? name + " (SNAPSHOT)"
|
||||
: name);
|
||||
version.setDefault(jsonNode.get("current").booleanValue());
|
||||
version.setId(node.get("version").textValue());
|
||||
String name = node.get("versionDisplayName").textValue();
|
||||
version.setName(
|
||||
node.get("snapshot").booleanValue() ? name + " (SNAPSHOT)" : name);
|
||||
version.setDefault(node.get("current").booleanValue());
|
||||
list.add(version);
|
||||
}
|
||||
return list;
|
||||
|
@ -57,11 +57,11 @@ public class UiController {
|
||||
List<DependencyGroup> dependencyGroups = this.metadataProvider.get()
|
||||
.getDependencies().getContent();
|
||||
List<DependencyItem> content = new ArrayList<>();
|
||||
Version versionObj = (StringUtils.isEmpty(version) ? null
|
||||
Version requestedVersion = (StringUtils.isEmpty(version) ? null
|
||||
: Version.parse(version));
|
||||
dependencyGroups.forEach((group) -> group.getContent().forEach((dependency) -> {
|
||||
if (versionObj != null && dependency.getVersionRange() != null) {
|
||||
if (dependency.match(versionObj)) {
|
||||
if (requestedVersion != null && dependency.getVersionRange() != null) {
|
||||
if (dependency.match(requestedVersion)) {
|
||||
content.add(new DependencyItem(group.getName(), dependency));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user