From oak-commits-return-455-apmail-jackrabbit-oak-commits-archive=jackrabbit.apache.org@jackrabbit.apache.org Wed Apr 25 17:07:08 2012 Return-Path: X-Original-To: apmail-jackrabbit-oak-commits-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0DB639190 for ; Wed, 25 Apr 2012 17:07:08 +0000 (UTC) Received: (qmail 96281 invoked by uid 500); 25 Apr 2012 17:07:08 -0000 Delivered-To: apmail-jackrabbit-oak-commits-archive@jackrabbit.apache.org Received: (qmail 96260 invoked by uid 500); 25 Apr 2012 17:07:08 -0000 Mailing-List: contact oak-commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-commits@jackrabbit.apache.org Delivered-To: mailing list oak-commits@jackrabbit.apache.org Received: (qmail 96251 invoked by uid 99); 25 Apr 2012 17:07:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2012 17:07:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2012 17:07:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A64CF2388865; Wed, 25 Apr 2012 17:06:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1330421 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidator.java Date: Wed, 25 Apr 2012 17:06:44 -0000 To: oak-commits@jackrabbit.apache.org From: angela@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120425170644.A64CF2388865@eris.apache.org> Author: angela Date: Wed Apr 25 17:06:44 2012 New Revision: 1330421 URL: http://svn.apache.org/viewvc?rev=1330421&view=rev Log: user JcrConstants instead of hardcoded property names, add TODO regarding exception handling Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidator.java Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidator.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidator.java?rev=1330421&r1=1330420&r2=1330421&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidator.java (original) +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidator.java Wed Apr 25 17:06:44 2012 @@ -19,6 +19,7 @@ package org.apache.jackrabbit.oak.plugin import java.util.Collections; import java.util.Set; +import org.apache.jackrabbit.JcrConstants; import org.apache.jackrabbit.oak.api.CommitFailedException; import org.apache.jackrabbit.oak.api.CoreValue; import org.apache.jackrabbit.oak.api.PropertyState; @@ -36,14 +37,15 @@ class TypeValidator implements Validator private void checkTypeExists(PropertyState after) throws CommitFailedException { Iterable coreValues = Collections.emptyList(); - if ("jcr:primaryType".equals(after.getName())) { + if (JcrConstants.JCR_PRIMARYTYPE.equals(after.getName())) { coreValues = Collections.singletonList(after.getValue()); - } else if ("jcr:mixinTypes".equals(after.getName())) { + } else if (JcrConstants.JCR_MIXINTYPES.equals(after.getName())) { coreValues = after.getValues(); } for (CoreValue cv : coreValues) { String value = cv.getString(); if (!types.contains(value)) { + // TODO: make sure NodeSuchNodeTypeException can be extracted in oak-jcr throw new CommitFailedException("Unknown node type: " + value); } }