Author: scottbw
Date: Wed Apr 21 12:19:51 2010
New Revision: 936279

URL: http://svn.apache.org/viewvc?rev=936279&view=rev
Log:
Ensure that all parser exceptions are thrown with a message; also removed 
unused Exception constructors

Modified:
    
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/W3CWidgetFactory.java
    
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/BadManifestException.java
    
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/BadWidgetZipFileException.java
    
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/InvalidContentTypeException.java
    
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/InvalidStartFileException.java
    
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/ContentEntity.java
    
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/FeatureEntity.java

Modified: 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/W3CWidgetFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/W3CWidgetFactory.java?rev=936279&r1=936278&r2=936279&view=diff
==============================================================================
--- 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/W3CWidgetFactory.java
 (original)
+++ 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/W3CWidgetFactory.java
 Wed Apr 21 12:19:51 2010
@@ -250,7 +250,7 @@ public class W3CWidgetFactory {
                                        }       
                                }
                                if (widgetModel.getContentList().isEmpty()){
-                                       throw new InvalidStartFileException();
+                                       throw new 
InvalidStartFileException("Widget has no start page");
                                }
                                
                                // get the path to the root of the unzipped 
folder

Modified: 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/BadManifestException.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/BadManifestException.java?rev=936279&r1=936278&r2=936279&view=diff
==============================================================================
--- 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/BadManifestException.java
 (original)
+++ 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/BadManifestException.java
 Wed Apr 21 12:19:51 2010
@@ -14,22 +14,12 @@
 
 package org.apache.wookie.w3c.exceptions;
 /**
- * Thrown when there is a problem with a manifest file 
- * @author Paul Sharples
- * @version $Id: BadManifestException.java,v 1.2 2009-07-28 16:05:23 
scottwilson Exp $
+ * Thrown when there is a problem with a manifest file; typically an 
unsupported or invalid feature requirement, or using the wrong namespace
  */
 public class BadManifestException extends Exception {
 
        private static final long serialVersionUID = 1L;
 
-       public BadManifestException() {
-               super();
-       }
-
-       public BadManifestException(String message, Throwable cause) {
-               super(message, cause);
-       }
-
        public BadManifestException(String message) {
                super(message);
        }
@@ -38,6 +28,4 @@ public class BadManifestException extend
                super(cause);
        }
        
-       
-
 }

Modified: 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/BadWidgetZipFileException.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/BadWidgetZipFileException.java?rev=936279&r1=936278&r2=936279&view=diff
==============================================================================
--- 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/BadWidgetZipFileException.java
 (original)
+++ 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/BadWidgetZipFileException.java
 Wed Apr 21 12:19:51 2010
@@ -14,9 +14,7 @@
 
 package org.apache.wookie.w3c.exceptions;
 /**
- * Thrown when there is a problem with a zip
- * @author Paul Sharples
- * @version $Id: BadWidgetZipFileException.java,v 1.2 2009-07-28 16:05:23 
scottwilson Exp $
+ * Thrown when there is a problem with a Widget's Zip archive
  */
 public class BadWidgetZipFileException extends Exception {
 
@@ -25,16 +23,4 @@ public class BadWidgetZipFileException e
        public BadWidgetZipFileException() {
                super();        
        }
-
-       public BadWidgetZipFileException(String message, Throwable cause) {
-               super(message, cause);
-       }
-
-       public BadWidgetZipFileException(String message) {
-               super(message);
-       }
-
-       public BadWidgetZipFileException(Throwable cause) {
-               super(cause);
-       }
 }

Modified: 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/InvalidContentTypeException.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/InvalidContentTypeException.java?rev=936279&r1=936278&r2=936279&view=diff
==============================================================================
--- 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/InvalidContentTypeException.java
 (original)
+++ 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/InvalidContentTypeException.java
 Wed Apr 21 12:19:51 2010
@@ -16,27 +16,13 @@ package org.apache.wookie.w3c.exceptions
 
 /**
  * Thrown when a widget manifest sets an invalid content type
- * @author scott
- *
  */
 public class InvalidContentTypeException extends BadManifestException {
 
        private static final long serialVersionUID = 1L;
-
-       public InvalidContentTypeException() {
-               super();
-       }
-
-       public InvalidContentTypeException(String message, Throwable cause) {
-               super(message, cause);
-       }
-
+       
        public InvalidContentTypeException(String message) {
                super(message);
        }
 
-       public InvalidContentTypeException(Throwable cause) {
-               super(cause);
-       }
-
 }

Modified: 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/InvalidStartFileException.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/InvalidStartFileException.java?rev=936279&r1=936278&r2=936279&view=diff
==============================================================================
--- 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/InvalidStartFileException.java
 (original)
+++ 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/exceptions/InvalidStartFileException.java
 Wed Apr 21 12:19:51 2010
@@ -15,27 +15,13 @@ package org.apache.wookie.w3c.exceptions
 
 /**
  * Thrown when a widget has no valid start file
- * @author scott
- *
  */
 public class InvalidStartFileException extends BadManifestException {
 
        private static final long serialVersionUID = 1L;
 
-       public InvalidStartFileException() {
-               super();
-       }
-
-       public InvalidStartFileException(String message, Throwable cause) {
-               super(message, cause);
-       }
-
        public InvalidStartFileException(String message) {
                super(message);
        }
 
-       public InvalidStartFileException(Throwable cause) {
-               super(cause);
-       }
-
 }

Modified: 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/ContentEntity.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/ContentEntity.java?rev=936279&r1=936278&r2=936279&view=diff
==============================================================================
--- 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/ContentEntity.java
 (original)
+++ 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/ContentEntity.java
 Wed Apr 21 12:19:51 2010
@@ -95,7 +95,7 @@ public class ContentEntity extends Abstr
                        // Split the content type, as we may also have a 
charset parameter
                        String[] type = fType.split(";");
                        // If a type attribute is specified, and is either 
invalid or unsupported, we must treat it as an invalid widget
-                       if (!isSupported(type[0], 
IW3CXMLConfiguration.SUPPORTED_CONTENT_TYPES)) throw new 
InvalidContentTypeException();
+                       if (!isSupported(type[0], 
IW3CXMLConfiguration.SUPPORTED_CONTENT_TYPES)) throw new 
InvalidContentTypeException("Content type is not supported");
                        fType = type[0];
                        // Get the charset parameter if present
                        if (type.length > 1){

Modified: 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/FeatureEntity.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/FeatureEntity.java?rev=936279&r1=936278&r2=936279&view=diff
==============================================================================
--- 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/FeatureEntity.java
 (original)
+++ 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/FeatureEntity.java
 Wed Apr 21 12:19:51 2010
@@ -100,7 +100,7 @@ public class FeatureEntity implements IF
                        // Not a valid IRI?
                        if (!IRIValidator.isValidIRI(fName)){
                                if (fRequired) {
-                                       throw new BadManifestException();
+                                       throw new BadManifestException("Feature 
name is not a valid IRI");
                                } else {
                                        fName = null;   
                                }
@@ -112,7 +112,7 @@ public class FeatureEntity implements IF
                        }
                        if (!supported){
                                if (fRequired){
-                                       throw new BadManifestException();
+                                       throw new 
BadManifestException("Required feature is not supported");
                                } else {
                                        fName = null;
                                }


Reply via email to