jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r469810 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype: DefinitionValidator.java EffectiveNodeTypeImpl.java ValueConstraint.java
Date Wed, 01 Nov 2006 07:58:35 GMT
Author: angela
Date: Tue Oct 31 23:58:34 2006
New Revision: 469810

URL: http://svn.apache.org/viewvc?view=rev&rev=469810
Log:
work in progress

minor improvement, sync

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/DefinitionValidator.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ValueConstraint.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/DefinitionValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/DefinitionValidator.java?view=diff&rev=469810&r1=469809&r2=469810
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/DefinitionValidator.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/DefinitionValidator.java
Tue Oct 31 23:58:34 2006
@@ -155,7 +155,7 @@
 
         // validate supertypes
         QName[] supertypes = ntDef.getSupertypes();
-        if (supertypes != null && supertypes.length > 0) {
+        if (supertypes.length > 0) {
             for (int i = 0; i < supertypes.length; i++) {
                 checkNamespace(supertypes[i]);
                 /**
@@ -197,7 +197,7 @@
          * build effective (i.e. merged and resolved) node type from supertypes
          * and check for conflicts
          */
-        if (supertypes != null && supertypes.length > 0) {
+        if (supertypes.length > 0) {
             try {
                 // DIFF JR: use extra method that does not compare to registered nts
                 EffectiveNodeType est = ntRegistry.getEffectiveNodeType(supertypes, validatedDefs);
@@ -508,7 +508,7 @@
 
             if (ntdMap.containsKey(stName)) {
                 QName[] sta = ((QNodeTypeDefinition)ntdMap.get(stName)).getSupertypes();
-                if (sta != null && sta.length > 0) {
+                if (sta.length > 0) {
                     // check recursively
                     inheritanceChain.push(stName);
                     checkForCircularInheritance(sta, inheritanceChain, ntdMap);

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java?view=diff&rev=469810&r1=469809&r2=469810
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java
Tue Oct 31 23:58:34 2006
@@ -201,7 +201,7 @@
 
         // resolve supertypes recursively
         QName[] supertypes = ntd.getSupertypes();
-        if (supertypes != null && supertypes.length > 0) {
+        if (supertypes.length > 0) {
             EffectiveNodeTypeImpl effSuperType = (EffectiveNodeTypeImpl)ntReg.getEffectiveNodeType(supertypes,
ntdMap);
             ent.internalMerge(effSuperType, true);
         }
@@ -493,10 +493,7 @@
                         // found node definition
                         return nd;
                     } else {
-                        if (nd.getDefaultPrimaryType() == null) {
-                            // no default node type defined, try next
-                            continue;
-                        } else {
+                        if (nd.getDefaultPrimaryType() != null) {
                             // found node definition with default node type
                             return nd;
                         }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ValueConstraint.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ValueConstraint.java?view=diff&rev=469810&r1=469809&r2=469810
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ValueConstraint.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ValueConstraint.java
Tue Oct 31 23:58:34 2006
@@ -243,18 +243,15 @@
                 // constraints are OR-ed together
                 boolean satisfied = false;
                 ConstraintViolationException cve = null;
-                for (int j = 0; j < constraints.length; j++) {
+                for (int j = 0; j < constraints.length && !satisfied; j++) {
                     try {
                         ValueConstraint cnstr = ValueConstraint.create(pd.getRequiredType(),
constraints[j]);
                         cnstr.check(values[i]);
                         satisfied = true;
-                        break;
                     } catch (ConstraintViolationException e) {
                         cve = e;
-                        continue;
                     } catch (InvalidConstraintException e) {
                         cve = new ConstraintViolationException(e.getMessage(), e);
-                        continue;
                     }
                 }
                 if (!satisfied) {



Mime
View raw message