Shinsuke Sugaya 11 lat temu
rodzic
commit
5b9715065b

+ 5 - 3
src/main/java/jp/sf/fess/action/admin/LogAction.java

@@ -83,7 +83,8 @@ public class LogAction implements Serializable {
                         .getBytes(Constants.UTF_8)), Constants.UTF_8);
             } catch (final UnsupportedEncodingException e1) {
                 fileName = new String(Base64.decodeBase64(logForm.logFileName
-                        .getBytes()), Charset.defaultCharset());
+                        .getBytes(Charset.defaultCharset())),
+                        Charset.defaultCharset());
             }
             final File logFile = new File(parentDir, fileName);
             if (logFile.isFile()) {
@@ -155,8 +156,9 @@ public class LogAction implements Serializable {
                             Constants.UTF_8)), "UTF-8"));
         } catch (final UnsupportedEncodingException e) {
             map.put("logFileName",
-                    new String(Base64.encodeBase64(file.getName().getBytes()),
-                            Charset.defaultCharset()));
+                    new String(Base64.encodeBase64(file.getName().getBytes(
+                            Charset.defaultCharset())), Charset
+                            .defaultCharset()));
         }
         map.put("lastModified", new Date(file.lastModified()));
         return map;

+ 1 - 1
src/main/java/jp/sf/fess/api/WebApiResponse.java

@@ -33,7 +33,7 @@ public class WebApiResponse extends HttpServletResponseWrapper {
     @Override
     public PrintWriter getWriter() throws IOException {
         // dummy stream
-        return new PrintWriter(new ByteArrayOutputStream());
+        return new PrintWriter(new ByteArrayOutputStream()); // NOSONAR
     }
 
 }

+ 5 - 0
src/main/java/jp/sf/fess/dict/DictionaryItem.java

@@ -1,5 +1,10 @@
 package jp.sf.fess.dict;
 
 public abstract class DictionaryItem {
+    protected long id;
+
+    public long getId() {
+        return id;
+    }
 
 }

+ 0 - 6
src/main/java/jp/sf/fess/dict/synonym/SynonymItem.java

@@ -15,8 +15,6 @@ public class SynonymItem extends DictionaryItem {
 
     private String[] newOutputs;
 
-    private final long id;
-
     public SynonymItem(final long id, final String[] inputs,
             final String[] outputs) {
         this.id = id;
@@ -34,10 +32,6 @@ public class SynonymItem extends DictionaryItem {
         }
     }
 
-    public long getId() {
-        return id;
-    }
-
     public String[] getNewInputs() {
         return newInputs;
     }

+ 1 - 2
src/main/java/jp/sf/fess/helper/SearchLogHelper.java

@@ -86,8 +86,7 @@ public abstract class SearchLogHelper {
                 .getComponent(ClickLogBhv.class);
         final ClickLogCB cb = new ClickLogCB();
         cb.query().setUrl_Equal(url);
-        final int count = clickLogBhv.selectCount(cb);
-        return count;
+        return clickLogBhv.selectCount(cb);
     }
 
     public long getFavoriteCount(final String url) {