Preview:
   private void setExtensionMaxExpiration(AccountCourseDTO dto, ExtensionInformation extensionInformation, Long userId){
       List<AccountCourseDTO> allCourses = userCourseDao.findAllUserOrders(userId);

       if (!(dto == null)) {
           boolean dupety = false;
           for(AccountCourseDTO courses: allCourses){
               if(courses.getCourseId().equals(dto.getCourseId())){
                   dupety=true;
                   break;
               }
           }
           if(dupety && dto.getProductType()!=6){
               DateTime originalMaxExpirationDate = extensionInformation.getMaxExpirationDate();


           if(!(dto ==null)){
               for(AccountCourseDTO coursess: allCourses){
                   if (coursess.getCourseId().equals(dto.getCourseId())) {
                       dupety=true;
                       break;


                   }
               }
               if(dupety && dto.getProductType()==6){
                   extensionInformation.setMaxExpirationDate(originalMaxExpirationDate);
               }
           }
       }

   }}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter