Skip to content

Commit

Permalink
Merge pull request #106 from YevgenDemoTestOrganization/feature/BLZT-…
Browse files Browse the repository at this point in the history
…43-small-sonar--fixes

BLZT-43: small sonar fixes.
  • Loading branch information
PolukovY authored Dec 1, 2023
2 parents 7b4f555 + ee8400b commit 66f99c7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,21 @@
* This annotation can be applied to fields, constructors, and methods in a Bring bean class to let Bring automatically
* inject the dependencies at runtime.
*
* <p>When applied to a field, the Bring IoC container will automatically inject a compatible bean, resolved by type,
* When applied to a field, the Bring IoC container will automatically inject a compatible bean, resolved by type,
* into the annotated field. When applied to a constructor, the container will use constructor injection to provide
* the required dependencies. If applied to a method, the container will invoke the method after initializing the bean,
* injecting the necessary dependencies into the method parameters.
*
* <p>This annotation is part of the Bring Framework's dependency injection mechanism, enabling the creation of loosely
* This annotation is part of the Bring Framework's dependency injection mechanism, enabling the creation of loosely
* coupled and easily testable components.
*
* <p><strong>Usage Example:</strong>
* <pre>
* {@code
* @Component
* public class MyComponent {
* When we have a class possesses only one constructor, explicitly adding the @Autowired annotation isn't mandatory.
* Bring inherently knows which constructor to invoke and handles it accordingly.
*
* @Autowired
* private MyDependency myDependency;
*
* // Constructors and methods can also be annotated
* @Autowired
* public MyComponent(MyDependency myDependency) {
* this.myDependency = myDependency;
* }
* }
* }
* </pre>
* For classes with multiple constructors, it becomes imperative to specify to Bring which constructor should be utilized
* through the @Autowired annotation. This annotation acts as a directive for Bing to identify
* and use the designated constructor to resolve dependencies properly.
* This way, when Bring encounters multiple constructors within a class, the @Autowired annotation guides it in selecting the appropriate constructor for dependency resolution.
*
* @author Blyzhnytsia Team
* @since 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* Annotation used to mark extensions for custom scanners, resolvers, or processors in the client's application.
* These extensions can be used to perform specific tasks related to bean scanning, resolving, or processing.
* In addition, we have some limitation on constructor some of the classes should have only default or one field.
* for instance RestControllerBeanPostProcessor
* for instance RestControllerBeanPostProcessor.
* This limitation only for customization scanners, resolvers, or processors
*
* @author Blyzhnytsia Team
* @since 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class BeanPostProcessorDefinitionFactory {
/**
* The list of bean factory post-processors created by this factory.
*/
private final List<BeanFactoryPostProcessor> beanFactoryPostProcessors;
private final List<? extends BeanFactoryPostProcessor> beanFactoryPostProcessors;

/**
* Constructs a new BeanPostProcessorDefinitionFactory and initializes the list of post-processors.
Expand All @@ -57,7 +57,7 @@ public BeanPostProcessorDefinitionFactory(Reflections reflections) {
.stream()
.sorted(ORDER_COMPARATOR)
.map(clazz -> clazz.cast(getConstructorWithOutParameters(clazz)))
.collect(Collectors.toList());
.toList();

log.info("Register BeanFactoryPostProcessors {}", Arrays.toString(beanFactoryPostProcessors.toArray()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public abstract class AbstractValueTypeInjector {

private final static BiFunction<List<BeanDefinition>, String, List<BeanDefinition>> PRIMARY_FILTER_FUNCTION =
private static final BiFunction<List<BeanDefinition>, String, List<BeanDefinition>> PRIMARY_FILTER_FUNCTION =
(beanDefinitions, qualifier) -> beanDefinitions.stream()
.filter(BeanDefinition::isPrimary
).toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public class HttpHeaders {
/**
* Map to store header name-value pairs.
*/
Map<String, String> headers;
private final Map<String, String> headers;

/**
* List containing all header names as strings.
*/
private List<String> headersNameList;
private final List<String> headersNameList;

/**
* Constructs a new HttpHeaders object with an empty header map and initializes the list of header names.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* @author Blyzhnytsia Team
* @since 1.0
*/
@Getter
public enum HttpStatus {

// 1xx Informational
Expand Down Expand Up @@ -354,6 +353,17 @@ public enum HttpStatus {
this.reasonPhrase = reasonPhrase;
}

public int getValue() {
return value;
}

public Series getSeries() {
return series;
}

public String getReasonPhrase() {
return reasonPhrase;
}

public enum Series {

Expand All @@ -368,5 +378,9 @@ public enum Series {
}

private final int value;

public int getValue() {
return value;
}
}
}

0 comments on commit 66f99c7

Please sign in to comment.