From 76cefb06b3a6dda586c3691765d39f1b5c800fc8 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 26 Feb 2015 15:25:33 +0000
Subject: [PATCH] AutoRefactor: Fix modifiers usage

---
 opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java                        |    2 
 opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java                    |   21 ++++------
 opendj-server-legacy/src/test/java/org/opends/server/replication/server/MonitorTest.java       |    4 +-
 opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java              |    4 +-
 opendj-server-legacy/src/test/java/org/opends/server/plugins/DelayPreOpPlugin.java             |    2 
 opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java     |    4 +-
 opendj-server-legacy/src/test/java/org/opends/server/tools/UpgradeTestCase.java                |    2 
 opendj-server-legacy/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java      |    2 
 opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTestCase.java |   14 +++---
 opendj-server-legacy/src/test/java/org/opends/server/loggers/LoggingCategoryNamesTest.java     |    6 +-
 opendj-server-legacy/src/test/java/org/opends/server/plugins/DisconnectClientPlugin.java       |    6 +--
 opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogPublisher.java            |    7 +--
 opendj-server-legacy/src/test/java/org/opends/server/plugins/ShortCircuitPlugin.java           |    5 +-
 opendj-server-legacy/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java  |    2 
 opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java      |   13 +++---
 15 files changed, 43 insertions(+), 51 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogPublisher.java b/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogPublisher.java
index fcbe1d6..9b3e13c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogPublisher.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/loggers/DebugLogPublisher.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2009 Sun Microsystems, Inc.
- *      Portions Copyright 2012-2014 ForgeRock AS.
+ *      Portions Copyright 2012-2015 ForgeRock AS.
  */
 package org.opends.server.loggers;
 
@@ -282,8 +282,7 @@
    * @param  className  The class name.
    * @param  settings   The trace settings for the class.
    */
