Skip to content

Commit

Permalink
Remove @component and declare using @bean
Browse files Browse the repository at this point in the history
  • Loading branch information
fabapp2 committed Sep 29, 2023
1 parent 2b7ffa7 commit 958be90
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ ProjectResourceSetSerializer projectResourceSetSerializer(ProjectResourceSeriali
ProjectResourceSetFactory projectResourceSetFactory(RewriteMigrationResultMerger rewriteMigrationResultMerger, RewriteSourceFileWrapper sourceFileWrapper, ExecutionContext executionContext) {
return new ProjectResourceSetFactory(rewriteMigrationResultMerger, sourceFileWrapper, executionContext);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
*
* @author Fabian Krüger
*/
@Component
@RequiredArgsConstructor
// TODO: should be package private
public class MavenPasswordDecrypter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.springframework.context.annotation.Import;
import org.springframework.sbm.boot.autoconfigure.ParserPropertiesPostProcessor;
import org.springframework.sbm.parsers.events.RewriteParsingEventListenerAdapter;
import org.springframework.sbm.project.resource.SbmApplicationProperties;
import org.springframework.sbm.scopes.ProjectMetadata;
import org.springframework.sbm.scopes.ScanScope;
import org.springframework.sbm.boot.autoconfigure.ScopeConfiguration;
Expand All @@ -48,7 +49,7 @@
*/
@Slf4j
@AutoConfiguration(after = {ScopeConfiguration.class})
@EnableConfigurationProperties(ParserProperties.class)
@EnableConfigurationProperties({ParserProperties.class, SbmApplicationProperties.class})
@Import({ScanScope.class, ScopeConfiguration.class})
public class RewriteParserConfiguration {

Expand All @@ -60,6 +61,11 @@ public class RewriteParserConfiguration {
// return new ProvenanceMarkerFactory(projectParserFactory);
// }

@Bean
MavenPasswordDecrypter mavenPasswordDecrypter() {
return new MavenPasswordDecrypter();
}

@Bean
MavenProvenanceMarkerFactory mavenProvenanceMarkerFactory() {
return new MavenProvenanceMarkerFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.List;
import java.util.stream.Collectors;

@Component
public class RewriteSourceFileWrapper {

public List<RewriteSourceFileHolder<? extends SourceFile>> wrapRewriteSourceFiles(Path absoluteProjectDir, List<SourceFile> parsedByRewrite) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@
*/
package org.springframework.sbm.project.resource;

import org.springframework.stereotype.Component;

import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

@Component
public class ProjectResourceSerializer {

public void writeChanges(InternalProjectResource projectResource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import java.util.ArrayList;

@Component
// TODO: Making ProjectResourceSet a scoped bean would allow to remove this class.
@RequiredArgsConstructor
public class ProjectResourceSetHolder {
private ProjectResourceSet projectResourceSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class ProjectResourceSetSerializer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.List;
import java.util.Optional;

@Component
@RequiredArgsConstructor
public class RewriteMigrationResultMerger {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

@Setter
@Getter
@Component
@ConfigurationProperties(prefix = "sbm")
public class SbmApplicationProperties {
private boolean gitSupportEnabled;
Expand Down

0 comments on commit 958be90

Please sign in to comment.