[jboss-cvs] JBossAS SVN: r82013 - in projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml: combine and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 3 13:11:11 EST 2008
Author: mmoyses
Date: 2008-12-03 13:11:11 -0500 (Wed, 03 Dec 2008)
New Revision: 82013
Modified:
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/AnyURIAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/Base64BinaryAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/BooleanAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DNSNameAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DateAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DateTimeAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DayTimeDurationAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DoubleAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/HexBinaryAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/IPAddressAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/IntegerAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/RFC822NameAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/StringAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/TimeAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/X500NameAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/YearMonthDurationAttribute.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/DenyOverridesPolicyAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/DenyOverridesRuleAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/FirstApplicablePolicyAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/FirstApplicableRuleAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OnlyOneApplicablePolicyAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedDenyOverridesPolicyAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedDenyOverridesRuleAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedPermitOverridesPolicyAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedPermitOverridesRuleAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/PermitOverridesPolicyAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/PermitOverridesRuleAlg.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/AddFunction.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/HigherOrderFunction.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/MapFunction.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/ctx/Subject.java
projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/finder/AttributeFinder.java
Log:
SECURITY-335: synchronizing with sun xacml
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/AnyURIAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/AnyURIAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/AnyURIAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -59,28 +59,8 @@
"http://www.w3.org/2001/XMLSchema#anyURI";
//URI version of name for this type
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
- // RuntimeException that wraps an Exception thrown during the
- // creation of identifierURI, null if none
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
// the URI value that this class represents
private URI value;
@@ -93,10 +73,6 @@
public AnyURIAttribute(URI value) {
super(identifierURI);
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
this.value = value;
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/Base64BinaryAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/Base64BinaryAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/Base64BinaryAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -65,37 +65,10 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* The actual binary value that this object represents.
*/
private byte [] value;
@@ -115,10 +88,6 @@
public Base64BinaryAttribute(byte [] value) {
super(identifierURI);
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
// This will throw a NullPointerException if value == null.
// That's what we want in that case.
this.value = (byte []) value.clone();
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/BooleanAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/BooleanAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/BooleanAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -63,53 +63,22 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
* Single instance of BooleanAttribute that represents true.
* Initialized by the static initializer below.
*/
- private static BooleanAttribute trueInstance;
+ private static BooleanAttribute trueInstance = new BooleanAttribute(true);
/**
* Single instance of BooleanAttribute that represents false.
* Initialized by the static initializer below.
*/
- private static BooleanAttribute falseInstance;
+ private static BooleanAttribute falseInstance = new BooleanAttribute(false);
/**
- * Static initializer that initializes many static fields.
- * <p>
- * It is possible identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- trueInstance = new BooleanAttribute(true);
- falseInstance = new BooleanAttribute(false);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* The actual boolean value that this object represents.
*/
private boolean value;
@@ -155,10 +124,6 @@
public static BooleanAttribute getInstance(String value)
throws ParsingException
{
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
if (value.equals("true"))
return trueInstance;
if (value.equals("false"))
@@ -177,10 +142,6 @@
*/
public static BooleanAttribute getInstance(boolean value) {
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
if (value)
return trueInstance;
else
@@ -196,10 +157,6 @@
*/
public static BooleanAttribute getTrueInstance() {
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
return trueInstance;
}
@@ -212,10 +169,6 @@
*/
public static BooleanAttribute getFalseInstance() {
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
return falseInstance;
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DNSNameAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DNSNameAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DNSNameAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -61,36 +61,9 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
- /**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
// the required hostname
private String hostname;
@@ -126,11 +99,8 @@
{
super(identifierURI);
- // shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
// verify that the hostname is valid before we store it
+ // FIXME: What the heck does the System.out do here?
if (! isValidHostName(hostname))
System.out.println("FIXME: throw error about bad hostname");
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DateAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DateAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DateAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -71,39 +71,12 @@
/**
* URI version of name for this type
* <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
- * <p>
* This object is used for synchronization whenever we need
* protection across this whole class.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* Parser for dates with no time zones
* <p>
* This field is only initialized if needed (by initParsers()).
@@ -299,10 +272,6 @@
*/
private void init(Date date, int timeZone, int defaultedTimeZone) {
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
this.value = (Date) date.clone();
this.timeZone = timeZone;
this.defaultedTimeZone = defaultedTimeZone;
@@ -413,10 +382,6 @@
if (simpleParser != null)
return;
- // Make sure that identifierURI is not null
- if (earlyException != null)
- throw earlyException;
-
// Synchronize on identifierURI while initializing parsers
// so we don't end up using a half-way initialized parser
synchronized (identifierURI) {
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DateTimeAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DateTimeAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DateTimeAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -73,39 +73,12 @@
/**
* URI version of name for this type
* <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
- * <p>
* This object is used for synchronization whenever we need
* protection across this whole class.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* Parser for dates with no time zones
* <p>
* This field is only initialized if needed (by initParsers()).
@@ -256,10 +229,6 @@
private void init(Date date, int nanoseconds, int timeZone,
int defaultedTimeZone) {
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
// Make a new Date object
this.value = (Date) date.clone();
// Combine the nanoseconds so they are between 0 and 999,999,999
@@ -417,10 +386,6 @@
if (simpleParser != null)
return;
- // Make sure that identifierURI is not null
- if (earlyException != null)
- throw earlyException;
-
// Synchronize on identifierURI while initializing parsers
// so we don't end up using a half-way initialized parser
synchronized (identifierURI) {
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DayTimeDurationAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DayTimeDurationAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DayTimeDurationAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -69,37 +69,10 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* Regular expression for dayTimeDuration (a la java.util.regex)
*/
private static final String patternString =
@@ -210,10 +183,6 @@
throws IllegalArgumentException {
super(identifierURI);
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
this.negative = negative;
this.days = days;
this.hours = hours;
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DoubleAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DoubleAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/DoubleAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -61,37 +61,10 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* The actual double value that this object represents.
*/
private double value;
@@ -105,10 +78,6 @@
public DoubleAttribute(double value) {
super(identifierURI);
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
this.value = value;
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/HexBinaryAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/HexBinaryAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/HexBinaryAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -63,37 +63,10 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* The actual binary value that this object represents.
*/
private byte [] value;
@@ -113,10 +86,6 @@
public HexBinaryAttribute(byte [] value) {
super(identifierURI);
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
// This will throw a NullPointerException if value == null.
// That's what we want in that case.
this.value = (byte []) value.clone();
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/IPAddressAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/IPAddressAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/IPAddressAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -71,36 +71,9 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
- /**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
// the required address
private InetAddress address;
@@ -122,10 +95,6 @@
PortRange range) {
super(identifierURI);
- // shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
this.address = address;
this.mask = mask;
this.range = range;
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/IntegerAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/IntegerAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/IntegerAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -60,37 +60,10 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* The actual long value that this object represents.
*/
private long value;
@@ -104,10 +77,6 @@
public IntegerAttribute(long value) {
super(identifierURI);
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
this.value = value;
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/RFC822NameAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/RFC822NameAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/RFC822NameAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -58,36 +58,9 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
- /**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
// the actual value being stored
private String value;
@@ -100,10 +73,6 @@
public RFC822NameAttribute(String value) {
super(identifierURI);
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
// check that the string is an address, ie, that it has one and only
// one '@' character in it
String [] parts = value.split("@");
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/StringAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/StringAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/StringAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -71,37 +71,10 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* The actual String value that this object represents.
*/
private String value;
@@ -115,10 +88,8 @@
public StringAttribute(String value) {
super(identifierURI);
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
+ // TODO: document why a null pointer is allowed here and not for other
+ // attributes.
if (value == null)
this.value = "";
else
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/TimeAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/TimeAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/TimeAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -68,39 +68,12 @@
/**
* URI version of name for this type
* <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
- * <p>
* This object is used for synchronization whenever we need
* protection across this whole class.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* Time zone value that indicates that the time zone was not
* specified.
*/
@@ -226,10 +199,6 @@
private void init(Date date, int nanoseconds, int timeZone,
int defaultedTimeZone) {
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
// get a temporary copy of the date
Date tmpDate = (Date)(date.clone());
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/X500NameAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/X500NameAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/X500NameAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -64,37 +64,10 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* Creates a new <code>X500NameAttribute</code> that represents the
* value supplied.
*
@@ -102,10 +75,6 @@
*/
public X500NameAttribute(X500Principal value) {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
-
this.value = value;
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/YearMonthDurationAttribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/YearMonthDurationAttribute.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/attr/YearMonthDurationAttribute.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -69,37 +69,10 @@
/**
* URI version of name for this type
- * <p>
- * This field is initialized by a static initializer so that
- * we can catch any exceptions thrown by URI(String) and
- * transform them into a RuntimeException, since this should
- * never happen but should be reported properly if it ever does.
*/
- private static URI identifierURI;
+ private static URI identifierURI = URI.create(identifier);
/**
- * RuntimeException that wraps an Exception thrown during the
- * creation of identifierURI, null if none.
- */
- private static RuntimeException earlyException;
-
- /**
- * Static initializer that initializes the identifierURI
- * class field so that we can catch any exceptions thrown
- * by URI(String) and transform them into a RuntimeException.
- * Such exceptions should never happen but should be reported
- * properly if they ever do.
- */
- static {
- try {
- identifierURI = new URI(identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
- /**
* Regular expression for yearMonthDuration (a la java.util.regex)
*/
private static final String patternString =
@@ -174,11 +147,6 @@
long months)
throws IllegalArgumentException {
super(identifierURI);
-
- // Shouldn't happen, but just in case...
- if (earlyException != null)
- throw earlyException;
-
this.negative = negative;
this.years = years;
this.months = months;
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/DenyOverridesPolicyAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/DenyOverridesPolicyAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/DenyOverridesPolicyAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -72,27 +72,13 @@
"deny-overrides";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public DenyOverridesPolicyAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
/**
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/DenyOverridesRuleAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/DenyOverridesRuleAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/DenyOverridesRuleAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -70,27 +70,13 @@
"deny-overrides";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public DenyOverridesRuleAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
/**
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/FirstApplicablePolicyAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/FirstApplicablePolicyAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/FirstApplicablePolicyAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -68,27 +68,13 @@
"first-applicable";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public FirstApplicablePolicyAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
/**
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/FirstApplicableRuleAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/FirstApplicableRuleAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/FirstApplicableRuleAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -67,27 +67,13 @@
"first-applicable";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public FirstApplicableRuleAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
/**
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OnlyOneApplicablePolicyAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OnlyOneApplicablePolicyAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OnlyOneApplicablePolicyAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -71,27 +71,13 @@
"only-one-applicable";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public OnlyOneApplicablePolicyAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
/**
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedDenyOverridesPolicyAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedDenyOverridesPolicyAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedDenyOverridesPolicyAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -60,27 +60,13 @@
"ordered-deny-overrides";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public OrderedDenyOverridesPolicyAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedDenyOverridesRuleAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedDenyOverridesRuleAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedDenyOverridesRuleAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -60,27 +60,13 @@
"ordered-deny-overrides";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public OrderedDenyOverridesRuleAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedPermitOverridesPolicyAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedPermitOverridesPolicyAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedPermitOverridesPolicyAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -60,27 +60,13 @@
"ordered-permit-overrides";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public OrderedPermitOverridesPolicyAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedPermitOverridesRuleAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedPermitOverridesRuleAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/OrderedPermitOverridesRuleAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -60,27 +60,13 @@
"ordered-permit-overrides";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public OrderedPermitOverridesRuleAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/PermitOverridesPolicyAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/PermitOverridesPolicyAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/PermitOverridesPolicyAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -74,27 +74,13 @@
"permit-overrides";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public PermitOverridesPolicyAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
/**
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/PermitOverridesRuleAlg.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/PermitOverridesRuleAlg.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/combine/PermitOverridesRuleAlg.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -69,27 +69,13 @@
"permit-overrides";
// a URI form of the identifier
- private static URI identifierURI;
- // exception if the URI was invalid, which should never be a problem
- private static RuntimeException earlyException;
+ private static URI identifierURI = URI.create(algId);
- static {
- try {
- identifierURI = new URI(algId);
- } catch (URISyntaxException se) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(se);
- }
- }
-
/**
* Standard constructor.
*/
public PermitOverridesRuleAlg() {
super(identifierURI);
-
- if (earlyException != null)
- throw earlyException;
}
/**
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/AddFunction.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/AddFunction.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/AddFunction.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -170,16 +170,6 @@
sum = sum + arg;
}
- // Make it round half even, not round nearest
- double lower = Math.floor(sum);
- double higher = lower + 1;
- if ((sum - lower) == (higher - sum)) {
- if ((lower % 2) == 0)
- sum = lower;
- else
- sum = higher;
- }
-
result = new EvaluationResult(new DoubleAttribute(sum));
break;
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/HigherOrderFunction.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/HigherOrderFunction.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/HigherOrderFunction.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -129,18 +129,10 @@
// the stuff used to make sure that we have a valid return type or a
// known error, just like in the attribute classes
- private static URI returnTypeURI;
- private static RuntimeException earlyException;
+ private static URI returnTypeURI = URI.create(BooleanAttribute.identifier);
// try to create the return type URI, and also setup the id map
static {
- try {
- returnTypeURI = new URI(BooleanAttribute.identifier);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
-
idMap = new HashMap();
idMap.put(NAME_ANY_OF, new Integer(ID_ANY_OF));
@@ -216,9 +208,6 @@
* @return the return type
*/
public URI getReturnType() {
- if (earlyException != null)
- throw earlyException;
-
return returnTypeURI;
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/MapFunction.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/MapFunction.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/cond/MapFunction.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -77,19 +77,8 @@
// the stuff used to make sure that we have a valid identifier or a
// known error, just like in the attribute classes
- private static URI identifier;
- private static RuntimeException earlyException;
+ private static URI identifier = URI.create(NAME_MAP);
- // try to initialize the identifier
- static {
- try {
- identifier = new URI(NAME_MAP);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException();
- earlyException.initCause(e);
- }
- };
-
/**
* Creates a new instance of a <code>MapFunction</code>.
*
@@ -170,10 +159,6 @@
* @return the function's identifier
*/
public URI getIdentifier() {
- // strictly speaking, this should never happen
- if (earlyException != null)
- throw earlyException;
-
return identifier;
}
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/ctx/Subject.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/ctx/Subject.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/ctx/Subject.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -65,31 +65,9 @@
/**
* <code>URI</code> form of the default subject category
*/
- public static final URI DEFAULT_CATEGORY;
+ public static final URI DEFAULT_CATEGORY = URI.create(AttributeDesignator.SUBJECT_CATEGORY_DEFAULT);
- // the exception thrown if the default category was invalid
- private static RuntimeException earlyException = null;
-
/**
- * Tries to initialize the default category, keeping track of the
- * exception for later use (if there was a problem). Note that this
- * should never happen, but the error case will be reported correctly
- * if the default string is invalid.
- */
- static {
- URI defaultURI = null;
-
- try {
- defaultURI = new URI(AttributeDesignator.SUBJECT_CATEGORY_DEFAULT);
- } catch (Exception e) {
- earlyException = new IllegalArgumentException("invalid URI");
- earlyException.initCause(e);
- }
-
- DEFAULT_CATEGORY = defaultURI;
- }
-
- /**
* Creates a new collection of subject attributes using the default
* subject cateorgy.
*
@@ -98,9 +76,6 @@
*/
public Subject(Set attributes) {
this(null, attributes);
-
- if (earlyException != null)
- throw earlyException;
}
/**
Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/finder/AttributeFinder.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/finder/AttributeFinder.java 2008-12-03 17:47:24 UTC (rev 82012)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/finder/AttributeFinder.java 2008-12-03 18:11:11 UTC (rev 82013)
@@ -50,6 +50,8 @@
import java.util.logging.Logger;
import org.jboss.security.xacml.sunxacml.EvaluationCtx;
+import org.jboss.security.xacml.sunxacml.attr.AttributeDesignator;
+import org.jboss.security.xacml.sunxacml.attr.AttributeSelector;
import org.jboss.security.xacml.sunxacml.attr.BagAttribute;
import org.jboss.security.xacml.sunxacml.cond.EvaluationResult;
import org.w3c.dom.Node;
@@ -58,10 +60,10 @@
/**
* This class is used by the PDP to find attribute values that weren't
* originally supplied in the request. It can be called with the data supplied
- * in <code>AttributeDesignator<code>s or <code>AttributeSelector</code>s.
+ * in {@link AttributeDesignator}s or {@link AttributeSelector}s.
* Because the modules in this finder may themselves need attribute data
* to search for attribute data, it's possible that the modules will look
- * for values in the <code>EvaluationCtx</code>, which may in turn result
+ * for values in the {@link EvaluationCtx}, which may in turn result
* in the invocation of this finder again, so module writers need to be
* careful about how they build their modules.
* <p>
@@ -99,20 +101,23 @@
}
/**
- * Returns the ordered <code>List</code> of modules used by this class
- * to find attribute values.
+ * Returns the ordered list of
+ * {@link AttributeFinderModule}s used by this class to find
+ * attribute values.
*
- * @return the list of modules used by this class
+ * @return a list of <code>AttributeFinderModule</code>s
*/
public List getModules() {
return new ArrayList(allModules);
}
/**
- * Sets the ordered <code>List</code> of modules used by this class
- * to find attribute values. The ordering will be maintained.
+ * Sets the ordered list of
+ * {@link AttributeFinderModule}s used by this class to find
+ * attribute values. The ordering will be maintained.
*
- * @param modules the modules this class will use
+ * @param modules a list of
+ * <code>AttributeFinderModule</code>s
*/
public void setModules(List modules) {
Iterator it = modules.iterator();
@@ -135,7 +140,7 @@
/**
* Tries to find attribute values based on the given designator data.
* The result, if successful, will always contain a
- * <code>BagAttribute</code>, even if only one value was found. If no
+ * {@link BagAttribute}, even if only one value was found. If no
* values were found, but no other error occurred, an empty bag is
* returned.
*
@@ -143,10 +148,10 @@
* @param attributeId the identifier of the attributes to find
* @param issuer the issuer of the attributes, or null if unspecified
* @param subjectCategory the category of the attribute if the
- * designatorType is SUBJECT_TARGET, otherwise null
+ * designatorType is {@link AttributeDesignator#SUBJECT_TARGET}, otherwise null
* @param context the representation of the request data
* @param designatorType the type of designator as named by the *_TARGET
- * fields in <code>AttributeDesignator</code>
+ * fields in {@link AttributeDesignator}
*
* @return the result of attribute retrieval, which will be a bag of
* attributes or an error
@@ -199,7 +204,7 @@
/**
* Tries to find attribute values based on the given selector data.
* The result, if successful, must always contain a
- * <code>BagAttribute</code>, even if only one value was found. If no
+ * {@link BagAttribute}, even if only one value was found. If no
* values were found, but no other error occurred, an empty bag is
* returned.
*
More information about the jboss-cvs-commits
mailing list