فهرست منبع

code clean-up

Shinsuke Sugaya 5 سال پیش
والد
کامیت
4e0d5ffd54

+ 2 - 2
src/main/java/org/codelibs/fess/app/job/AllJobScheduler.java

@@ -98,8 +98,8 @@ public class AllJobScheduler implements LaJobScheduler {
 
 
     @Override
     @Override
     public LaJobRunner createRunner() {
     public LaJobRunner createRunner() {
-        return new LaJobRunner().useAccessContext(resource -> accessContextLogic.create(resource, () -> OptionalThing.empty(),
-                () -> OptionalThing.empty(), () -> APP_TYPE));
+        return new LaJobRunner().useAccessContext(resource -> accessContextLogic.create(resource, OptionalThing::empty,
+                OptionalThing::empty, () -> APP_TYPE));
     }
     }
 
 
     public void setJobClass(final Class<? extends LaJob> jobClass) {
     public void setJobClass(final Class<? extends LaJob> jobClass) {

+ 1 - 1
src/main/java/org/codelibs/fess/app/web/admin/storage/AdminStorageAction.java

@@ -162,7 +162,7 @@ public class AdminStorageAction extends FessAdminAction {
         try (final InputStream in = uploadFile.getInputStream()) {
         try (final InputStream in = uploadFile.getInputStream()) {
             final FessConfig fessConfig = ComponentUtil.getFessConfig();
             final FessConfig fessConfig = ComponentUtil.getFessConfig();
             final MinioClient minioClient = createClient(fessConfig);
             final MinioClient minioClient = createClient(fessConfig);
-            minioClient.putObject(fessConfig.getStorageBucket(), objectName, in, new PutObjectOptions((long) uploadFile.getFileSize(), -1));
+            minioClient.putObject(fessConfig.getStorageBucket(), objectName, in, new PutObjectOptions(uploadFile.getFileSize(), -1));
         } catch (final Exception e) {
         } catch (final Exception e) {
             throw new StorageException("Failed to upload " + objectName, e);
             throw new StorageException("Failed to upload " + objectName, e);
         }
         }

+ 0 - 3
src/main/java/org/codelibs/fess/helper/IntervalControlHelper.java

@@ -19,13 +19,10 @@ import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Calendar;
 import java.util.List;
 import java.util.List;
 
 
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
 import org.codelibs.core.lang.ThreadUtil;
 import org.codelibs.core.lang.ThreadUtil;
 import org.codelibs.fess.exception.FessSystemException;
 import org.codelibs.fess.exception.FessSystemException;
 
 
 public class IntervalControlHelper {
 public class IntervalControlHelper {
-    private static final Logger logger = LogManager.getLogger(IntervalControlHelper.class);
 
 
     protected volatile boolean crawlerRunning = true;
     protected volatile boolean crawlerRunning = true;
 
 

+ 2 - 2
src/main/java/org/codelibs/fess/helper/NotificationHelper.java

@@ -39,7 +39,7 @@ public class NotificationHelper {
         sendToGoogleChat(cardView, discloser);
         sendToGoogleChat(cardView, discloser);
     }
     }
 
 
-    protected void sendToSlack(CardView cardView, SMailPostingDiscloser discloser) {
+    protected void sendToSlack(final CardView cardView, final SMailPostingDiscloser discloser) {
         // https://api.slack.com/messaging/webhooks#posting_with_webhooks
         // https://api.slack.com/messaging/webhooks#posting_with_webhooks
         final FessConfig fessConfig = ComponentUtil.getFessConfig();
         final FessConfig fessConfig = ComponentUtil.getFessConfig();
         final String slackWebhookUrls = fessConfig.getSlackWebhookUrls();
         final String slackWebhookUrls = fessConfig.getSlackWebhookUrls();
@@ -76,7 +76,7 @@ public class NotificationHelper {
         return buf.toString();
         return buf.toString();
     }
     }
 
 
-    protected void sendToGoogleChat(CardView cardView, SMailPostingDiscloser discloser) {
+    protected void sendToGoogleChat(final CardView cardView, final SMailPostingDiscloser discloser) {
         // https://developers.google.com/hangouts/chat/how-tos/webhooks
         // https://developers.google.com/hangouts/chat/how-tos/webhooks
         final FessConfig fessConfig = ComponentUtil.getFessConfig();
         final FessConfig fessConfig = ComponentUtil.getFessConfig();
         final String googleChatWebhookUrls = fessConfig.getGoogleChatWebhookUrls();
         final String googleChatWebhookUrls = fessConfig.getGoogleChatWebhookUrls();

+ 3 - 3
src/main/java/org/codelibs/fess/helper/SystemHelper.java

@@ -194,7 +194,7 @@ public class SystemHelper {
 
 
     public String getUsername() {
     public String getUsername() {
         final RequestManager requestManager = ComponentUtil.getRequestManager();
         final RequestManager requestManager = ComponentUtil.getRequestManager();
-        return requestManager.findUserBean(FessUserBean.class).map(user -> user.getUserId()).orElse(Constants.GUEST_USER);
+        return requestManager.findUserBean(FessUserBean.class).map(FessUserBean::getUserId).orElse(Constants.GUEST_USER);
     }
     }
 
 
     public Date getCurrentTime() {
     public Date getCurrentTime() {
@@ -571,7 +571,7 @@ public class SystemHelper {
                         if (logger.isDebugEnabled()) {
                         if (logger.isDebugEnabled()) {
                             logger.debug("Updated System Cpu {}%", systemCpuPercent);
                             logger.debug("Updated System Cpu {}%", systemCpuPercent);
                         }
                         }
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                         logger.warn("Failed to get SystemCpuPercent.", e);
                         logger.warn("Failed to get SystemCpuPercent.", e);
                         return 0;
                         return 0;
                     }
                     }
@@ -598,7 +598,7 @@ public class SystemHelper {
         return productVersion;
         return productVersion;
     }
     }
 
 
-    public void setSystemCpuCheckInterval(long systemCpuCheckInterval) {
+    public void setSystemCpuCheckInterval(final long systemCpuCheckInterval) {
         this.systemCpuCheckInterval = systemCpuCheckInterval;
         this.systemCpuCheckInterval = systemCpuCheckInterval;
     }
     }
 }
 }