You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mb...@apache.org on 2007/03/12 22:16:20 UTC

svn commit: r517400 - /myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/util/Assert.java

Author: mbr
Date: Mon Mar 12 14:16:19 2007
New Revision: 517400

URL: http://svn.apache.org/viewvc?view=rev&rev=517400
Log:
Assert introduced for better state checking

Added:
    myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/util/Assert.java   (with props)

Added: myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/util/Assert.java
URL: http://svn.apache.org/viewvc/myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/util/Assert.java?view=auto&rev=517400
==============================================================================
--- myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/util/Assert.java (added)
+++ myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/util/Assert.java Mon Mar 12 14:16:19 2007
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.shared.util;
+
+/**
+ * @author Mathias Broekelmann (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class Assert
+{
+    public static void notNull(Object value)
+    {
+        if (value == null)
+            throw new NullPointerException("The instance is null.");
+    }
+
+    public static void notNull(Object value, String fieldName)
+    {
+        if (value == null)
+            throw new NullPointerException(fieldName + " is null.");
+    }
+}

Propchange: myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/util/Assert.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/util/Assert.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL