Skip to content

Deprecation of CommonsMultipartResolver gets reported #549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright 2021 - 2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.sbm.boot.upgrade_27_30.report.helper;

import org.springframework.sbm.boot.common.finder.MatchingMethod;
import org.springframework.sbm.boot.common.finder.SpringBeanMethodDeclarationFinder;
import org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportSection;
import org.springframework.sbm.engine.context.ProjectContext;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class CommonsMultipartResolverHelper implements SpringBootUpgradeReportSection.Helper<List<String>>{
private static final String COMMONS_MULTIPART_RESOLVER_CLASS = "org.springframework.web.multipart.commons.CommonsMultipartResolver";
private List<String> types;

@Override
public String getDescription() {
return null;
}

@Override
public boolean evaluate(ProjectContext context) {
List<MatchingMethod> search = context
.search(
new SpringBeanMethodDeclarationFinder(
COMMONS_MULTIPART_RESOLVER_CLASS
)
);

types = search.stream()
.map(k -> k.getType().getFullyQualifiedName())
.collect(Collectors.toList());

return !search.isEmpty();
}

@Override
public Map<String, List<String>> getData() {
return Map.of("types", types);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,22 @@
contributors:
- "Sandeep Nagaraj[@sanagaraj-pivotal]"

- title: Commons Multipart Upload
helper: org.springframework.sbm.boot.upgrade_27_30.report.helper.CommonsMultipartResolverHelper
change: |-
Support for Spring Framework’s `CommonsMultipartResolver` has been removed following its removal in Spring Framework 6
affected: |-
We found usage of `CommonsMultipartResolver` in following files:

<#list types as type>
* `${type}`
</#list>
remediation:
description: |-
Remove beans of type `CommonsMultipartResolver` and rely on Spring Boot auto-configuration
gitHubIssue: 541
contributors:
- "Sandeep Nagaraj[@sanagaraj-pivotal]"
footer: |-
We want to say thank you to all Contributors:

Expand Down

This file was deleted.

Loading