File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
spring-security-login-and-registration/src/main/java/org/baeldung/spring Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1818import org .springframework .transaction .annotation .Transactional ;
1919
2020@ Component
21- public class InitialDataLoader implements ApplicationListener <ContextRefreshedEvent > {
21+ public class SetupDataLoader implements ApplicationListener <ContextRefreshedEvent > {
2222
23- boolean alreadySetup = false ;
23+ private boolean alreadySetup = false ;
2424
2525 @ Autowired
2626 private UserRepository userRepository ;
@@ -34,11 +34,14 @@ public class InitialDataLoader implements ApplicationListener<ContextRefreshedEv
3434 @ Autowired
3535 private PasswordEncoder passwordEncoder ;
3636
37+ // API
38+
3739 @ Override
3840 @ Transactional
3941 public void onApplicationEvent (final ContextRefreshedEvent event ) {
40- if (alreadySetup )
42+ if (alreadySetup ) {
4143 return ;
44+ }
4245
4346 // == create initial privileges
4447 final Privilege readPrivilege = createPrivilegeIfNotFound ("READ_PRIVILEGE" );
You can’t perform that action at this time.
0 commit comments