abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r557830 - in /incubator/abdera/java/trunk: client/src/main/java/org/apache/abdera/protocol/client/ client/src/main/java/org/apache/abdera/protocol/client/util/ core/src/main/java/org/apache/abdera/ core/src/main/java/org/apache/abdera/util/...
Date Fri, 20 Jul 2007 00:59:01 GMT
Author: jmsnell
Date: Thu Jul 19 17:58:59 2007
New Revision: 557830

URL: http://svn.apache.org/viewvc?view=rev&rev=557830
Log:
While this is not used extensively, we really should have a means of externalizing 
strings for translation.

Added:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/Messages.java
    incubator/abdera/java/trunk/core/src/main/resources/abderamessages.properties
Modified:
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/ClientAuthSSLProtocolSocketFactory.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/Abdera.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.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
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParserFactory.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParserOptions.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMProcessingInstruction.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMUnsupportedContentTypeException.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMUnsupportedTextTypeException.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriterFactory.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMElementIterator.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMHelper.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMList.java
    incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/ItemManager.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/SignedRequestFilter.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/ServiceManager.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractRequestContext.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractRequestHandler.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractResponseContext.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/DefaultServiceContext.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/HttpServletRequestContext.java

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java (original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java Thu Jul 19 17:58:59 2007
@@ -32,6 +32,7 @@
 import org.apache.abdera.protocol.util.AbstractRequest;
 import org.apache.abdera.protocol.util.CacheControlUtil;
 import org.apache.abdera.protocol.util.EncodingUtil;
+import org.apache.abdera.util.Messages;
 import org.apache.commons.httpclient.util.DateParseException;
 import org.apache.commons.httpclient.util.DateUtil;
 
@@ -388,7 +389,7 @@
     if (slug.indexOf((char)10) > -1 ||
         slug.indexOf((char)13) > -1)
       throw new IllegalArgumentException(
-        "The slug must not contain ASCII carriage return or linefeed characters");
+        Messages.get("SLUG.BAD.CHARACTERS"));
     setHeader("Slug", Escaping.encode(slug,Constants.ASCIISANSCRLF));
   }
   

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/ClientAuthSSLProtocolSocketFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/ClientAuthSSLProtocolSocketFactory.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/ClientAuthSSLProtocolSocketFactory.java (original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/ClientAuthSSLProtocolSocketFactory.java Thu Jul 19 17:58:59 2007
@@ -33,6 +33,7 @@
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 
+import org.apache.abdera.util.Messages;
 import org.apache.commons.httpclient.ConnectTimeoutException;
 import org.apache.commons.httpclient.params.HttpConnectionParams;
 import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
@@ -57,7 +58,7 @@
     String protocol, 
     String kmfFactory,
     TrustManager tm) {
-      if (ks == null) throw new IllegalArgumentException("Invalid Keystore");
+      if (ks == null) throw new IllegalArgumentException(Messages.get("INVALID.KEYSTORE"));
       this.ks = ks;
       this.keyStorePass = keyStorePass;
       if (protocol != null) this.protocol = protocol;

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/Abdera.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/Abdera.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/Abdera.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/Abdera.java Thu Jul 19 17:58:59 2007
@@ -25,6 +25,7 @@
 import org.apache.abdera.parser.Parser;
 import org.apache.abdera.parser.ParserFactory;
 import org.apache.abdera.util.AbderaConfiguration;
+import org.apache.abdera.util.Messages;
 import org.apache.abdera.util.ServiceUtil;
 import org.apache.abdera.writer.Writer;
 import org.apache.abdera.writer.WriterFactory;
@@ -172,7 +173,7 @@
     try {
       return ServiceUtil.newXPathInstance(this);
     } catch (NoClassDefFoundError n) {
-      throw new RuntimeException("An Abdera XPath implementation is not available",n);
+      throw new RuntimeException(Messages.format("IMPLEMENTATION.NOT.AVAILABLE","XPath"),n);
     }
   }
     
@@ -183,7 +184,7 @@
     try {
       return ServiceUtil.newParserFactoryInstance(this);
     } catch (NoClassDefFoundError n) {
-      throw new RuntimeException("An Abdera Parser implementation is not available",n);
+      throw new RuntimeException(Messages.format("IMPLEMENTATION.NOT.AVAILABLE","Parser"),n);
     }
   }
     
@@ -194,7 +195,7 @@
     try {
       return ServiceUtil.newWriterFactoryInstance(this);
     } catch (NoClassDefFoundError n) {
-      throw new RuntimeException("An Abdera WriterFactory implementation is not available",n);
+      throw new RuntimeException(Messages.format("IMPLEMENTATION.NOT.AVAILABLE","WriterFactory"),n);
     }
   }
     
@@ -205,7 +206,7 @@
     try {
       return ServiceUtil.newWriterInstance(this);
     } catch (NoClassDefFoundError n) {
-      throw new RuntimeException("An Abdera Writer implementation is not available",n);
+      throw new RuntimeException(Messages.format("IMPLEMENTATION.NOT.AVAILABLE","Writer"),n);
     }
   }
   

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java Thu Jul 19 17:58:59 2007
@@ -249,4 +249,5 @@
   public Object clone() throws CloneNotSupportedException {
     return super.clone();
   }
+  
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java Thu Jul 19 17:58:59 2007
@@ -34,7 +34,7 @@
              Serializable {
 
   private static final long serialVersionUID = 1559972888659121461L;
-  private static final String INVALID_ENTITY_TAG = "Invalid Entity Tag";
+  private static final String INVALID_ENTITY_TAG = Messages.get("INVALID.ENTITY.TAG");
 
   public static EntityTag parse(String entity_tag) {
     if (entity_tag == null || entity_tag.length() == 0) 
@@ -186,10 +186,10 @@
       etag = new String(Hex.encodeHex(digest));
     } catch (NoSuchAlgorithmException e) {
       throw new UnsupportedOperationException(
-        "The hashing function is not available");
+        Messages.get("HASHING.NOT.AVAILABLE"));
     } catch (UnsupportedEncodingException e) {
       // should not happen
-      throw new RuntimeException("UTF-8 not supported?", e);
+      throw new RuntimeException(Messages.get("UTF8.NOT.SUPPORTED"), e);
     }
     return new EntityTag(etag);
   }

Added: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/Messages.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/Messages.java?view=auto&rev=557830
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/Messages.java (added)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/Messages.java Thu Jul 19 17:58:59 2007
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera.util;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+public final class Messages {
+
+  private static Messages instance = null;
+  
+  public static synchronized Messages getInstance() {
+    if (instance == null) instance = new Messages();
+    return instance;
+  }
+  
+  public static synchronized void setInstance(Messages messages) {
+    Messages.instance = messages;
+  }
+  
+  public static String get(String key) {
+    return getInstance().getValue(key);
+  }
+  
+  public static String get(String key, String defaultValue) {
+    return getInstance().getValue(key,defaultValue);
+  }
+  
+  public static String format(String key, Object... args) {
+    return getInstance().formatValue(key,args);
+  }
+  
+  private final String BUNDLE = "abderamessages";
+  
+  private final Locale locale;
+  private final ResourceBundle bundle;
+  
+  public Messages() {
+    this(Locale.getDefault(), ServiceUtil.getClassLoader());
+  }
+  
+  public Messages(Locale locale, ClassLoader loader) {
+    this.locale = locale;
+    this.bundle = initResourceBundle(locale, loader);
+  }
+  
+  private ResourceBundle initResourceBundle(Locale locale, ClassLoader loader) {
+    try {
+      return ResourceBundle.getBundle(BUNDLE, locale, loader);
+    } catch (Exception e) {
+      return null;
+    }
+  }
+  
+  public Locale getLocale() {
+    return locale;
+  }
+  
+  private String getValue(String key) {
+    try {
+      return bundle.getString(key);
+    } catch (Exception e) {
+      return null;
+    }
+  }
+  
+  private String getValue(String key, String defaultValue) {
+    String value = get(key);
+    return value != null ? value : defaultValue;
+  }
+  
+  private String formatValue(String key, Object... args) {
+    String value = get(key);
+    return value != null ? MessageFormat.format(value, args) : null;
+  }
+  
+}

Added: incubator/abdera/java/trunk/core/src/main/resources/abderamessages.properties
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/resources/abderamessages.properties?view=auto&rev=557830
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/resources/abderamessages.properties (added)
+++ incubator/abdera/java/trunk/core/src/main/resources/abderamessages.properties Thu Jul 19 17:58:59 2007
@@ -0,0 +1,51 @@
+IMPLEMENTATION.NOT.AVAILABLE=An Abdera {0} implementation is not available
+INVALID.ENTITY.TAG=Invalid Entity Tag
+UTF8.NOT.SUPPORTED=UTF-8 not supported?
+HASHING.NOT.AVAILABLE=The hashing function is not available
+DATA.HANDLER.NOT.SUPPORTED=Only supported on media content entries
+INPUTSTREAM.NOT.NULL=InputStream must not be null
+READER.NOT.NULL=Reader must not be null
+
+WRONG.PARSER.INSTANCE=Only instances or subclasses of {0} may be used with this parser implementation
+UNSUPPORTED.CONTENT.TYPE=Unsupported Content Type: {0}
+UNSUPPORTED.TEXT.TYPE=Unsupported Text Type: {0}
+SLUG.NOT.NULL=Slug cannot be null
+SLUG.BAD.CHARACTERS=The slug must not contain ASCII carriage return or linefeed characters
+PROPERTY.NOT.SUPPORTED=Property not supported
+
+RETURNING.INSTANCE=Returning {0} as instance of '{1}'.
+CREATING.NEW.INSTANCE=Creating new {0} instance
+INITIALIZING.INSTANCE=Initializing {0} instance
+CREATING.ERROR.DOC=Creating error document - {0}, {1}
+SERVER_ERROR=Server error
+UNAUTHORIZED=Unauthorized
+FORBIDDEN=Forbidden
+UNKNOWN=Unknown
+NOT.ALLOWED=Not Allowed
+BAD.REQUEST=Bad Request
+CONFLICT=Conflict
+UNAVAILABLE=Unavailable
+NOT.MODIFIED=Not modified
+PRECONDITION.FAILED=Precondition failed
+NOT.SUPPORTED=Not supported
+LOCKED=Locked
+RETURNING.DOCUMENT=Returning document
+SLUG.SANITIZED=Sanitized slug '{0}' to '{1}'
+DEFAULT.PAGE.SIZE=Getting default page size: {0}
+PAGE.SIZE=Getting page size: {0}
+OFFSET=Getting offset: {0}
+CHECKING.VALID.ENTRY=Checking valid entry: {0}
+CHECKING.ENTRY.NAMESPACES=Checking entry namespaces: {0}
+TARGET.TYPE=Target type: {0}
+TARGET.ID=Target id: {0}
+METHOD=Method: {0}
+PARSING.REQUEST.DOCUMENT=Parsing request document
+PROCESSING.REQUEST=Processing the request
+USING.PROVIDER=Using provider: {0}
+OUTPUT.ERROR=Error producing output
+RELEASING.PROVIDER=Releasing provider: {0}
+NO.PROVIDER=No Provider
+METHOD.NOT.ALLOWED=Method '{0}' Not Allowed
+
+VALID.SIGNATURE.REQUIRED=A Valid Signature is required
+INVALID.KEYSTORE=Invalid Keystore
\ No newline at end of file

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java Thu Jul 19 17:58:59 2007
@@ -43,6 +43,7 @@
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.util.OMSerializerUtil;
 
+@SuppressWarnings("unchecked")
 public class FOMBuilder 
   extends StAXOMBuilder
   implements Constants {
@@ -310,7 +311,6 @@
     depth--;
   }
 
-  @SuppressWarnings("unchecked")
   public <T extends Element>Document<T> getFomDocument() {
     while ((fomDocument == null) && !done) {
       next();

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java Thu Jul 19 17:58:59 2007
@@ -25,6 +25,7 @@
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.impl.llom.OMCommentImpl;
 
+@SuppressWarnings("unchecked")
 public class FOMComment 
   extends OMCommentImpl 
   implements Comment {
@@ -45,7 +46,6 @@
     super.setValue(text);
   }
   
-  @SuppressWarnings("unchecked")
   public <T extends Base>T getParentElement() {
     T parent = (T)super.getParent();
     return (T) ((parent instanceof Element) ? 

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java Thu Jul 19 17:58:59 2007
@@ -28,6 +28,7 @@
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.ElementWrapper;
 import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.Messages;
 import org.apache.abdera.i18n.iri.IRI;
 import org.apache.axiom.attachments.utils.DataHandlerUtils;
 import org.apache.axiom.om.OMContainer;
@@ -37,6 +38,7 @@
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMXMLParserWrapper;
 
+@SuppressWarnings("unchecked")
 public class FOMContent 
   extends FOMExtensibleElement 
   implements Content {
@@ -120,7 +122,6 @@
     init(type);
   }
   
-  @SuppressWarnings("unchecked")
   public <T extends Element> T getValueElement() {
     FOMFactory factory = (FOMFactory) getFactory();
     return (T)factory.getElementWrapper((Element)this.getFirstElement());
@@ -193,7 +194,7 @@
   public DataHandler getDataHandler() {
     if (!Type.MEDIA.equals(type)) 
       throw new UnsupportedOperationException(
-        "Only supported on media content entries");
+        Messages.get("DATA.HANDLER.NOT.SUPPORTED"));
     MimeType type = getMimeType();
     java.net.URL src = null;
     try {

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=557830&r1=557829&r2=557830
==============================================================================
--- 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 Thu Jul 19 17:58:59 2007
@@ -49,7 +49,7 @@
 import org.apache.axiom.om.impl.llom.OMDocumentImpl;
 import org.apache.axiom.om.util.StAXUtils;
 
-
+@SuppressWarnings("unchecked")
 public class FOMDocument<T extends Element> 
   extends OMDocumentImpl 
   implements Document<T> {
@@ -96,7 +96,6 @@
       super(parserWrapper);
   }
 
-  @SuppressWarnings("unchecked")
   public T getRoot() {  
     FOMFactory factory = (FOMFactory) getFactory();
     return (T) factory.getElementWrapper((T) this.getOMDocumentElement());
@@ -156,7 +155,6 @@
     this.lastModified = lastModified;
   }
   
-  @SuppressWarnings("unchecked")
   public Object clone() {
     Document<T> doc = ((FOMFactory)factory).newDocument();
     OMDocument omdoc = (OMDocument) doc;

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=557830&r1=557829&r2=557830
==============================================================================
--- 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 Thu Jul 19 17:58:59 2007
@@ -70,6 +70,7 @@
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.llom.OMElementImpl;
 
+@SuppressWarnings("unchecked")
 public class FOMElement 
   extends OMElementImpl 
   implements Element, 
@@ -138,7 +139,7 @@
     return factory.getElementWrapper(internal);
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Base>T getParentElement() {
     T parent = (T)super.getParent();
     return (T) ((parent instanceof Element) ? 
@@ -156,7 +157,7 @@
     super.setParent((FOMElement)parent);
   }
 
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>T getPreviousSibling() {
     OMNode el = this.getPreviousOMSibling();
     while (el != null) {
@@ -166,7 +167,7 @@
     return null;
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>T getNextSibling() {
     OMNode el = this.getNextOMSibling();
     while (el != null) {
@@ -176,12 +177,12 @@
     return null;
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>T getFirstChild() {
     return (T)getWrapped((Element)this.getFirstElement());
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>T getPreviousSibling(QName qname) {
     Element el = getPreviousSibling();
     while (el != null) {
@@ -193,7 +194,7 @@
     return null;
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>T getNextSibling(QName qname) {
     Element el = getNextSibling();
     while (el != null) {
@@ -205,7 +206,7 @@
     return null;
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>T getFirstChild(QName qname) {
     return (T)getWrapped((Element)this.getFirstChildWithName(qname));
   }
@@ -300,7 +301,7 @@
     }
   }
   
-  @SuppressWarnings("unchecked")
+  
   protected <E extends Element>List<E> _getChildrenAsSet(QName qname) {
     FOMFactory factory = (FOMFactory) getFactory();
     return new FOMList(new FOMElementIteratorWrapper(
@@ -354,7 +355,7 @@
     }
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>Document<T> getDocument() {
     Document<T> document = null;
     if (parent != null) {
@@ -399,7 +400,7 @@
     return getMustPreserveWhitespace() || value == null ? value : value.trim();
   }
 
-  @SuppressWarnings("unchecked")
+  
   protected <T extends Text>T getTextElement(QName qname) {
     return (T)getFirstChildWithName(qname);
   }
@@ -547,7 +548,7 @@
     }
   }
   
-  @SuppressWarnings("unchecked")
+  
   public Object clone() {
     OMElement el = _create(this);
     _copyElement(this, el);
@@ -715,7 +716,7 @@
     return namespaces;
   }
 
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>List<T> getElements() {
     return new FOMList<T>(
         new FOMElementIteratorWrapper(

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java Thu Jul 19 17:58:59 2007
@@ -55,6 +55,7 @@
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMXMLParserWrapper;
 
+@SuppressWarnings("unchecked")
 public class FOMEntry
   extends FOMExtensibleElement 
   implements Entry {
@@ -171,7 +172,6 @@
     return category;    
   }
   
-  @SuppressWarnings("unchecked")
   public Content getContentElement() {
     return (Content)getFirstChildWithName(CONTENT);
   }
@@ -465,7 +465,6 @@
     return setPublished((value != null) ? AtomDate.valueOf(value) : null);
   }
   
-  @SuppressWarnings("unchecked")
   public Text getRightsElement() {
     return getTextElement(RIGHTS);
   }
@@ -523,7 +522,6 @@
     }
   }
 
-  @SuppressWarnings("unchecked")
   public Text getSummaryElement() {
     return getTextElement(SUMMARY);
   }
@@ -567,7 +565,6 @@
     return getText(SUMMARY);
   }
 
-  @SuppressWarnings("unchecked")
   public Text getTitleElement() {
     return getTextElement(TITLE);
   }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java Thu Jul 19 17:58:59 2007
@@ -34,6 +34,7 @@
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMXMLParserWrapper;
 
+@SuppressWarnings("unchecked")
 public class FOMExtensibleElement 
   extends FOMElement 
   implements ExtensibleElement {
@@ -70,17 +71,14 @@
     super(qname, parent, factory, builder);
   }
 
-  @SuppressWarnings("unchecked")
   public List<Element> getExtensions() {
     return new FOMList<Element>(new FOMExtensionIterator(this));
   }
 
-  @SuppressWarnings("unchecked")
   public List<Element> getExtensions(String uri) {
     return new FOMList<Element>(new FOMExtensionIterator(this, uri));
   }
 
-  @SuppressWarnings("unchecked")
   public <T extends Element>List<T> getExtensions(QName qname) {
     FOMFactory factory = (FOMFactory) this.getFactory();
     return new FOMList<T>(
@@ -88,7 +86,6 @@
         factory,getChildrenWithName(qname)));
   }
 
-  @SuppressWarnings("unchecked")
   public <T extends Element>T getExtension(QName qname) {
     FOMFactory factory = (FOMFactory) getFactory();
     T t = (T) this.getFirstChildWithName(qname);
@@ -106,7 +103,6 @@
     addChild((OMElement)extension);
   }
   
-  @SuppressWarnings("unchecked")
   public <T extends Element>T addExtension(QName qname) {
     FOMFactory fomfactory = (FOMFactory) factory;
     String prefix = qname.getPrefix();
@@ -114,7 +110,6 @@
     return (T)fomfactory.newExtensionElement(qname, this);
   }
   
-  @SuppressWarnings("unchecked")
   public <T extends Element>T addExtension(String namespace, String localpart, String prefix) {
     declareIfNecessary(namespace, prefix);
     return (prefix != null) ? 
@@ -175,7 +170,6 @@
    * Trick using Generics to find an extension element without 
    * having to pass in it's QName
    */ 
-  @SuppressWarnings("unchecked")
   public <T extends Element> T getExtension(Class<T> _class) {
     T t = null;
     List<Element> extensions = getExtensions();

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java Thu Jul 19 17:58:59 2007
@@ -66,6 +66,7 @@
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory;
 
+@SuppressWarnings("unchecked")
 public class FOMFactory 
   extends OMLinkedListImplFactory 
   implements Factory, Constants, ExtensionFactory {
@@ -97,18 +98,18 @@
     return new FOMParser();
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>Document<T> newDocument() {
     return new FOMDocument(this);
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>Document<T> newDocument(
     OMXMLParserWrapper parserWrapper) {
       return new FOMDocument(parserWrapper, this);
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>Document<T> newDocument(
     T root, 
     OMXMLParserWrapper parserWrapper) {
@@ -403,31 +404,31 @@
     return new FOMText(type, qname, (OMContainer)parent,this);
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>T newElement(QName qname) {
     return (T)newElement(qname, null);
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>T newElement(
     QName qname, 
     Base parent) {
       return (T)newExtensionElement(qname, parent);
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>T newExtensionElement(QName qname) {
     return (T)newExtensionElement(qname, (OMContainer)null);
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element>T newExtensionElement(
     QName qname, 
     Base parent) {
     return (T)newExtensionElement(qname, (OMContainer)parent);
   }
   
-  @SuppressWarnings("unchecked")
+  
   private <T extends Element>T newExtensionElement(
     QName qname, 
     OMContainer parent) {
@@ -437,7 +438,7 @@
         el : factoriesMap.getElementWrapper(el));
   }
   
-  @SuppressWarnings("unchecked")
+  
   private <T extends Element>T newExtensionElement(
     QName qname,
     OMContainer parent,
@@ -630,7 +631,7 @@
       return new FOMExtensibleElement(qname,parent,this,parserWrapper);
   }
   
-  @SuppressWarnings("unchecked")
+  
   protected OMElement createElement(
       QName qname, 
       OMContainer parent, 
@@ -710,7 +711,7 @@
       return element;
     }
   
-  @SuppressWarnings("unchecked")
+  
   protected OMElement createElement(
     QName qname, 
     OMContainer parent, 
@@ -811,7 +812,7 @@
     factoriesMap.setElementWrapper(internal, wrapper);
   }
   
-  @SuppressWarnings("unchecked")
+  
   public <T extends Element> T getElementWrapper(Element internal) {
     if (internal == null) return null;
     String ns = internal.getQName().getNamespaceURI();

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java Thu Jul 19 17:58:59 2007
@@ -31,6 +31,7 @@
 import org.apache.abdera.parser.ParserOptions;
 import org.apache.abdera.parser.stax.util.FOMSniffingInputStream;
 import org.apache.abdera.util.AbstractParser;
+import org.apache.abdera.util.Messages;
 import org.apache.abdera.i18n.iri.IRI;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.util.StAXUtils;
@@ -85,7 +86,7 @@
     ParserOptions options)
       throws ParseException {
     if (in == null)
-      throw new IllegalArgumentException("InputStream must not be null");
+      throw new IllegalArgumentException(Messages.get("INPUTSTREAM.NOT.NULL"));
     try {
       if (options == null) options = getDefaultParserOptions();
       String charset = options.getCharset();
@@ -115,7 +116,7 @@
     ParserOptions options) 
       throws ParseException {
     if (in == null)
-      throw new IllegalArgumentException("Reader must not be null");
+      throw new IllegalArgumentException(Messages.get("READER.NOT.NULL"));
     try {
       if (options == null) options = getDefaultParserOptions();
       return parse(StAXUtils.createXMLStreamReader(in), base, options);

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParserFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParserFactory.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParserFactory.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParserFactory.java Thu Jul 19 17:58:59 2007
@@ -25,6 +25,7 @@
 import org.apache.abdera.parser.Parser;
 import org.apache.abdera.parser.ParserFactory;
 
+@SuppressWarnings("unchecked")
 public class FOMParserFactory 
   implements ParserFactory {
 
@@ -45,12 +46,10 @@
     return abdera;
   }
   
-  @SuppressWarnings("unchecked")
   public <T extends Parser>T getParser() {
     return (T)getAbdera().getParser();
   }
 
-  @SuppressWarnings("unchecked")
   public <T extends Parser>T getParser(String name) {
     return (T)((name != null) ? 
       getParsers().get(name.toLowerCase()) : getParser());

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParserOptions.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParserOptions.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParserOptions.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParserOptions.java Thu Jul 19 17:58:59 2007
@@ -19,6 +19,7 @@
 
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.util.AbstractParserOptions;
+import org.apache.abdera.util.Messages;
 
 
 public class FOMParserOptions
@@ -36,7 +37,7 @@
   protected void checkFactory(Factory factory) {
     if (!(factory instanceof FOMFactory))
       throw new FOMException(
-        "Only instances or subclasses of org.apache.abdera.axiom.FOMFactory may be used with this parser implementation");
+        Messages.format("WRONG.PARSER.INSTANCE",FOMFactory.class.getName()));
   }
 
 

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMProcessingInstruction.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMProcessingInstruction.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMProcessingInstruction.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMProcessingInstruction.java Thu Jul 19 17:58:59 2007
@@ -25,6 +25,7 @@
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.impl.llom.OMProcessingInstructionImpl;
 
+@SuppressWarnings("unchecked")
 public class FOMProcessingInstruction 
   extends OMProcessingInstructionImpl
   implements ProcessingInstruction {
@@ -37,7 +38,6 @@
     super(arg0, arg1, arg2, arg3);
   }
 
-  @SuppressWarnings("unchecked")
   public <T extends Base>T getParentElement() {
     T parent = (T)super.getParent();
     return (T) ((parent instanceof Element) ? 

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java Thu Jul 19 17:58:59 2007
@@ -50,6 +50,7 @@
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMXMLParserWrapper;
 
+@SuppressWarnings("unchecked")
 public class FOMSource
   extends FOMExtensibleElement 
   implements Source {
@@ -274,7 +275,6 @@
     return link;
   }
     
-  @SuppressWarnings("unchecked")
   public Text getRightsElement() {
     return getTextElement(RIGHTS);
   }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java Thu Jul 19 17:58:59 2007
@@ -29,6 +29,7 @@
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.llom.OMTextImpl;
 
+@SuppressWarnings("unchecked")
 public class FOMTextValue 
   extends OMTextImpl
   implements TextValue {
@@ -85,7 +86,6 @@
     return (DataHandler) super.getDataHandler();
   }
   
-  @SuppressWarnings("unchecked")
   public <T extends Base>T getParentElement() {
     T parent = (T)super.getParent();
     return (T) ((parent instanceof Element) ? 

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMUnsupportedContentTypeException.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMUnsupportedContentTypeException.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMUnsupportedContentTypeException.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMUnsupportedContentTypeException.java Thu Jul 19 17:58:59 2007
@@ -17,13 +17,15 @@
 */
 package org.apache.abdera.parser.stax;
 
+import org.apache.abdera.util.Messages;
+
 public class FOMUnsupportedContentTypeException 
   extends FOMException {
 
   private static final long serialVersionUID = 4156893310308105899L;
 
   public FOMUnsupportedContentTypeException(String message) {
-    super("Unsupported Content Type: " + message);
+    super(Messages.format("UNSUPPORTED.CONTENT.TYPE",message));
   }
 
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMUnsupportedTextTypeException.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMUnsupportedTextTypeException.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMUnsupportedTextTypeException.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMUnsupportedTextTypeException.java Thu Jul 19 17:58:59 2007
@@ -17,13 +17,15 @@
 */
 package org.apache.abdera.parser.stax;
 
+import org.apache.abdera.util.Messages;
+
 public class FOMUnsupportedTextTypeException 
   extends FOMException {
 
   private static final long serialVersionUID = 4156893310308105899L;
 
   public FOMUnsupportedTextTypeException(String message) {
-    super("Unsupported Text Type: " + message);
+    super(Messages.format("UNSUPPORTED.TEXT.TYPE",message));
   }
 
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriterFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriterFactory.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriterFactory.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriterFactory.java Thu Jul 19 17:58:59 2007
@@ -25,6 +25,7 @@
 import org.apache.abdera.writer.Writer;
 import org.apache.abdera.writer.WriterFactory;
 
+@SuppressWarnings("unchecked")
 public class FOMWriterFactory 
   implements WriterFactory {
 
@@ -45,18 +46,15 @@
     return abdera;
   }
   
-  @SuppressWarnings("unchecked")
   public <T extends Writer>T getWriter() {
     return (T)getAbdera().getWriter();
   }
 
-  @SuppressWarnings("unchecked")
   public <T extends Writer>T getWriter(String name) {
     return (T)((name != null) ? 
       getWriters().get(name.toLowerCase()) : getWriter());
   }
 
-  @SuppressWarnings("unchecked")
   public <T extends Writer>T getWriterByMediaType(String mediatype) {
     Map<String,NamedWriter> writers = getWriters();
     for (NamedWriter writer : writers.values()) {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMXPath.java Thu Jul 19 17:58:59 2007
@@ -39,6 +39,7 @@
 import org.jaxen.VariableContext;
 import org.jaxen.XPath;
 
+@SuppressWarnings("unchecked")
 public class FOMXPath extends AbstractXPath {
   
   private final Map<QName,Function> functions;
@@ -147,8 +148,7 @@
       throws JaxenException {
     return getXPath(path, namespaces, null, null);
   }
-
-  @SuppressWarnings("unchecked")
+  
   public List selectNodes(
     String path, 
     Base base, 

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMElementIterator.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMElementIterator.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMElementIterator.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMElementIterator.java Thu Jul 19 17:58:59 2007
@@ -23,7 +23,9 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.traverse.OMChildrenIterator;
 
-public class FOMElementIterator extends OMChildrenIterator {
+@SuppressWarnings("unchecked")
+public class FOMElementIterator 
+  extends OMChildrenIterator {
 
   /**
    * Field givenQName
@@ -68,7 +70,6 @@
    *
    * @return Returns <tt>true</tt> if the iterator has more elements.
    */
-  @SuppressWarnings("unchecked")
   public boolean hasNext() {
       while (needToMoveForward) {
           if (currentChild != null) {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMHelper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMHelper.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMHelper.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMHelper.java Thu Jul 19 17:58:59 2007
@@ -27,15 +27,15 @@
 import org.apache.abdera.util.Constants;
 import org.apache.axiom.om.util.UUIDGenerator;
 
-public class FOMHelper implements Constants {
+@SuppressWarnings("unchecked")
+public class FOMHelper 
+  implements Constants {
 
-  @SuppressWarnings("unchecked")
   public static List<Category> getCategories(Element element, String scheme) {
     Iterator i = new FOMElementIterator(element, Category.class, SCHEME, scheme, null);
     return new FOMList<Category>(i);
   }
   
-  @SuppressWarnings("unchecked")
   public static List<Link> getLinks(Element element, String rel) {
     Iterator i = new FOMLinkIterator(element, Link.class, REL, rel, Link.REL_ALTERNATE);
     return new FOMList<Link>(i);

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMList.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMList.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMList.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/FOMList.java Thu Jul 19 17:58:59 2007
@@ -42,6 +42,7 @@
  *   
  *   The List itself is unmodifiable. 
  */
+@SuppressWarnings("unchecked")
 public class FOMList<T> 
   extends java.util.AbstractCollection<T>
   implements List<T> {
@@ -76,7 +77,6 @@
     return buffered();
   }
   
-  @SuppressWarnings("unchecked")
   public T get(int index) {
     int n = buffered();
     if (index > n && (index > buffer(index - n)))
@@ -180,7 +180,6 @@
     return buffer.toArray();
   }
 
-  @SuppressWarnings("unchecked")
   public Object[] toArray(Object[] a) {
     buffer(-1);
     return buffer.toArray(a);
@@ -206,7 +205,6 @@
           (set.finished() && counter < buffer.size());
       }
     
-      @SuppressWarnings("unchecked")
       public M next() {
         return (M) set.get(counter++);
       }
@@ -230,7 +228,6 @@
           return buffer.size();
       }
     
-      @SuppressWarnings("unchecked")
       public M previous() {
         return (M) set.get(--counter);
       }

Modified: incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/ItemManager.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/ItemManager.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/ItemManager.java (original)
+++ incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/ItemManager.java Thu Jul 19 17:58:59 2007
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.protocol;
 
-
-
 public interface ItemManager<T> {
 
   T get(Request request);

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/SignedRequestFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/SignedRequestFilter.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/SignedRequestFilter.java (original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/SignedRequestFilter.java Thu Jul 19 17:58:59 2007
@@ -31,6 +31,7 @@
 import org.apache.abdera.model.Element;
 import org.apache.abdera.security.AbderaSecurity;
 import org.apache.abdera.security.Signature;
+import org.apache.abdera.util.Messages;
 
 /**
  * Servlet Filter that verifies that an Atom document received by the server
@@ -61,7 +62,7 @@
         boolean valid = sig.verify(doc.getRoot(), null);
         if (!valid) {
           ((HttpServletResponse)response).sendError(
-            400, "A Valid Signature is required");
+            400, Messages.get("VALID.SIGNATURE.REQUIRED"));
           return;
         }
         wrapper.setAttribute(VALID, Boolean.valueOf(valid));

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/ServiceManager.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/ServiceManager.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/ServiceManager.java (original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/ServiceManager.java Thu Jul 19 17:58:59 2007
@@ -22,6 +22,7 @@
 import org.apache.abdera.Abdera;
 import org.apache.abdera.protocol.server.impl.DefaultServiceContext;
 import org.apache.abdera.protocol.server.util.ServerConstants;
+import org.apache.abdera.util.Messages;
 import org.apache.abdera.util.ServiceUtil;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -38,7 +39,7 @@
   
   public static synchronized ServiceManager getInstance() {
     if (INSTANCE == null) {
-      log.debug("Creating new ServiceManager instance");
+      log.debug(Messages.format("CREATING.NEW.INSTANCE","ServiceManager"));
       INSTANCE = new ServiceManager();
     }
     return INSTANCE;
@@ -46,7 +47,7 @@
   
   public static synchronized Abdera getAbdera() {
     if (abdera == null) {
-      log.debug("Creating new Abdera instance for the ServiceManager");
+      log.debug(Messages.format("CREATING.NEW.INSTANCE","Abdera"));
       abdera = new Abdera();
     }
     return abdera;
@@ -56,7 +57,7 @@
     Map<String,String> properties) {
     Abdera abdera = getAbdera();
     String instance = properties.get(SERVICE_CONTEXT);
-    log.debug("Creating new Service Context instance - " + instance);
+    log.debug(Messages.format("CREATING.NEW.INSTANCE","ServiceContext"));
     ServiceContext context = 
       (ServiceContext) ServiceUtil.newInstance(
         SERVICE_CONTEXT, 
@@ -64,7 +65,7 @@
           instance : 
           DefaultServiceContext.class.getName(),
         abdera);
-    log.debug("Initializing Service Context - " + context);
+    log.debug(Messages.format("INITIALIZING.INSTANCE", "ServiceContext"));
     context.init(abdera, properties);
     return context;
   }

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java (original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java Thu Jul 19 17:58:59 2007
@@ -36,6 +36,7 @@
 import org.apache.abdera.protocol.server.ResponseContext;
 import org.apache.abdera.protocol.server.TargetType;
 import org.apache.abdera.protocol.util.EncodingUtil;
+import org.apache.abdera.util.Messages;
 import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.abdera.i18n.iri.IRI;
 import org.apache.commons.logging.Log;
@@ -66,7 +67,7 @@
     int code, 
     String message, 
     Throwable e) {
-      if (e != null) log.debug("Creating error document - " + code + ", " + message, e);
+      if (e != null) log.debug(Messages.format("CREATING.ERROR.DOC",code,message), e);
       else log.debug("Creating error document - " + code + ", " + message);
       Document doc = abdera.getFactory().newDocument();
       ExtensibleElement root = 
@@ -84,7 +85,7 @@
     RequestContext request,
     String reason,
     Throwable t) {
-      log.debug("Server error");
+      log.debug(Messages.get("SERVER_ERROR"));
       return returnBase(
         createErrorDocument(
           abdera, 500, 
@@ -99,7 +100,7 @@
     Abdera abdera,
     RequestContext request,
     String reason) {
-      log.debug("Unauthorized");
+      log.debug(Messages.get("UNAUTHORIZED"));
       return returnBase(
         createErrorDocument(
           abdera, 401, 
@@ -114,7 +115,7 @@
     Abdera abdera,
     RequestContext request,
     String reason) {
-      log.debug("Forbidden");
+      log.debug(Messages.get("FORBIDDEN"));
       return returnBase(
         createErrorDocument(
           abdera, 403, 
@@ -129,7 +130,7 @@
     Abdera abdera,
     RequestContext request,
     String reason) {
-    log.debug("Unknown");
+    log.debug(Messages.get("UNKNOWN"));
     return returnBase(
       createErrorDocument(
         abdera, 404, 
@@ -145,7 +146,7 @@
     RequestContext request,
     String reason,
     String... methods) {
-      log.debug("Not Allowed"); 
+      log.debug(Messages.get("NOT.ALLOWED")); 
       BaseResponseContext resp = 
         (BaseResponseContext)returnBase(
           createErrorDocument(
@@ -163,7 +164,7 @@
     Abdera abdera,
     RequestContext request,
     String reason) {
-      log.debug("Bad Request");
+      log.debug(Messages.get("BAD.REQUEST"));
       return returnBase(
         createErrorDocument(
           abdera, 400, 
@@ -178,7 +179,7 @@
     Abdera abdera,
     RequestContext request,
     String reason) {
-    log.debug("Conflict");
+    log.debug(Messages.get("CONFLICT"));
       return returnBase(
         createErrorDocument(
           abdera, 409, 
@@ -193,7 +194,7 @@
     Abdera abdera,
     RequestContext request,
     String reason) {
-      log.debug("Unavailable");
+      log.debug(Messages.get("UNAVAILABLE"));
       return returnBase(
         createErrorDocument(
           abdera, 503, 
@@ -205,7 +206,7 @@
     Abdera abdera, 
     RequestContext request,
     String reason) {
-      log.debug("Not modified");
+      log.debug(Messages.get("NOT.MODIFIED"));
       EmptyResponseContext rc = new EmptyResponseContext(304);
       rc.setStatusText(reason);
       return rc;
@@ -215,7 +216,7 @@
     Abdera abdera, 
     RequestContext request,
     String reason) {
-      log.debug("Precondition failed");
+      log.debug(Messages.get("PRECONDITION.FAILED"));
       return returnBase(
         createErrorDocument(
           abdera, 412, 
@@ -230,7 +231,7 @@
     Abdera abdera,
     RequestContext request,
     String reason) {
-      log.debug("Not supported");
+      log.debug(Messages.get("NOT.SUPPORTED"));
       return returnBase(
         createErrorDocument(
           abdera, 415, 
@@ -245,7 +246,7 @@
     Abdera abdera,
     RequestContext request,
     String reason) {
-      log.debug("Locked");
+      log.debug(Messages.get("LOCKED"));
       return returnBase(
         createErrorDocument(
           abdera, 423,
@@ -261,7 +262,7 @@
     Base base, 
     int status,
     Date lastModified) {
-      log.debug("Returning Abdera document");
+      log.debug(Messages.get("RETURNING.DOCUMENT"));
       BaseResponseContext response = new BaseResponseContext(base);
       response.setStatus(status);
       if (lastModified != null) response.setLastModified(lastModified);
@@ -280,14 +281,14 @@
    * the slug are replaced with an underscore
    */
   protected String sanitizeSlug(String slug) {
-    if (slug == null) throw new IllegalArgumentException("Slug cannot be null");
+    if (slug == null) throw new IllegalArgumentException(Messages.get("SLUG.NOT.NULL"));
     String sanitized = EncodingUtil.sanitize(slug);
-    log.debug("Sanitized slug '" + slug + "' to '" + sanitized + "'");
+    log.debug(Messages.format("SLUG.SANITIZED", slug, sanitized));
     return sanitized;
   }
 
   protected int getDefaultPageSize() {
-    log.debug("Getting default page size: " + defaultpagesize);
+    log.debug(Messages.format("DEFAULT.PAGE.SIZE",defaultpagesize));
     return defaultpagesize;
   }
   
@@ -302,7 +303,7 @@
         size = (_ps != null) ? 
           Math.min(Math.max(Integer.parseInt(_ps),0),max) : max;
       } catch (Exception e) {}
-      log.debug("Getting page size: " + size);
+      log.debug(Messages.format("PAGE.SIZE",size));
       return size;
   }
   
@@ -317,7 +318,7 @@
         page = Math.max(page, 1) - 1;
         offset = pageSize * page;
       } catch (Exception e) {}
-      log.debug("Getting offset: " + offset);
+      log.debug(Messages.format("OFFSET",offset));
       return offset;
   }
   
@@ -343,15 +344,15 @@
             content.getContentType() == Content.Type.MEDIA || 
             content.getContentType() == Content.Type.XML) &&
             entry.getSummary() == null) {
-          log.debug("Checking valid entry: " + false);
+          log.debug(Messages.format("CHECKING.VALID.ENTRY",false));
           return false;
         }
       }
     } catch (Exception e) {
-      log.debug("Checking valid entry: " + false);
+      log.debug(Messages.format("CHECKING.VALID.ENTRY",false));
       return false;
     }
-    log.debug("Checking valid entry: " + true);
+    log.debug(Messages.format("CHECKING.VALID.ENTRY",true));
     return true;
   }
   
@@ -375,7 +376,7 @@
       ignore.add(org.apache.abdera.util.Constants.XML_NS);
       checkEntryAddAdditionalNamespaces(ignore);
       boolean answer = checkElement(entry,ignore);
-      log.debug("Checking entry namespaces: " + answer);
+      log.debug(Messages.format("CHECKING.ENTRY.NAMESPACES",answer));
       return answer;
   }
   
@@ -417,9 +418,9 @@
   public ResponseContext request(RequestContext request) {
     TargetType type = request.getTarget().getType();
     String method = request.getMethod();
-    log.debug("Target type: " + type);
-    log.debug("Target id: " + request.getTarget().getIdentity());
-    log.debug("Method: " + method);
+    log.debug(Messages.format("TARGET.TYPE",type));
+    log.debug(Messages.format("TARGET.ID",request.getTarget().getIdentity()));
+    log.debug(Messages.format("METHOD",method));
     if (method.equals("GET")) {
       if (type == TargetType.TYPE_SERVICE) {
         return getService(request);
@@ -489,7 +490,7 @@
     return notallowed(
       request.getAbdera(), 
       request, 
-      "Not Allowed", 
+      Messages.get("NOT.ALLOWED"), 
       getAllowedMethods(
         request.getTarget().getType()));
   }
@@ -518,7 +519,7 @@
       return notallowed(
         request.getAbdera(), 
         request, 
-        "Not Allowed", 
+        Messages.get("NOT.ALLOWED"), 
         getAllowedMethods(
           request.getTarget().getType()));
   }
@@ -528,7 +529,7 @@
       return notallowed(
         request.getAbdera(), 
         request, 
-        "Not Allowed", 
+        Messages.get("NOT.ALLOWED"), 
         getAllowedMethods(
           request.getTarget().getType()));
   } 

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractRequestContext.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractRequestContext.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractRequestContext.java (original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractRequestContext.java Thu Jul 19 17:58:59 2007
@@ -32,6 +32,7 @@
 import org.apache.abdera.protocol.server.ServiceContext;
 import org.apache.abdera.protocol.server.Target;
 import org.apache.abdera.protocol.util.AbstractRequest;
+import org.apache.abdera.util.Messages;
 import org.apache.abdera.i18n.iri.IRI;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -70,7 +71,7 @@
   public synchronized <T extends Element>Document<T> getDocument()
     throws ParseException, 
            IOException {
-    log.debug("Parsing request document");
+    log.debug(Messages.get("PARSING.REQUEST.DOCUMENT"));
     if (document == null) {
       Abdera abdera = context.getAbdera();
       Parser parser = abdera.getParser();
@@ -84,7 +85,7 @@
     Parser parser)
       throws ParseException, 
              IOException {
-    log.debug("Parsing request document");
+    log.debug(Messages.get("PARSING.REQUEST.DOCUMENT"));
     if (document == null) {
       ParserOptions options = parser.getDefaultParserOptions();
       document = getDocument(parser, options);
@@ -97,7 +98,7 @@
     ParserOptions options)
      throws ParseException, 
             IOException  {
-    log.debug("Parsing request document");
+    log.debug(Messages.get("PARSING.REQUEST.DOCUMENT"));
     if (document == null) {
       Abdera abdera = context.getAbdera();
       Parser parser = abdera.getParser();
@@ -112,7 +113,7 @@
     ParserOptions options) 
       throws ParseException, 
              IOException {
-    log.debug("Parsing request document");
+    log.debug(Messages.get("PARSING.REQUEST.DOCUMENT"));
     if (document == null) {
       return parser.parse(
         getInputStream(), 

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractRequestHandler.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractRequestHandler.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractRequestHandler.java (original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractRequestHandler.java Thu Jul 19 17:58:59 2007
@@ -34,6 +34,7 @@
 import org.apache.abdera.protocol.server.ResponseContext;
 import org.apache.abdera.protocol.server.ServiceContext;
 import org.apache.abdera.protocol.server.Target;
+import org.apache.abdera.util.Messages;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -48,24 +49,24 @@
     HttpServletResponse response) 
       throws IOException {
     
-    log.debug("Processing the request");
+    log.debug(Messages.get("PROCESSING.REQUEST"));
     ItemManager<Provider> manager = context.getProviderManager();
     Provider provider = manager.get(request);
-    log.debug("Using provider - " + provider);
+    log.debug(Messages.format("USING.PROVIDER",provider));
     try {
       if (preconditions(provider, request, response)) {
         output(response,provider.request(request));
       }
     } catch (Throwable e) {
-      log.error("Error producing output", e);
+      log.error(Messages.get("OUTPUT.ERROR"), e);
       try {
         output(response,new EmptyResponseContext(500));
       } catch (Exception ex) {
-        log.error("Error outputting error", ex);
+        log.error(Messages.get("OUTPUT.ERROR"), ex);
         response.sendError(500);
       }
     } finally {
-      log.debug("Releasing provider - " + provider);
+      log.debug(Messages.format("RELEASING.PROVIDER", provider));
       if (provider != null) manager.release(provider);
     }
   }
@@ -147,11 +148,11 @@
   }
     
   protected void noprovider(HttpServletResponse response) throws IOException {
-    response.sendError(500, "No Provider");
+    response.sendError(500, Messages.get("NO.PROVIDER"));
   }
   
   protected void notfound(HttpServletResponse response) throws IOException {
-    response.sendError(404, "Not Found");
+    response.sendError(404, Messages.get("NOT.FOUND"));
   }
   
   protected void notallowed(
@@ -159,7 +160,7 @@
     String method, 
     String[] methods) 
       throws IOException {
-    response.sendError(405, "Method '" + method + "' Not Allowed");
+    response.sendError(405, Messages.format("METHOD.NOT.ALLOWED", method));
     response.setHeader("Allow", combine(methods));;
   }
   

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractResponseContext.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractResponseContext.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractResponseContext.java (original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractResponseContext.java Thu Jul 19 17:58:59 2007
@@ -30,6 +30,7 @@
 import org.apache.abdera.protocol.util.AbstractResponse;
 import org.apache.abdera.protocol.util.EncodingUtil;
 import org.apache.abdera.util.EntityTag;
+import org.apache.abdera.util.Messages;
 import org.apache.abdera.writer.Writer;
 
 public abstract class AbstractResponseContext
@@ -228,7 +229,7 @@
     if (slug.indexOf((char)10) > -1 ||
         slug.indexOf((char)13) > -1)
       throw new IllegalArgumentException(
-        "The slug must not contain ASCII carriage return or linefeed characters");
+        Messages.get("SLUG.BAD.CHARACTERS"));
     setEscapedHeader("Slug", Constants.ASCIISANSCRLF, slug);
   }
   

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/DefaultServiceContext.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/DefaultServiceContext.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/DefaultServiceContext.java (original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/DefaultServiceContext.java Thu Jul 19 17:58:59 2007
@@ -25,6 +25,7 @@
 import org.apache.abdera.protocol.server.RequestHandler;
 import org.apache.abdera.protocol.server.Target;
 import org.apache.abdera.protocol.server.util.ServerConstants;
+import org.apache.abdera.util.Messages;
 import org.apache.abdera.util.ServiceUtil;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -45,14 +46,14 @@
   private Object instance(String id, String _default) {
     String instance = getProperty(id);
     Object obj =  ServiceUtil.newInstance( id, (instance!=null)?instance:_default, abdera);
-    logger.debug("Returning " + obj + " as instance of '" + id + "'.");
+    logger.debug(Messages.format("RETURNING.INSTANCE", obj, id));
     return obj;
   }
   
   private Object instance(String id, String _default, Object... args) {
     String instance = getProperty(id);
     Object obj =  ServiceUtil.newInstance( id, (instance!=null)?instance:_default, abdera, args);
-    logger.debug("Returning " + obj + " as instance of '" + id + "'.");
+    logger.debug(Messages.format("RETURNING.INSTANCE", obj, id));
     return obj;
   }
   

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/HttpServletRequestContext.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/HttpServletRequestContext.java?view=diff&rev=557830&r1=557829&r2=557830
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/HttpServletRequestContext.java (original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/HttpServletRequestContext.java Thu Jul 19 17:58:59 2007
@@ -33,6 +33,7 @@
 import org.apache.abdera.protocol.server.RequestContext;
 import org.apache.abdera.protocol.server.ServiceContext;
 import org.apache.abdera.protocol.server.Target;
+import org.apache.abdera.util.Messages;
 import org.apache.abdera.i18n.iri.IRI;
 
 public class HttpServletRequestContext 
@@ -88,7 +89,7 @@
       case SERVERNAME:        return request.getServerName();
       case SERVERPORT:        return request.getServerPort();
       default:
-        throw new UnsupportedOperationException("Property not supported"); 
+        throw new UnsupportedOperationException(Messages.get("PROPERTY.NOT.SUPPORTED")); 
     }
   }
   



Mime
View raw message