OSDN Git Service

follow naming conventions.
authorOlyutorskii <olyutorskii@users.osdn.me>
Tue, 11 Jun 2019 13:25:46 +0000 (22:25 +0900)
committerOlyutorskii <olyutorskii@users.osdn.me>
Tue, 11 Jun 2019 13:25:46 +0000 (22:25 +0900)
config/pmd/pmdrules.xml
src/main/java/jp/sfjp/mikutoga/bin/export/BinaryExporter.java

index ccc7751..1dc0902 100644 (file)
@@ -11,7 +11,7 @@
   xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0
-  http://pmd.sourceforge.net/ruleset_2_0_0.xsd"
+  https://pmd.sourceforge.io/ruleset_2_0_0.xsd"
   name="Custom ruleset"
 >
 
         <exclude name="UnnecessaryLocalBeforeReturn" />
         <exclude name="UnnecessaryReturn" />
     </rule>
+    <rule ref="category/java/codestyle.xml/ClassNamingConventions" >
+        <properties>
+            <property name="utilityClassPattern" value="[A-Z][a-zA-Z0-9]*"/>
+        </properties>
+    </rule>
     <rule ref="category/java/codestyle.xml/ControlStatementBraces" >
         <properties>
             <property name="checkIfElseStmt" value="false"/>
             <property name="checkSingleIfStmt" value="false"/>
         </properties>
     </rule>
+    <rule ref="category/java/codestyle.xml/LongVariable" >
+        <properties>
+            <property name="minimum" value="25"/>
+        </properties>
+    </rule>
 
     <rule ref="category/java/design.xml" >
         <exclude name="AvoidThrowingNullPointerException" />
@@ -66,6 +76,7 @@
     <rule ref="category/java/multithreading.xml" />
 
     <rule ref="category/java/performance.xml" >
+        <exclude name="AvoidUsingShortType" />
         <exclude name="ConsecutiveAppendsShouldReuse" />
         <exclude name="RedundantFieldInitializer" />
     </rule>
index faced0c..63bcf7c 100644 (file)
@@ -70,8 +70,8 @@ public class BinaryExporter implements Closeable, Flushable{
 
     private final byte[] barray;
 
-    private final TextExporter texporter_w31j;
-    private final TextExporter texporter_u16le;
+    private final TextExporter texporterW31j;
+    private final TextExporter texporterU16le;
     private final ByteArrayOutputStream xos;
 
 
@@ -88,8 +88,8 @@ public class BinaryExporter implements Closeable, Flushable{
 
         this.barray = new byte[BUFSZ_PRIM];
 
-        this.texporter_w31j  = new TextExporter(CS_WIN31J);
-        this.texporter_u16le = new TextExporter(CS_UTF16LE);
+        this.texporterW31j  = new TextExporter(CS_WIN31J);
+        this.texporterU16le = new TextExporter(CS_UTF16LE);
         this.xos = new ByteArrayOutputStream();
 
         return;
@@ -314,7 +314,7 @@ public class BinaryExporter implements Closeable, Flushable{
         int encodedSize;
         try{
             encodedSize =
-                    this.texporter_w31j.encodeToByteStream(text, this.xos);
+                    this.texporterW31j.encodeToByteStream(text, this.xos);
         }catch(CharacterCodingException e){
             throw new IllegalTextExportException(ERRMSG_ILLENC, e);
         }
@@ -356,7 +356,7 @@ public class BinaryExporter implements Closeable, Flushable{
         int encodedSize;
         try{
             encodedSize =
-                    this.texporter_u16le.encodeToByteStream(text, this.xos);
+                    this.texporterU16le.encodeToByteStream(text, this.xos);
         }catch(CharacterCodingException e){
             assert false;  // これはない
             throw new IllegalTextExportException(ERRMSG_ILLENC, e);