jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r563916 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
Date Wed, 08 Aug 2007 15:31:25 GMT
Author: reschke
Date: Wed Aug  8 08:31:24 2007
New Revision: 563916

URL: http://svn.apache.org/viewvc?view=rev&rev=563916
Log:
JCR-1056: improve ItemDefinitionProviderImpl.getMatchingPropdef to better handle multiple
residuals of different types.

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java?view=diff&rev=563916&r1=563915&r2=563916
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
Wed Aug  8 08:31:24 2007
@@ -358,9 +358,17 @@
                             if (match != null && throwWhenAmbiguous) {
                                 throw new ConstraintViolationException("ambiguous property
definitions found: " + match + " vs " + pd);
                             }
-                          
-                            // found best possible match
-                            match = pd;
+
+                            if (match != null && match.getRequiredType() == PropertyType.STRING)
{
+                                // If we already found a match, and that was of PropertyType.STRING,
+                                // then do not overwrite it. The whole reason there are multiple
+                                // potential matches is that the client did not specify the
type,
+                                // thus obviously specified a String.
+                            }
+                            else {
+                                // found best possible match
+                                match = pd;
+                            }
                         } else {
                             if (match == null) {
                                 match = pd;



Mime
View raw message