github-advanced-security[bot] commented on code in PR #792:
URL: https://github.com/apache/struts/pull/792#discussion_r1800517584
##########
apps/showcase/src/main/java/org/apache/struts2/showcase/application/TestDataProvider.java:
##########
@@ -31,84 +31,87 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.io.Serial;
import java.io.Serializable;
-import java.util.Arrays;
import java.util.Date;
+import java.util.List;
/**
* TestDataProvider.
*/
@Service
public class TestDataProvider implements Serializable, InitializingBean {
- private static final long serialVersionUID = 1L;
- private static final Logger log =
LogManager.getLogger(TestDataProvider.class);
+ @Serial
+ private static final long serialVersionUID = 1L;
+ private static final Logger log =
LogManager.getLogger(TestDataProvider.class);
- public static final String[] POSITIONS = {
- "Developer",
- "System Architect",
- "Sales Manager",
- "CEO"
- };
+ public static final String[] POSITIONS = {
+ "Developer",
+ "System Architect",
+ "Sales Manager",
+ "CEO"
+ };
- public static final String[] LEVELS = {
- "Junior",
- "Senior",
- "Master"
- };
+ public static final String[] LEVELS = {
+ "Junior",
+ "Senior",
+ "Master"
+ };
- private static final Skill[] TEST_SKILLS = {
- new Skill("WW-SEN", "Struts Senior Developer"),
- new Skill("WW-JUN", "Struts Junior Developer"),
- new Skill("SPRING-DEV", "Spring Developer")
- };
+ private static final Skill[] TEST_SKILLS = {
+ new Skill("WW-SEN", "Struts Senior Developer"),
+ new Skill("WW-JUN", "Struts Junior Developer"),
+ new Skill("SPRING-DEV", "Spring Developer")
+ };
- public static final Employee[] TEST_EMPLOYEES = {
- new Employee(new Long(1), "Alan", "Smithee", new
Date(), new Float(2000f), true, POSITIONS[0],
- TEST_SKILLS[0], null, "alan",
LEVELS[0], "Nice guy"),
- new Employee(new Long(2), "Robert", "Robson", new
Date(), new Float(10000f), false, POSITIONS[1],
- TEST_SKILLS[1],
Arrays.asList(TEST_SKILLS).subList(1, TEST_SKILLS.length), "rob", LEVELS[1],
"Smart guy")
- };
+ public static final Employee[] TEST_EMPLOYEES = {
+ new Employee(1L, "Alan", "Smithee", new Date(), 2000f, true,
POSITIONS[0],
+ TEST_SKILLS[0], null, "alan", LEVELS[0], "Nice guy"),
+ new Employee(2L, "Robert", "Robson", new Date(), 10000f, false,
POSITIONS[1],
+ TEST_SKILLS[1], List.of(TEST_SKILLS).subList(1,
TEST_SKILLS.length), "rob", LEVELS[1], "Smart guy")
Review Comment:
## Credentials should not be hard-coded
<!--SONAR_ISSUE_KEY:AZKO0ZwIHPaZdZISaUju-->Revoke and change this password,
as it is compromised. <p>See more on <a
href="https://sonarcloud.io/project/issues?id=apache_struts&issues=AZKO0ZwIHPaZdZISaUju&open=AZKO0ZwIHPaZdZISaUju&pullRequest=792">SonarCloud</a></p>
[Show more
details](https://github.com/apache/struts/security/code-scanning/667)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]