From 61b9eb1be03fc03a9f4bb0013a08ff44a1059503 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 20 Apr 2016 14:25:46 +0000
Subject: [PATCH] opendj-server-legacy: added @Override + Autorefactor'ed comments

---
 opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TimeOfDay.java |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TimeOfDay.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TimeOfDay.java
index 5999d3a..af7a0a3 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TimeOfDay.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TimeOfDay.java
@@ -12,24 +12,20 @@
  * information: "Portions Copyright [year] [name of copyright owner]".
  *
  * Copyright 2008 Sun Microsystems, Inc.
- * Portions Copyright 2013-2015 ForgeRock AS.
+ * Portions Copyright 2013-2016 ForgeRock AS.
  */
 package org.opends.server.authorization.dseecompat;
-import org.forgerock.i18n.LocalizableMessage;
-
 import static org.opends.messages.AccessControlMessages.*;
-import org.opends.server.util.TimeThread;
+
 import java.util.regex.Pattern;
 
-/**
- * This class represents the timeofday keyword in a bind rule.
- */
-public class TimeOfDay implements KeywordBindRule {
+import org.forgerock.i18n.LocalizableMessage;
+import org.opends.server.util.TimeThread;
 
-    /**
-     * Regular expression matching a valid timeofday rule value (0-2359).
-     */
-    private static final String timeofdayRegex = "[0-2]\\d[0-5]\\d";
+/** This class represents the timeofday keyword in a bind rule. */
+public class TimeOfDay implements KeywordBindRule {
+    /** Regular expression matching a valid timeofday rule value (0-2359). */
+    private static final Pattern timeofdayRegex = Pattern.compile("[0-2]\\d[0-5]\\d");
 
     /** Enumeration representing the bind rule operation type. */
     private EnumBindRuleType type;
@@ -57,7 +53,7 @@
     public static TimeOfDay decode(String expr,  EnumBindRuleType type)
     throws AciException  {
         int valueAsInt = 0;
-        if (!Pattern.matches(timeofdayRegex, expr))
+        if (!timeofdayRegex.matcher(expr).matches())
         {
             LocalizableMessage message = WARN_ACI_SYNTAX_INVALID_TIMEOFDAY.get(expr);
             throw new AciException(message);
@@ -85,6 +81,7 @@
      * @return  An enumeration result representing the result of the
      * evaluation.
      */
+    @Override
     public EnumEvalResult evaluate(AciEvalContext evalCtx) {
         EnumEvalResult matched=EnumEvalResult.FALSE;
 
@@ -129,7 +126,6 @@
         return matched.getRet(type, false);
     }
 
-    /** {@inheritDoc} */
     @Override
     public String toString()
     {
@@ -138,11 +134,9 @@
         return sb.toString();
     }
 
-    /** {@inheritDoc} */
     @Override
     public final void toString(StringBuilder buffer)
     {
         buffer.append(super.toString());
     }
-
 }

--
Gitblit v1.10.0