From 64721a895973f935c1adb975247770f402a88fdf Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 25 Apr 2016 15:10:24 +0000
Subject: [PATCH] ACI UCDetector and AutoRefactor code cleanup
---
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/Target.java | 36 ++++++++++++------------------------
1 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/Target.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/Target.java
index 515b66b..243d881 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/Target.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/Target.java
@@ -26,31 +26,17 @@
import static org.opends.messages.AccessControlMessages.*;
import static org.opends.server.authorization.dseecompat.Aci.*;
-/**
- * A class representing an ACI target keyword.
- */
+/** A class representing an ACI target keyword. */
public class Target
{
- /**
- * Enumeration representing the target operator.
- */
- private EnumTargetOperator operator = EnumTargetOperator.EQUALITY;
-
- /**
- * True if the URL contained a DN wild-card pattern.
- */
- private boolean isPattern;
-
- /**
- * The target DN from the URL or null if it was a wild-card pattern.
- */
- private DN urlDN;
-
- /**
- * The pattern matcher for a wild-card pattern or null if the URL
- * contained an ordinary DN.
- */
- private PatternDN patternDN;
+ /** Enumeration representing the target operator. */
+ private final EnumTargetOperator operator;
+ /** True if the URL contained a DN wild-card pattern. */
+ private final boolean isPattern;
+ /** The target DN from the URL or null if it was a wild-card pattern. */
+ private final DN urlDN;
+ /** The pattern matcher for a wild-card pattern or null if the URL contained an ordinary DN. */
+ private final PatternDN patternDN;
/*
* TODO Save aciDN parameter and use it in matchesPattern re-write.
@@ -59,7 +45,6 @@
* it can be used in the matchesPattern() method? The DN should only be
* considered a potential match if it is at or below the entry containing
* the ACI.
- *
*/
/**
* This constructor parses the target string.
@@ -80,7 +65,10 @@
if (targetURL.getRawBaseDN().contains("*")) {
this.isPattern=true;
patternDN = PatternDN.decodeSuffix(targetURL.getRawBaseDN());
+ urlDN = null;
} else {
+ this.isPattern = false;
+ patternDN = null;
urlDN=targetURL.getBaseDN();
if(!urlDN.isSubordinateOrEqualTo(aciDN)) {
throw new AciException(WARN_ACI_SYNTAX_TARGET_DN_NOT_DESCENDENTOF.get(urlDN, aciDN));
--
Gitblit v1.10.0