-
Notifications
You must be signed in to change notification settings - Fork 686
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONARJAVA-4681: Fix bug due to wrong semantics usage on S6832 (#4524)
- Loading branch information
Showing
4 changed files
with
48 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...checks/spring/NonSingletonAutowiredInSingletonCheckSampleNonSingletonBeansDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package checks.spring; | ||
|
||
import org.springframework.context.annotation.Scope; | ||
import org.springframework.context.annotation.ScopedProxyMode; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.context.WebApplicationContext; | ||
|
||
import static org.springframework.context.annotation.ScopedProxyMode.TARGET_CLASS; | ||
|
||
public class NonSingletonAutowiredInSingletonCheckSampleNonSingletonBeansDefinition { | ||
private static final String PROTOTYPE_SCOPE = "prototype"; | ||
|
||
@Component | ||
@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = TARGET_CLASS) | ||
public class RequestBean1 { | ||
} | ||
|
||
@Scope("prototype") | ||
public class PrototypeBean1 { | ||
} | ||
|
||
@Scope(value = "prototype") | ||
public class PrototypeBean2 { | ||
} | ||
|
||
@Scope(value = PROTOTYPE_SCOPE, scopeName = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS) | ||
public class PrototypeBean3 { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters