abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r541709 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/model/ dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/ parser/src/main/java/org/apache/abdera/parser/stax/
Date Fri, 25 May 2007 16:13:51 GMT
Author: jmsnell
Date: Fri May 25 09:13:48 2007
New Revision: 541709

URL: http://svn.apache.org/viewvc?view=rev&rev=541709
Log:
Make InvalidLangTagSyntax a runtimeexception so we don't have to explicitly catch it everywhere

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
    incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/InvalidLangTagSyntax.java
    incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/Lang.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java?view=diff&rev=541709&r1=541708&r2=541709
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java Fri
May 25 09:13:48 2007
@@ -24,7 +24,6 @@
 import javax.activation.MimeTypeParseException;
 
 import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.i18n.lang.InvalidLangTagSyntax;
 import org.apache.abdera.i18n.lang.Lang;
 import org.apache.abdera.util.EntityTag;
 
@@ -145,7 +144,7 @@
   /**
    * Returns the value of the xml:lang attribute as a Lang object
    */
-  Lang getLanguageTag() throws InvalidLangTagSyntax;
+  Lang getLanguageTag();
   
   /**
    * set the base language

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java?view=diff&rev=541709&r1=541708&r2=541709
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java Fri
May 25 09:13:48 2007
@@ -23,7 +23,6 @@
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.i18n.lang.InvalidLangTagSyntax;
 import org.apache.abdera.i18n.lang.Lang;
 
 /**
@@ -99,7 +98,7 @@
   /**
    * Returns the value of the xml:lang attribute as a Lang object
    */
-  Lang getLanguageTag() throws InvalidLangTagSyntax;
+  Lang getLanguageTag();
   
   /**
    * Returns a Locale object created from the <code>xml:lang</code> attribute

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java?view=diff&rev=541709&r1=541708&r2=541709
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
Fri May 25 09:13:48 2007
@@ -27,7 +27,6 @@
 
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.i18n.lang.InvalidLangTagSyntax;
 import org.apache.abdera.i18n.lang.Lang;
 
 public abstract class ElementWrapper 
@@ -111,7 +110,7 @@
     return internal.getLanguage();
   }
   
-  public Lang getLanguageTag() throws InvalidLangTagSyntax {
+  public Lang getLanguageTag() {
     return internal.getLanguageTag();
   }
 

Modified: incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/InvalidLangTagSyntax.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/InvalidLangTagSyntax.java?view=diff&rev=541709&r1=541708&r2=541709
==============================================================================
--- incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/InvalidLangTagSyntax.java
(original)
+++ incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/InvalidLangTagSyntax.java
Fri May 25 09:13:48 2007
@@ -17,7 +17,7 @@
 */
 package org.apache.abdera.i18n.lang;
 
-public class InvalidLangTagSyntax extends Exception {
+public class InvalidLangTagSyntax extends RuntimeException {
 
   private static final long serialVersionUID = -2653819135178550519L;
 

Modified: incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/Lang.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/Lang.java?view=diff&rev=541709&r1=541708&r2=541709
==============================================================================
--- incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/Lang.java
(original)
+++ incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/Lang.java
Fri May 25 09:13:48 2007
@@ -52,11 +52,11 @@
     this.locale = locale;
   }
   
-  public Lang(String tag) throws InvalidLangTagSyntax {
+  public Lang(String tag) {
     this(parse(tag));
   }
   
-  public Lang(String... tags) throws InvalidLangTagSyntax {
+  public Lang(String... tags) {
     verify(tags);
     this.tags = tags;
     this.locale = initLocale();
@@ -99,7 +99,7 @@
     return buf.toString();
   }
   
-  public static boolean matches(Lang lang, String range) throws InvalidLangTagSyntax {
+  public static boolean matches(Lang lang, String range) {
     if (range.equals("*")) return true;
     return matches(lang, new Lang(range));
   }
@@ -114,7 +114,7 @@
     return true;
   }
   
-  public boolean matches(String range) throws InvalidLangTagSyntax {
+  public boolean matches(String range) {
     return matches(this,range);
   }
   
@@ -158,7 +158,7 @@
     return true;
   }
 
-  private static void verify(String[] tags) throws InvalidLangTagSyntax {
+  private static void verify(String[] tags) {
     if (tags.length == 0) throw new InvalidLangTagSyntax();
     String primary = tags[0];
     try {
@@ -175,7 +175,7 @@
     }
   }
   
-  private static String[] parse(String tag) throws InvalidLangTagSyntax {
+  private static String[] parse(String tag) {
     String[] tags = tag.split("\u002D");
     verify(tags);
     return tags;

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java?view=diff&rev=541709&r1=541708&r2=541709
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
Fri May 25 09:13:48 2007
@@ -35,7 +35,6 @@
 import org.apache.abdera.model.ElementWrapper;
 import org.apache.abdera.util.EntityTag;
 import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.i18n.lang.InvalidLangTagSyntax;
 import org.apache.abdera.i18n.lang.Lang;
 import org.apache.axiom.om.OMComment;
 import org.apache.axiom.om.OMDocType;
@@ -257,7 +256,7 @@
     return language;
   }
   
-  public Lang getLanguageTag() throws InvalidLangTagSyntax {
+  public Lang getLanguageTag() {
     String lang = getLanguage();
     return (lang != null) ? new Lang(lang) : null;
   }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?view=diff&rev=541709&r1=541708&r2=541709
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
Fri May 25 09:13:48 2007
@@ -52,7 +52,6 @@
 import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.abdera.util.URIHelper;
 import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.i18n.lang.InvalidLangTagSyntax;
 import org.apache.abdera.i18n.lang.Lang;
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMComment;
@@ -208,7 +207,7 @@
     return (T)getWrapped((Element)this.getFirstChildWithName(qname));
   }
   
-  public Lang getLanguageTag() throws InvalidLangTagSyntax {
+  public Lang getLanguageTag() {
     String lang = getLanguage();
     return (lang != null) ? new Lang(lang) : null;
   }



Mime
View raw message