cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Wed, 7 Sep 2022 20:53:05 +0000 (22:53 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Wed, 7 Sep 2022 20:53:05 +0000 (22:53 +0200)
src/main/java/eu/etaxonomy/cdm/persistence/hibernate/GrantedAuthorityRevokingRegistrationUpdateLister.java
src/main/java/eu/etaxonomy/cdm/vaadin/permission/AccessRestrictedView.java

index 3aaec613de64f6ce4ec4992f81c2dc5be8e632c8..b59d05549ed23be5f17cf3326feb48255d741cd3 100644 (file)
@@ -57,10 +57,8 @@ import eu.etaxonomy.cdm.persistence.permission.CdmAuthority;
  * by a database update. The RegistrationStatus causing this are contained in the constant
  * {@link GrantedAuthorityRevokingRegistrationUpdateLister#MODIFICATION_STOP_STATES MODIFICATION_STOP_STATES}
  *
- *
  * @author a.kohlbecker
  * @since Dec 18, 2017
- *
  */
 public class GrantedAuthorityRevokingRegistrationUpdateLister implements PostUpdateEventListener {
 
@@ -80,9 +78,6 @@ public class GrantedAuthorityRevokingRegistrationUpdateLister implements PostUpd
 
     private static final EnumSet<CRUD> UPDATE = EnumSet.of(CRUD.UPDATE);
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void onPostUpdate(PostUpdateEvent event) {
         if( event.getEntity() instanceof Registration){
@@ -118,18 +113,17 @@ public class GrantedAuthorityRevokingRegistrationUpdateLister implements PostUpd
      * individual users.
      */
     private Set<CdmAuthority> collectDeleteCandidates(Registration reg){
-        Set<CdmAuthority> deleteCandidates = new HashSet<CdmAuthority>();
+        Set<CdmAuthority> deleteCandidates = new HashSet<>();
         // add authority for Registration
         deleteCandidates.add(new CdmAuthority(reg,  RegistrationStatus.PREPARATION.name(), UPDATE));
         if(reg.getName() != null){
             addDeleteCandidates(deleteCandidates, reg.getName());
         }
-        for(TypeDesignationBase td : reg.getTypeDesignations()){
+        for(TypeDesignationBase<?> td : reg.getTypeDesignations()){
             addDeleteCandidates(deleteCandidates, td);
         }
 
         return deleteCandidates;
-
     }
 
     /**
@@ -149,12 +143,7 @@ public class GrantedAuthorityRevokingRegistrationUpdateLister implements PostUpd
         addDeleteCandidates(deleteCandidates, name.getExBasionymAuthorship());
     }
 
-
-    /**
-     * @param deleteCandidates
-     * @param td
-     */
-    private void addDeleteCandidates(Set<CdmAuthority> deleteCandidates, TypeDesignationBase td) {
+    private void addDeleteCandidates(Set<CdmAuthority> deleteCandidates, TypeDesignationBase<?> td) {
         if(td == null){
             return;
         }
@@ -282,12 +271,10 @@ public class GrantedAuthorityRevokingRegistrationUpdateLister implements PostUpd
         deleteQuery.setParameterList("authorities", authorityStrings);
         deleteQuery.setFlushMode(FlushMode.MANUAL); // workaround for  HHH-11822 (https://hibernate.atlassian.net/browse/HHH-11822)
         deleteQuery.executeUpdate();
-
     }
 
     @Override
     public boolean requiresPostCommitHanding(EntityPersister persister) {
         return false;
     }
-
-}
+}
\ No newline at end of file
index 1e08ab8b87ef901912c9bba15daeea7a32d3a483..5696fe60c74f12a90e1e6569b6138c5030d91e25 100644 (file)
@@ -15,13 +15,9 @@ import org.springframework.security.core.GrantedAuthority;
 /**
  * @author a.kohlbecker
  * @since Apr 25, 2017
- *
  */
 public interface AccessRestrictedView extends ReleasableResourcesView {
 
-    /**
-     * @return
-     */
     public boolean allowAnonymousAccess();
 
     /**