directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1701512 - in /directory/apacheds/trunk/protocol-dns/src: checkstyle/ main/java/org/apache/directory/server/dns/io/encoder/ main/java/org/apache/directory/server/dns/protocol/ main/java/org/apache/directory/server/dns/service/ main/java/org...
Date Sun, 06 Sep 2015 18:57:47 GMT
Author: seelmann
Date: Sun Sep  6 18:57:47 2015
New Revision: 1701512

URL: http://svn.apache.org/r1701512
Log:
Fix checkstyle issues

Added:
    directory/apacheds/trunk/protocol-dns/src/checkstyle/
    directory/apacheds/trunk/protocol-dns/src/checkstyle/suppressions.xml   (with props)
Modified:
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolTcpCodecFactory.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolUdpCodecFactory.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/DomainNameService.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/MonitorContext.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/DnsAttribute.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetFlatRecord.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetRecords.java

Added: directory/apacheds/trunk/protocol-dns/src/checkstyle/suppressions.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/checkstyle/suppressions.xml?rev=1701512&view=auto
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/checkstyle/suppressions.xml (added)
+++ directory/apacheds/trunk/protocol-dns/src/checkstyle/suppressions.xml Sun Sep  6 18:57:47
2015
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<!DOCTYPE suppressions PUBLIC
+    "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+    "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+
+<suppressions>
+    <!-- Large files -->
+    <suppress files="org.apache.directory.server.dns.messages.DnsMessage" checks="ParameterNumber"/>
+</suppressions>

