Author: rhauch
Date: 2009-04-13 15:29:46 -0400 (Mon, 13 Apr 2009)
New Revision: 819
Modified:
trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/RepositoryNodeTypeManager.java
Log:
DNA-350 RepoistoryNodeTypeManager.findBest*Definition Returns Wrong Definition for
Protected Items if skipProtected is True.
Applied the patch.
Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/RepositoryNodeTypeManager.java
===================================================================
---
trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/RepositoryNodeTypeManager.java 2009-04-13
19:27:37 UTC (rev 818)
+++
trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/RepositoryNodeTypeManager.java 2009-04-13
19:29:46 UTC (rev 819)
@@ -186,7 +186,7 @@
if (primaryType != null) {
for (JcrPropertyDefinition definition :
primaryType.allSingleValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return null;
if (setToEmpty) {
if (!definition.isMandatory()) return definition;
// Otherwise this definition doesn't work, so continue with the
next ...
@@ -209,7 +209,7 @@
mixinTypes.add(mixinType);
for (JcrPropertyDefinition definition :
mixinType.allSingleValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return null;
if (setToEmpty) {
if (!definition.isMandatory()) return definition;
// Otherwise this definition doesn't work, so continue with
the next ...
@@ -228,7 +228,7 @@
if (primaryType != null) {
for (JcrPropertyDefinition definition :
primaryType.allMultiValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return null;
if (setToEmpty) {
if (!definition.isMandatory()) return definition;
// Otherwise this definition doesn't work, so continue with
the next ...
@@ -246,7 +246,7 @@
for (JcrNodeType mixinType : mixinTypes) {
for (JcrPropertyDefinition definition :
mixinType.allMultiValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return
null;
if (setToEmpty) {
if (!definition.isMandatory()) return definition;
// Otherwise this definition doesn't work, so continue
with the next ...
@@ -269,7 +269,7 @@
if (primaryType != null) {
for (JcrPropertyDefinition definition :
primaryType.allSingleValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return null;
assert definition.getRequiredType() != PropertyType.UNDEFINED;
if (definition.canCastToTypeAndSatisfyConstraints(value)) return
definition;
}
@@ -280,7 +280,7 @@
for (JcrNodeType mixinType : mixinTypes) {
for (JcrPropertyDefinition definition :
mixinType.allSingleValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return
null;
assert definition.getRequiredType() != PropertyType.UNDEFINED;
if (definition.canCastToTypeAndSatisfyConstraints(value)) return
definition;
}
@@ -292,7 +292,7 @@
if (primaryType != null) {
for (JcrPropertyDefinition definition :
primaryType.allMultiValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return
null;
assert definition.getRequiredType() != PropertyType.UNDEFINED;
if (definition.canCastToTypeAndSatisfyConstraints(value)) return
definition;
}
@@ -303,7 +303,7 @@
for (JcrNodeType mixinType : mixinTypes) {
for (JcrPropertyDefinition definition :
mixinType.allMultiValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected())
continue;
+ if (skipProtected && definition.isProtected()) return
null;
assert definition.getRequiredType() !=
PropertyType.UNDEFINED;
if (definition.canCastToTypeAndSatisfyConstraints(value))
return definition;
}
@@ -378,7 +378,7 @@
if (primaryType != null) {
for (JcrPropertyDefinition definition :
primaryType.allMultiValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return null;
if (setToEmpty) {
if (!definition.isMandatory()) return definition;
// Otherwise this definition doesn't work, so continue with the
next ...
@@ -402,7 +402,7 @@
mixinTypes.add(mixinType);
for (JcrPropertyDefinition definition :
mixinType.allMultiValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return null;
if (setToEmpty) {
if (!definition.isMandatory()) return definition;
// Otherwise this definition doesn't work, so continue with
the next ...
@@ -425,7 +425,7 @@
if (primaryType != null) {
for (JcrPropertyDefinition definition :
primaryType.allMultiValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return null;
assert definition.getRequiredType() != PropertyType.UNDEFINED;
if (definition.canCastToTypeAndSatisfyConstraints(values)) return
definition;
}
@@ -436,7 +436,7 @@
for (JcrNodeType mixinType : mixinTypes) {
for (JcrPropertyDefinition definition :
mixinType.allMultiValuePropertyDefinitions(propertyName)) {
// See if the definition allows the value ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return
null;
assert definition.getRequiredType() != PropertyType.UNDEFINED;
if (definition.canCastToTypeAndSatisfyConstraints(values)) return
definition;
}
@@ -535,7 +535,7 @@
if (primaryType != null) {
for (JcrNodeDefinition definition :
primaryType.allChildNodeDefinitions(childName, requireSns)) {
// Skip protected definitions ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return null;
// See if the definition allows a child with the supplied primary type
...
if (definition.allowsChildWithType(childType)) return definition;
}
@@ -548,7 +548,7 @@
if (mixinType == null) continue;
for (JcrNodeDefinition definition :
mixinType.allChildNodeDefinitions(childName, requireSns)) {
// Skip protected definitions ...
- if (skipProtected && definition.isProtected()) continue;
+ if (skipProtected && definition.isProtected()) return null;
// See if the definition allows a child with the supplied primary
type ...
if (definition.allowsChildWithType(childType)) return definition;
}
Show replies by date