-  private synchronized final void setClassSettings(String className,
-                                       TraceSettings settings)
+  private final synchronized void setClassSettings(String className, TraceSettings settings)
   {
     if (classTraceSettings == null)
     {
@@ -301,7 +300,7 @@
    * @param  methodName  The method name.
    * @param  settings    The trace settings for the method.
    */
-  private synchronized final void setMethodSettings(String className,
+  private final synchronized void setMethodSettings(String className,
       String methodName, TraceSettings settings)
   {
     if (methodTraceSettings == null) {
diff --git a/opendj-server-legacy/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java b/opendj-server-legacy/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java
index fa34698..7a57a65 100644
--- a/opendj-server-legacy/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java
+++ b/opendj-server-legacy/src/test/java/org/forgerock/opendj/config/server/AdminTestCaseUtils.java
@@ -104,7 +104,7 @@
 
 
   // Construct a dummy path.
-  private synchronized static <C extends ConfigurationClient, S extends Configuration>
+  private static synchronized <C extends ConfigurationClient, S extends Configuration>
   ManagedObjectPath<C, S> getPath(AbstractManagedObjectDefinition<C, S> d) {
     if (!isProfileRegistered) {
       LDAPProfile.Wrapper profile = new LDAPProfile.Wrapper() {
diff --git a/opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java b/opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java
index 7df91f3..6a08131 100644
--- a/opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java
+++ b/opendj-server-legacy/src/test/java/org/opends/quicksetup/TestUtilities.java
@@ -55,7 +55,7 @@
 
   private static boolean initialized;
 
-  static public void initServer()
+  public static void initServer()
           throws IOException, ApplicationException, InterruptedException {
     File qsServerRoot = getQuickSetupTestServerRootDir();
     if (!initialized) {
@@ -70,22 +70,19 @@
     }
   }
 
-  static public Installation getInstallation() {
+  public static Installation getInstallation() {
     return new Installation(getQuickSetupTestServerRootDir(),getQuickSetupTestServerRootDir());
   }
 
-  static private void setupServer() throws IOException, InterruptedException {
+  private static void setupServer() throws IOException, InterruptedException {
     int[] ports = TestCaseUtils.findFreePorts(2);
     ldapPort = ports[0];
     jmxPort = ports[1];
 
     List<String> args = new ArrayList<String>();
     File root = getQuickSetupTestServerRootDir();
-    if (OperatingSystem.isUnixBased()) {
-      args.add(new File(root, "setup").getPath());
-    } else {
-      args.add(new File(root, "setup.bat").getPath());
-    }
+    String filename = OperatingSystem.isUnixBased() ? "setup" : "setup.bat";
+    args.add(new File(root, filename).getPath());
     args.add("--cli");
     args.add("-n");
     args.add("-p");
@@ -112,12 +109,12 @@
     }
   }
 
-  static public void stopServer() throws ApplicationException {
+  public static void stopServer() throws ApplicationException {
     ServerController controller = new ServerController(getInstallation());
     controller.stopServer();
   }
 
-  static public File getInstallPackageFile() throws FileNotFoundException {
+  public static File getInstallPackageFile() throws FileNotFoundException {
     File installPackageFile = null;
     String buildRoot = System.getProperty(PROPERTY_BUILD_ROOT);
     File   buildDir  = new File(buildRoot, "build");
@@ -140,14 +137,14 @@
     return installPackageFile;
   }
 
-  static public File getQuickSetupTestWorkspace() {
+  public static File getQuickSetupTestWorkspace() {
     String buildRoot = System.getProperty(PROPERTY_BUILD_ROOT);
     File   buildDir  = new File(buildRoot, "build");
     File   unitRootDir  = new File(buildDir, "unit-tests");
     return new File(unitRootDir, "quicksetup");
   }
 
-  static public File getQuickSetupTestServerRootDir() {
+  public static File getQuickSetupTestServerRootDir() {
     return new File(getQuickSetupTestWorkspace(), "OpenDS");
   }
 }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java
index efef421..de34a3b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/TestCfg.java
@@ -89,7 +89,7 @@
    * @throws Exception
    *           If an unexpected error occurred.
    */
-  public synchronized static void setUp() throws Exception {
+  public static synchronized void setUp() throws Exception {
     if (TEST_PARENT_OCD == null) {
       String ocd = "( 1.3.6.1.4.1.26027.1.2.4455114401 "
           + "NAME 'ds-cfg-test-parent-dummy' "
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java b/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java
index 0a49c7e..7f6f13f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java
@@ -108,7 +108,7 @@
 
 
   // Construct a dummy path.
-  private synchronized static <C extends ConfigurationClient, S extends Configuration>
+  private static synchronized <C extends ConfigurationClient, S extends Configuration>
   ManagedObjectPath<C, S> getPath(AbstractManagedObjectDefinition<C, S> d) {
     if (!isProfileRegistered) {
       LDAPProfile.Wrapper profile = new LDAPProfile.Wrapper() {
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTestCase.java
index 2518a83..5c6ae62 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTestCase.java
@@ -124,16 +124,16 @@
           "ldap://kansashost/OU=People,O=Kansas,C=US";
   //GLOBAL ACIs
 
-  protected final static String G_READ_ACI =
+  protected static final String G_READ_ACI =
           "(targetattr!=\"userPassword||authPassword\")" +
                   "(version 3.0; acl \"Anonymous read access\";" +
                   "allow (read,search,compare) userdn=\"ldap:///anyone\";)";
 
-  protected final static String G_SELF_MOD =
+  protected static final String G_SELF_MOD =
           "(targetattr=\"*\")(version 3.0; acl \"Self entry modification\";" +
                   "allow (write) userdn=\"ldap:///self\";)";
 
-  protected final static String G_SCHEMA =
+  protected static final String G_SCHEMA =
           "(target=\"ldap:///cn=schema\")(targetscope=\"base\")" +
           "(targetattr=\"attributeTypes||dITContentRules||dITStructureRules||" +
                   "ldapSyntaxes||matchingRules||matchingRuleUse||nameForms||" +
@@ -141,7 +141,7 @@
           "(version 3.0; acl \"User-Visible Schema Operational Attributes\";" +
                   "allow (read,search,compare) userdn=\"ldap:///anyone\";)";
 
-  protected final static String G_DSE =
+  protected static final String G_DSE =
           "(target=\"ldap:///\")(targetscope=\"base\")" +
                "(targetattr=\"namingContexts||supportedAuthPasswordSchemes||" +
                   "supportedControl||supportedExtension||supportedFeatures||" +
@@ -149,18 +149,18 @@
         "(version 3.0; acl \"User-Visible Root DSE Operational Attributes\"; " +
                   "allow (read,search,compare) userdn=\"ldap:///anyone\";)";
 
-  protected final static String G_USER_OPS =
+  protected static final String G_USER_OPS =
           "(targetattr=\"createTimestamp||creatorsName||modifiersName||" +
                   "modifyTimestamp||entryDN||entryUUID||subschemaSubentry\")" +
                  "(version 3.0; acl \"User-Visible Operational Attributes\"; " +
                   "allow (read,search,compare) userdn=\"ldap:///anyone\";)";
 
-  protected final static String G_CONTROL =
+  protected static final String G_CONTROL =
           "(targetcontrol = \"*\")" +
           "(version 3.0; acl \"Anonymous control access\"; " +
                   "allow (read) userdn=\"ldap:///anyone\";)";
 
-  protected final static String E_EXTEND_OP =
+  protected static final String E_EXTEND_OP =
           "(extop = \"*\")" +
           "(version 3.0; acl \"Anonymous extend op access\"; " +
                   "allow (read) userdn=\"ldap:///anyone\";)";
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/loggers/LoggingCategoryNamesTest.java b/opendj-server-legacy/src/test/java/org/opends/server/loggers/LoggingCategoryNamesTest.java
index 30269a2..cd0355c 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/loggers/LoggingCategoryNamesTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/loggers/LoggingCategoryNamesTest.java
@@ -21,7 +21,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2014 ForgeRock AS.
+ *      Copyright 2014-2015 ForgeRock AS.
  */
 package org.opends.server.loggers;
 
@@ -35,8 +35,8 @@
 @SuppressWarnings("javadoc")
 public class LoggingCategoryNamesTest extends DirectoryServerTestCase
 {
-  private final static String CORE_PACKAGE = DirectoryServer.class.getPackage().getName();
-  private final static String CORE_PACKAGE_NAME = "CORE";
+  private static final String CORE_PACKAGE = DirectoryServer.class.getPackage().getName();
+  private static final String CORE_PACKAGE_NAME = "CORE";
 
   @DataProvider
   public Object[][] matchingNames()
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/DelayPreOpPlugin.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/DelayPreOpPlugin.java
index bbf02b4..f856db6 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/DelayPreOpPlugin.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/DelayPreOpPlugin.java
@@ -74,7 +74,7 @@
     /**
      * ControlDecoder implementation to decode this control from a ByteString.
      */
-    private final static class Decoder
+    private static final class Decoder
         implements ControlDecoder<DelayRequestControl>
     {
       /**
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/DisconnectClientPlugin.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/DisconnectClientPlugin.java
index 9d34900..1ccf3a0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/DisconnectClientPlugin.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/DisconnectClientPlugin.java
@@ -87,16 +87,14 @@
     /**
      * ControlDecoder implementation to decode this control from a ByteString.
      */
-    private final static class Decoder
+    private static final class Decoder
         implements ControlDecoder<DisconnectClientControl>
     {
       /**
        * {@inheritDoc}
        */
       @Override
-      public DisconnectClientControl decode(boolean isCritical,
-                                            ByteString value)
-          throws DirectoryException
+      public DisconnectClientControl decode(boolean isCritical, ByteString value) throws DirectoryException
       {
         return new DisconnectClientControl(isCritical, value.toString());
       }
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/ShortCircuitPlugin.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/ShortCircuitPlugin.java
index e14e5b7..2261cb5 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/ShortCircuitPlugin.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/ShortCircuitPlugin.java
@@ -77,15 +77,14 @@
     /**
      * ControlDecoder implementation to decode this control from a ByteString.
      */
-    private final static class Decoder
+    private static final class Decoder
         implements ControlDecoder<ShortCircuitRequestControl>
     {
       /**
        * {@inheritDoc}
        */
       @Override
-      public ShortCircuitRequestControl decode(boolean isCritical,
-                                               ByteString value)
+      public ShortCircuitRequestControl decode(boolean isCritical, ByteString value)
           throws DirectoryException
       {
         ASN1Reader reader = ASN1.getReader(value);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
index 31b8753..be90671 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2010 Sun Microsystems, Inc.
- *      Portions Copyright 2011-2014 ForgeRock AS
+ *      Portions Copyright 2011-2015 ForgeRock AS
  */
 package org.opends.server.replication;
 
@@ -193,20 +193,19 @@
    * @param baseDN The baseDN for which we want the generationId
    * @return The value of the generationId.
    */
-  static protected long getGenerationId(DN baseDN)
+  protected static long getGenerationId(DN baseDN)
   {
-    // This is the value of the generationId computed by the server when the
-    // test suffix (o=test) has only the root entry created.
-    long genId = TEST_DN_WITH_ROOT_ENTRY_GENID;
     try
     {
       LDAPReplicationDomain replDomain = LDAPReplicationDomain.retrievesReplicationDomain(baseDN);
-      genId = replDomain.getGenerationID();
+      return replDomain.getGenerationID();
     }
     catch(Exception e) {
       logger.traceException(e);
     }
-    return genId;
+    // This is the value of the generationId computed by the server when the
+    // test suffix (o=test) has only the root entry created.
+    return TEST_DN_WITH_ROOT_ENTRY_GENID;
   }
 
   /**
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/MonitorTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/MonitorTest.java
index 1404da9..7bdc071 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/server/MonitorTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/server/MonitorTest.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2008-2010 Sun Microsystems, Inc.
- *      Portions Copyright 2011-2014 ForgeRock AS
+ *      Portions Copyright 2011-2015 ForgeRock AS
  */
 package org.opends.server.replication.server;
 
@@ -263,7 +263,7 @@
         + "userPassword: password\n" + "initials: AA\n";
   }
 
-  static private ReplicationMsg createAddMsg(CSN csn) throws Exception
+  private static ReplicationMsg createAddMsg(CSN csn) throws Exception
   {
     Entry personWithUUIDEntry = null;
     String user1entryUUID;
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java
index a8b151e..31746d3 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java
@@ -66,8 +66,8 @@
   private DN user5;
   private DN user6;
 
-  private final static String TIME_ATTR = "test-time";
-  private final static String DATE_ATTR = "test-date";
+  private static final String TIME_ATTR = "test-time";
+  private static final String DATE_ATTR = "test-date";
 
 
   /**
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/UpgradeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/UpgradeTestCase.java
index 55c6876..58ef2c7 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/UpgradeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/UpgradeTestCase.java
@@ -49,7 +49,7 @@
 @SuppressWarnings("javadoc")
 public class UpgradeTestCase extends ToolsTestCase
 {
-  private final static String configFilePath = DirectoryServer.getInstanceRoot()
+  private static final String configFilePath = DirectoryServer.getInstanceRoot()
       + File.separator + "config" + File.separator + "config.ldif";
 
   /**
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java b/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java
index b278826..18d51ec 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/SearchFilterTests.java
@@ -23,7 +23,7 @@
  *
  *      Copyright 2008 Sun Microsystems, Inc.
  *      Portions Copyright 2013-2014 Manuel Gaupp
- *      Portions Copyright 2014 ForgeRock AS
+ *      Portions Copyright 2014-2015 ForgeRock AS
  */
 package org.opends.server.types;
 
@@ -457,7 +457,7 @@
   ////////////////////////////////////////////////////////////////////////////
 
 
-  private static final String makeSimpleLdif(String givenname, String sn) {
+  private static String makeSimpleLdif(String givenname, String sn) {
     String cn = givenname + " " + sn;
     return TestCaseUtils.makeLdif(
           "dn: cn=" + cn + ",dc=example,dc=com",

--
Gitblit v1.10.0