Propchange: directory/apacheds/trunk/protocol-dns/src/checkstyle/suppressions.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/apacheds/trunk/protocol-dns/src/checkstyle/suppressions.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java?rev=1701512&r1=1701511&r2=1701512&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java
Sun Sep  6 18:57:47 2015
@@ -52,7 +52,7 @@ import org.slf4j.LoggerFactory;
 public class DnsMessageEncoder
 {
     /** the log for this class */
-    private static final Logger log = LoggerFactory.getLogger( DnsMessageEncoder.class );
+    private static final Logger LOG = LoggerFactory.getLogger( DnsMessageEncoder.class );
 
     /**
      * A Hashed Adapter mapping record types to their encoders.
@@ -152,7 +152,7 @@ public class DnsMessageEncoder
             }
             catch ( IOException ioe )
             {
-                log.error( ioe.getLocalizedMessage(), ioe );
+                LOG.error( ioe.getLocalizedMessage(), ioe );
             }
         }
     }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoder.java?rev=1701512&r1=1701511&r2=1701512&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoder.java
Sun Sep  6 18:57:47 2015
@@ -49,7 +49,7 @@ public class QuestionRecordEncoder
 
     private void encodeDomainName( IoBuffer byteBuffer, String domainName )
     {
-        if ( ! Strings.isEmpty( domainName ) )
+        if ( !Strings.isEmpty( domainName ) )
         {
             String[] labels = domainName.split( "\\." );
         

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java?rev=1701512&r1=1701511&r2=1701512&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
Sun Sep  6 18:57:47 2015
@@ -81,7 +81,7 @@ public abstract class ResourceRecordEnco
      */
     protected void putDomainName( IoBuffer byteBuffer, String domainName )
     {
-        if ( ! Strings.isEmpty( domainName ) )
+        if ( !Strings.isEmpty( domainName ) )
         {
             String[] labels = domainName.split( "\\." );
         

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolTcpCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolTcpCodecFactory.java?rev=1701512&r1=1701511&r2=1701512&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolTcpCodecFactory.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolTcpCodecFactory.java
Sun Sep  6 18:57:47 2015
@@ -30,7 +30,7 @@ import org.apache.mina.filter.codec.Prot
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DnsProtocolTcpCodecFactory implements ProtocolCodecFactory
+public final class DnsProtocolTcpCodecFactory implements ProtocolCodecFactory
 {
     private static final DnsProtocolTcpCodecFactory INSTANCE = new DnsProtocolTcpCodecFactory();
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolUdpCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolUdpCodecFactory.java?rev=1701512&r1=1701511&r2=1701512&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolUdpCodecFactory.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolUdpCodecFactory.java
Sun Sep  6 18:57:47 2015
@@ -30,7 +30,7 @@ import org.apache.mina.filter.codec.Prot
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DnsProtocolUdpCodecFactory implements ProtocolCodecFactory
+public final class DnsProtocolUdpCodecFactory implements ProtocolCodecFactory
 {
     private static final DnsProtocolUdpCodecFactory INSTANCE = new DnsProtocolUdpCodecFactory();
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/DomainNameService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/DomainNameService.java?rev=1701512&r1=1701511&r2=1701512&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/DomainNameService.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/DomainNameService.java
Sun Sep  6 18:57:47 2015
@@ -44,12 +44,17 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DomainNameService
+public final class DomainNameService
 {
     /** the log for this class */
     private static final Logger LOG = LoggerFactory.getLogger( DomainNameService.class );
 
 
+    private DomainNameService()
+    {
+    }
+
+
     /**
      * Creates a new instance of DomainNameService.
      */

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/MonitorContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/MonitorContext.java?rev=1701512&r1=1701511&r2=1701512&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/MonitorContext.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/MonitorContext.java
Sun Sep  6 18:57:47 2015
@@ -37,14 +37,14 @@ import org.slf4j.LoggerFactory;
 public class MonitorContext implements IoHandlerCommand
 {
     /** the log for this class */
-    private static final Logger log = LoggerFactory.getLogger( MonitorContext.class );
+    private static final Logger LOG = LoggerFactory.getLogger( MonitorContext.class );
 
     private String contextKey = "context";
 
 
     public void execute( NextCommand next, IoSession session, Object message ) throws Exception
     {
-        if ( log.isDebugEnabled() )
+        if ( LOG.isDebugEnabled() )
         {
             try
             {
@@ -57,12 +57,12 @@ public class MonitorContext implements I
                 sb.append( "\n\t" + "store:                     " + store );
                 sb.append( "\n\t" + "records:                   " + records );
 
-                log.debug( sb.toString() );
+                LOG.debug( sb.toString() );
             }
             catch ( Exception e )
             {
                 // This is a monitor.  No exceptions should bubble up.
-                log.error( I18n.err( I18n.ERR_154 ), e );
+                LOG.error( I18n.err( I18n.ERR_154 ), e );
             }
         }
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/DnsAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/DnsAttribute.java?rev=1701512&r1=1701511&r2=1701512&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/DnsAttribute.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/DnsAttribute.java
Sun Sep  6 18:57:47 2015
@@ -25,8 +25,12 @@ package org.apache.directory.server.dns.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DnsAttribute
+public final class DnsAttribute
 {
+    private DnsAttribute()
+    {
+    }
+
     /**
      * Apache DNS Schema Attributes
      */

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetFlatRecord.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetFlatRecord.java?rev=1701512&r1=1701511&r2=1701512&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetFlatRecord.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetFlatRecord.java
Sun Sep  6 18:57:47 2015
@@ -114,12 +114,10 @@ public class GetFlatRecord implements Dn
     {
         ResourceRecordModifier modifier = new ResourceRecordModifier();
 
-        Attribute attr;
-
-        String dnsName = ( attr = attrs.get( DnsAttribute.NAME ) ) != null ? ( String ) attr.get()
: null;
-        String dnsType = ( attr = attrs.get( DnsAttribute.TYPE ) ) != null ? ( String ) attr.get()
: null;
-        String dnsClass = ( attr = attrs.get( DnsAttribute.CLASS ) ) != null ? ( String )
attr.get() : null;
-        String dnsTtl = ( attr = attrs.get( DnsAttribute.TTL ) ) != null ? ( String ) attr.get()
: null;
+        String dnsName = getAttrOrNull( attrs, DnsAttribute.NAME );
+        String dnsType = getAttrOrNull( attrs, DnsAttribute.TYPE );
+        String dnsClass = getAttrOrNull( attrs, DnsAttribute.CLASS );
+        String dnsTtl = getAttrOrNull( attrs, DnsAttribute.TTL );
 
         modifier.setDnsName( dnsName );
         modifier.setDnsType( RecordType.valueOf( dnsType ) );
@@ -136,4 +134,11 @@ public class GetFlatRecord implements Dn
 
         return modifier.getEntry();
     }
+
+
+    private String getAttrOrNull( Attributes attrs, String name ) throws NamingException
+    {
+        Attribute attr = attrs.get( name );
+        return attr != null ? ( String ) attr.get() : null;
+    }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetRecords.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetRecords.java?rev=1701512&r1=1701511&r2=1701512&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetRecords.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetRecords.java
Sun Sep  6 18:57:47 2015
@@ -157,8 +157,8 @@ public class GetRecords implements DnsOp
      */
     private ResourceRecord getRecord( Attributes attrs, Name relative ) throws NamingException
     {
-        String SOA_MINIMUM = "86400";
-        String SOA_CLASS = "IN";
+        String soaMinimum = "86400";
+        String soaClass = "IN";
 
         ResourceRecordModifier modifier = new ResourceRecordModifier();
 
@@ -193,11 +193,13 @@ public class GetRecords implements DnsOp
         }
 
         // class defaults to SOA CLASS
-        String dnsClass = ( attr = attrs.get( DnsAttribute.CLASS ) ) != null ? ( String )
attr.get() : SOA_CLASS;
+        attr = attrs.get( DnsAttribute.CLASS );
+        String dnsClass = attr != null ? ( String ) attr.get() : soaClass;
         modifier.setDnsClass( RecordClass.valueOf( dnsClass ) );
 
         // ttl defaults to SOA MINIMUM
-        String dnsTtl = ( attr = attrs.get( DnsAttribute.TTL ) ) != null ? ( String ) attr.get()
: SOA_MINIMUM;
+        attr = attrs.get( DnsAttribute.TTL );
+        String dnsTtl = attr != null ? ( String ) attr.get() : soaMinimum;
         modifier.setDnsTtl( Integer.parseInt( dnsTtl ) );
 
         NamingEnumeration<String> ids = attrs.getIDs();



Mime
View raw message