incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r427760 [4/4] - in /incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad: bean/ bean/util/ change/ component/ config/ context/ convert/ event/ logging/ model/ render/ resource/ util/ validator/ webapp/
Date Tue, 01 Aug 2006 22:00:48 GMT
Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Base64InputStream.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Base64InputStream.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Base64InputStream.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Base64InputStream.java
Tue Aug  1 15:00:44 2006
@@ -55,14 +55,15 @@
    * @return The byte read, as an integer, 
    *         or -1 if the end of the stream has been reached 
    * 
-   * */
+   */
+  @Override
   public int read() throws IOException
   {
     int result = -1;
     
     if ( _byteBufferIndex <= _maxByteBufferIndex ) 
     {
-      result = (int)_byteBuffer[ _byteBufferIndex ];
+      result = _byteBuffer[_byteBufferIndex];
       result = result & 0xff;
       _byteBufferIndex++;
     } 
@@ -182,6 +183,10 @@
       return 0;
     }
   }
+
+  /** the number of base64 encoded characters to read from reader at a time **/
+  /** this number should be a multiple of 4 **/
+  private static final int _QUANTUM_SIZE = 512;
   
   /** input stream of base64 encoded data **/
   private final Reader  _in;
@@ -194,8 +199,4 @@
  
   /** contains decoded bytes  **/
   private byte[]  _byteBuffer;
-
-  /** the number of base64 encoded characters to read from reader at a time **/
-  /** this number should be a multiple of 4 **/
-  private static final int _QUANTUM_SIZE = 512;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Base64OutputStream.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Base64OutputStream.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Base64OutputStream.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Base64OutputStream.java
Tue Aug  1 15:00:44 2006
@@ -44,7 +44,8 @@
    *  Takes a byte writes it out to the writer
    * 
    * @param b   a byte
-   **/
+   */
+  @Override
   public void write(int b) throws IOException
   {
     _single[0] = (byte)b;
@@ -72,8 +73,8 @@
    * @param b        the data
    * @param off      the start offset in the data
    * @param len      the number of bytes to read
-   **/
-   
+   */
+  @Override
   public void write(byte[] b, int off, int len) 
                                       throws IOException, NullPointerException
   {
@@ -175,8 +176,7 @@
    * called only if there will be no subsequent calls to a write method.  
    * Subsequent calls to the write method will result in incorrect encoding.
    * 
-   **/
-  
+   */
   public void finish() throws IOException
   {
     if (_numLeftoverBytes==1) 
@@ -309,8 +309,8 @@
    * 
    * @param c an integer whose lower 6 bits contain the base64 representation
    *          all other bits should be zero
-   * **/
-  static private char _encode(int c) 
+   */
+  private static char _encode(int c) 
   {
     if (c < 26)
       return (char)('A' + c);
@@ -319,9 +319,9 @@
     if (c < 62)
       return (char)('0' + (c-52));
     if (c == 62)
-      return (char)'+';
+      return '+';
     if (c == 63)
-      return (char)'/';
+      return '/';
       
     // error, not a valid B64 char
     return (char)0;

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ClassLoaderUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ClassLoaderUtils.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ClassLoaderUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ClassLoaderUtils.java
Tue Aug  1 15:00:44 2006
@@ -39,6 +39,11 @@
  */
 public class ClassLoaderUtils
 {
+  // Utility class only, no instances
+  private ClassLoaderUtils()
+  {
+  }
+  
   /**
    * Loads the class with the specified name.  For Java 2 callers, the
    * current thread's context class loader is preferred, falling back on the
@@ -49,7 +54,7 @@
    * @return    the resulting <code>Class</code> object
    * @exception ClassNotFoundException if the class was not found
    */
-  static public Class loadClass(
+  public static Class<?> loadClass(
     String name) throws ClassNotFoundException
   {
     return loadClass(name, null);
@@ -64,7 +69,7 @@
    * @param     name  the name of the resource
    * @return    the resulting <code>URL</code> object
    */
-  static public URL getResource(
+  public static URL getResource(
     String name)
   {
     return getResource(name, null);
@@ -79,7 +84,7 @@
    * @param     name  the name of the resource
    * @return    the resulting <code>InputStream</code> object
    */
-  static public InputStream getResourceAsStream(
+  public static InputStream getResourceAsStream(
     String name)
   {
     return getResourceAsStream(name, null);
@@ -97,11 +102,11 @@
    * @return    the resulting <code>Class</code> object
    * @exception ClassNotFoundException if the class was not found
    */
-  static public Class loadClass(
+  public static Class<?> loadClass(
     String      name,
     ClassLoader callerClassLoader) throws ClassNotFoundException
   {
-    Class clazz = null;
+    Class<?> clazz = null;
 
     try
     {
@@ -138,7 +143,7 @@
    * @param     callerClassLoader  the calling class loader context
    * @return    the resulting <code>URL</code> object
    */
-  static public URL getResource(
+  public static URL getResource(
     String      name,
     ClassLoader callerClassLoader)
   {
@@ -171,7 +176,7 @@
    * @param     callerClassLoader  the calling class loader context
    * @return    the resulting <code>InputStream</code> object
    */
-  static public InputStream getResourceAsStream(
+  public static InputStream getResourceAsStream(
     String      name,
     ClassLoader callerClassLoader)
   {
@@ -197,7 +202,7 @@
    * Dynamically accesses the current context class loader.
    * Returns null if there is no per-thread context class loader.
    */
-  static public ClassLoader getContextClassLoader()
+  public static ClassLoader getContextClassLoader()
   {
     return Thread.currentThread().getContextClassLoader();
   }
@@ -218,19 +223,20 @@
    * @param service the classname of the abstract service class.
    * eg: javax.servlet.Filter
    */
-  static public <T> List<T> getServices(String service)
+  @SuppressWarnings("unchecked")
+  public static <T> List<T> getServices(String service)
   {
     String serviceUri ="META-INF/services/" + service;
     ClassLoader loader = Thread.currentThread().getContextClassLoader();
     try
     {
-      Enumeration urls = loader.getResources(serviceUri);
+      Enumeration<URL> urls = loader.getResources(serviceUri);
       if (urls.hasMoreElements())
       {
         List<T> services = new ArrayList<T>(1);
         do
         {
-          URL url = (URL) urls.nextElement();
+          URL url = urls.nextElement();
           _LOG.finest("Processing:{0}", url);
           try
           {
@@ -281,15 +287,10 @@
     line = line.trim();
     if (line.length() > 0)
     {
-      Class clazz = loader.loadClass(line);
+      Class<?> clazz = loader.loadClass(line);
       return clazz.newInstance();
     }
     return null;
-  }
-
-  // Utility class only, no instances
-  private ClassLoaderUtils()
-  {
   }
 
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ListFromCollection.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ListFromCollection.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ListFromCollection.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ListFromCollection.java
Tue Aug  1 15:00:44 2006
@@ -66,7 +66,7 @@
     _size = _DEFAULT_SIZE;
   }
 
-  public Map<Collection, List> getList()
+  public Map<Collection<?>, List<?>> getList()
   {
     return _map;
   }
@@ -81,9 +81,10 @@
     _size = size;
   }
 
-  private class MakeList extends AbstractMap<Collection, List>
+  private class MakeList extends AbstractMap<Collection<?>, List<?>>
   {
-    public List get(Object o)
+    @Override
+    public List<?> get(Object o)
     {
       if (!(o instanceof Collection))
         return null;
@@ -94,14 +95,15 @@
           (o instanceof RandomAccess))
         return (List) o;
 
-      Collection c = (Collection) o;
+      Collection<?> c = (Collection) o;
       if (c.isEmpty())
         return Collections.EMPTY_LIST;
 
       return new ListImpl(c, getSize());
     }
 
-    public Set<Map.Entry<Collection, List>> entrySet()
+    @Override
+    public Set<Map.Entry<Collection<?>, List<?>>> entrySet()
     {
       // Not worth implementing at the moment;  this Map is only
       // accessed from 
@@ -109,9 +111,9 @@
     }
   }
 
-  static private class ListImpl extends AbstractList
+  private static class ListImpl extends AbstractList<Object>
   {
-    public ListImpl(Collection c, int size)
+    public ListImpl(Collection<?> c, int size)
     {
       _c = c;
       _cSize = c.size();
@@ -120,15 +122,17 @@
       else
         _bufferSize = Math.min(size, _cSize);
 
-      _buffer = new ArrayList(_bufferSize);
+      _buffer = new ArrayList<Object>(_bufferSize);
       _offset = -1;
     }
 
+    @Override
     public int size()
     {
       return _cSize;
     }
 
+    @Override
     public Object get(int index)
     {
       if ((index < 0) || (index >= _cSize))
@@ -146,7 +150,7 @@
 
     private void _loadBuffer(int offset)
     {
-      Iterator iter = _c.iterator();
+      Iterator<? extends Object> iter = _c.iterator();
       int i = 0;
 
       while (i < offset)
@@ -168,14 +172,14 @@
       }
     }
 
-    private final Collection _c;
-    private final int        _bufferSize;
-    private final int        _cSize;
-    private int       _offset;
-    private ArrayList _buffer;
+    private final Collection<? extends Object> _c;
+    private final int         _bufferSize;
+    private final int         _cSize;
+    private int               _offset;
+    private ArrayList<Object> _buffer;
   }
 
-  private Map<Collection, List> _map;
+  private Map<Collection<?>, List<?>> _map;
   private int                   _size;
 
   static private int _DEFAULT_SIZE = 50;

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/LocaleUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/LocaleUtils.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/LocaleUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/LocaleUtils.java
Tue Aug  1 15:00:44 2006
@@ -73,15 +73,6 @@
     return new ErrorMessages(summary, detail);
   }
 
-  private static ClassLoader _getClassLoader()
-  {
-    ClassLoader loader = Thread.currentThread().getContextClassLoader();
-    if (loader == null)
-      loader = ClassLoader.getSystemClassLoader();
-
-    return loader;
-  }
-
   static String __getSummaryString(
     FacesContext context,
     String messageId)
@@ -107,6 +98,15 @@
 
   }
 
+  private static ClassLoader _getClassLoader()
+  {
+    ClassLoader loader = Thread.currentThread().getContextClassLoader();
+    if (loader == null)
+      loader = ClassLoader.getSystemClassLoader();
+
+    return loader;
+  }
+
   private static String _getDetailKey(
     String messageId)
   {
@@ -218,7 +218,7 @@
 
   private static ResourceBundle _getCachedBundle(Locale locale)
   {
-    return (ResourceBundle) _bundleCache.get(locale);
+    return _bundleCache.get(locale);
   }
 
   private static void _cacheBundle(Locale locale, ResourceBundle bundle)
@@ -283,11 +283,11 @@
     = "org.apache.myfaces.trinidad.resource.MessageBundle";
 
   // cache Bundles based on locale
-  private static  Map  _bundleCache;
+  private static  Map<Locale, ResourceBundle>  _bundleCache;
 
   static
   {
-    _bundleCache = Collections.synchronizedMap(new HashMap(13));
+    _bundleCache = Collections.synchronizedMap(new HashMap<Locale, ResourceBundle>(13));
   }
 
   static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(LocaleUtils.class);

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/MessageFactory.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/MessageFactory.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/MessageFactory.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/MessageFactory.java
Tue Aug  1 15:00:44 2006
@@ -525,11 +525,13 @@
       _messageStrings = messageStrings;
     }
 
+    @Override
     public String getDetail()
     {
       return _messageStrings.getDetailMessage();
     }
 
+    @Override
     public String getSummary()
     {
       return _messageStrings.getMessage();
@@ -559,6 +561,7 @@
         throw new NullPointerException();
     }
 
+    @Override
     public String getMessage()
     {
       String pattern = super.getMessage();
@@ -566,6 +569,7 @@
       return _getFormattedString(pattern, _resolvedParameters);
     }
 
+    @Override
     public String getDetailMessage()
     {
       String pattern = super.getDetailMessage();
@@ -617,6 +621,7 @@
     // Currently only detail message can be customized. So we override the
     // detail message. If summary is to be overridden we have to do the
     // same to it also.
+    @Override
     public String getDetailMessage()
     {
       FacesContext context    = FacesContext.getCurrentInstance();
@@ -656,11 +661,13 @@
       _parameters = parameters;
     }
 
+    @Override
     public String getMessage()
     {
       return _getFormattedString(super.getMessage(), _parameters);
     }
 
+    @Override
     public String getDetailMessage()
     {
       return _getFormattedString(super.getDetailMessage(), _parameters);

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Service.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Service.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Service.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/Service.java
Tue Aug  1 15:00:44 2006
@@ -71,6 +71,7 @@
    * @return an object of type <code>serviceClass</code>, or null
    *   if no such object could be located
    */
+  @SuppressWarnings("unchecked")
   static public <T> T getService(Object from, Class<T> serviceClass)
   {
     if (from == null)

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ByteLengthValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ByteLengthValidator.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ByteLengthValidator.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ByteLengthValidator.java
Tue Aug  1 15:00:44 2006
@@ -284,6 +284,7 @@
    * @return true if and only if the specified Object is a ByteLengthValidator
    * and if the values encoding, maximum and transient are equal.
    */
+  @Override
   public boolean equals(Object object)
   {
 
@@ -314,6 +315,7 @@
   * <p>Returns the hash code for this Validator.</p>
   * @return a hash code value for this object.
   */
+  @Override
   public int hashCode()
   {
     int result = 17;

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateTimeRangeValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateTimeRangeValidator.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateTimeRangeValidator.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateTimeRangeValidator.java
Tue Aug  1 15:00:44 2006
@@ -372,6 +372,7 @@
     return ValidatorUtils.getValueBinding(_facesBean, name);
   }
 
+  @Override
   public boolean equals(Object o)
   {
     if ( o instanceof DateTimeRangeValidator)
@@ -395,6 +396,7 @@
     return false;
   }
 
+  @Override
   public int hashCode()
   {
     int result = 17;

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/RegExpValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/RegExpValidator.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/RegExpValidator.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/RegExpValidator.java
Tue Aug  1 15:00:44 2006
@@ -206,6 +206,7 @@
    * @return true if and only if the specified Object is a PatternValidator
    * and if the values pattern and transient are equal.
    */
+  @Override
   public boolean equals(Object object)
   {
     if (this == object)
@@ -231,6 +232,7 @@
    * <p>Returns the hash code for this Validator.</p>
    * @return a hash code value for this object.
    */
+  @Override
   public int hashCode()
   {
     int result = 17;

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ValidatorUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ValidatorUtils.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ValidatorUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/ValidatorUtils.java
Tue Aug  1 15:00:44 2006
@@ -60,6 +60,7 @@
   {
     FacesBeanImpl bean = new FacesBeanImpl()
                            {
+                             @Override
                              public FacesBean.Type getType()
                              {
                                return type;

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java
Tue Aug  1 15:00:44 2006
@@ -81,16 +81,22 @@
 public class ResourceServlet extends HttpServlet
 {
   /**
-   * Context parameter for activating debug mode, which will disable
-   * caching.
+   * Override of Servlet.destroy();
    */
-  static public final String DEBUG_INIT_PARAM =
-    "org.apache.myfaces.trinidad.resource.DEBUG";
-
+  @Override
+  public void destroy()
+  {
+    _loaders = null;
+    _facesContextFactory = null;
+    _lifecycle = null;
 
+    super.destroy();
+  }
+  
   /**
    * Override of Servlet.init();
    */
+  @Override
   public void init(
     ServletConfig config
     ) throws ServletException
@@ -120,22 +126,10 @@
     // Acquire our Lifecycle instance
     _lifecycle = new _ResourceLifecycle();
     _initDebug(config);
-    _loaders = new HashMap();
-  }
-
-  /**
-   * Override of Servlet.destroy();
-   */
-  public void destroy()
-  {
-    _loaders = null;
-    _facesContextFactory = null;
-    _lifecycle = null;
-
-    super.destroy();
+    _loaders = new HashMap<String, ResourceLoader>();
   }
 
-
+  @Override
   public void service(
     ServletRequest  request,
     ServletResponse response
@@ -168,6 +162,7 @@
   /**
    * Override of HttpServlet.doGet()
    */
+  @Override
   protected void doGet(
     HttpServletRequest request,
     HttpServletResponse response
@@ -215,6 +210,7 @@
   /**
    * Override of HttpServlet.getLastModified()
    */
+  @Override
   protected long getLastModified(
     HttpServletRequest request)
   {
@@ -260,7 +256,7 @@
     HttpServletRequest request)
   {
     final String servletPath = request.getServletPath();
-    ResourceLoader loader = (ResourceLoader)_loaders.get(servletPath);
+    ResourceLoader loader = _loaders.get(servletPath);
 
     if (loader == null)
     {
@@ -277,10 +273,10 @@
           Reader r = new InputStreamReader(url.openStream());
           BufferedReader br = new BufferedReader(r);
           String className = br.readLine().trim();
-          Class clazz = cl.loadClass(className);
+          Class<?> clazz = cl.loadClass(className);
           try
           {
-            Constructor decorator = clazz.getConstructor(_DECORATOR_SIGNATURE);
+            Constructor<?> decorator = clazz.getConstructor(_DECORATOR_SIGNATURE);
             ServletContext context = getServletContext();
             File tempdir = (File)
                       context.getAttribute("javax.servlet.context.tempdir");
@@ -308,8 +304,9 @@
                        new Object[] {servletPath, key});
           loader = new ServletContextResourceLoader(getServletContext())
                    {
+                     @Override
                      public URL getResource(
-                      String path) throws IOException
+                       String path) throws IOException
                      {
                        return super.getResource(path);
                      }
@@ -431,7 +428,7 @@
     }
   }
 
-  static private boolean _canIgnore(Throwable t)
+  private static boolean _canIgnore(Throwable t)
   {
     if (t instanceof InterruptedIOException)
     {
@@ -461,44 +458,56 @@
 
   private class _ResourceLifecycle extends Lifecycle
   {
+    @Override
     public void execute(FacesContext p0) throws FacesException
     {
     }
 
+    @Override
     public PhaseListener[] getPhaseListeners()
     {
       return null;
     }
 
+    @Override
     public void removePhaseListener(PhaseListener p0)
     {
     }
 
+    @Override
     public void render(FacesContext p0) throws FacesException
     {
     }
 
+    @Override
     public void addPhaseListener(PhaseListener p0)
     {
     }
   }
 
-
-  private boolean   _debug;
-  private Map       _loaders;
-  private FacesContextFactory _facesContextFactory;
-  private Lifecycle _lifecycle;
-
-  // Size of buffer used to read in resource contents
-  static private final int _BUFFER_SIZE = 2048;
+  /**
+   * Context parameter for activating debug mode, which will disable
+   * caching.
+   */
+  public static final String DEBUG_INIT_PARAM =
+    "org.apache.myfaces.trinidad.resource.DEBUG";
 
   // One year in milliseconds.  (Actually, just short of on year, since
   // RFC 2616 says Expires should not be more than one year out, so
   // cutting back just to be safe.)
-  static public final long ONE_YEAR_MILLIS = 31363200000L;
+  public static final long ONE_YEAR_MILLIS = 31363200000L;
 
-  static private final Class[] _DECORATOR_SIGNATURE =
+  
+  private static final Class[] _DECORATOR_SIGNATURE =
                                   new Class[]{ResourceLoader.class};
 
-  static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(ResourceServlet.class);
+  private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(ResourceServlet.class);
+
+  // Size of buffer used to read in resource contents
+  private static final int _BUFFER_SIZE = 2048;
+
+  private boolean _debug;
+  private Map<String, ResourceLoader> _loaders;
+  private FacesContextFactory _facesContextFactory;
+  private Lifecycle _lifecycle;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/TrinidadFilter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/TrinidadFilter.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/TrinidadFilter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/TrinidadFilter.java
Tue Aug  1 15:00:44 2006
@@ -46,7 +46,7 @@
     {
       try
       {
-        Class proxiedClass = loader.loadClass(
+        Class<?> proxiedClass = loader.loadClass(
                       "org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl");
         _proxied = (Filter) proxiedClass.newInstance();
         _proxied.init(filterConfig);
@@ -92,7 +92,7 @@
       chain.doFilter(request, response);
   }
 
-  private Filter _proxied;
-
   private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(TrinidadFilter.class);
+
+  private Filter _proxied;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java?rev=427760&r1=427759&r2=427760&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
Tue Aug  1 15:00:44 2006
@@ -52,11 +52,13 @@
   {
   }
 
+  @Override
   public void setId(String id)
   {
     _id = id;
   }
 
+  @Override
   public void setRendered(String rendered)
   {
     _rendered = rendered;
@@ -67,6 +69,7 @@
     _attributeChangeListener = attributeChangeListener;
   }
 
+  @Override
   public int doStartTag() throws JspException
   {
     _parentELContext = (ELContextTag)
@@ -102,6 +105,7 @@
     return retVal;
   }
 
+  @Override
   public int doEndTag() throws JspException
   {
     UIComponent component = getComponentInstance();
@@ -110,6 +114,7 @@
     return super.doEndTag();
   }
 
+  @Override
   protected void encodeBegin() throws java.io.IOException
   {
     UIComponent component = getComponentInstance();
@@ -118,6 +123,7 @@
     super.encodeBegin();
   }
 
+  @Override
   protected final void setProperties(UIComponent component)
   {
     super.setProperties(component);
@@ -430,7 +436,7 @@
     if (stringValue == null)
       return null;
 
-    ArrayList list = new ArrayList(5);
+    ArrayList<String> list = new ArrayList<String>(5);
 
     int     length = stringValue.length();
     boolean inSpace = true;
@@ -471,7 +477,7 @@
     if (list.isEmpty())
       return null;
 
-    return (String[]) list.toArray(new String[list.size()]);
+    return list.toArray(new String[list.size()]);
   }
 
   private static void _applyChanges(
@@ -480,14 +486,14 @@
     boolean isCreated)
   {
     RequestContext afc = RequestContext.getCurrentInstance();
-    Iterator changeIter =
+    Iterator<ComponentChange> changeIter =
                   afc.getChangeManager().getComponentChanges(facesContext, uiComponent);
 
     if (changeIter == null)
       return;
     while (changeIter.hasNext())
     {
-      ComponentChange change = (ComponentChange)changeIter.next();
+      ComponentChange change = changeIter.next();
 
       //pu: If we did not create the component during tag execution, do not
       //  apply any AttributeChange. This is because we do not have enough
@@ -516,15 +522,15 @@
     }
   }
 
-  private String       _rendered;
-  private String       _id;
-  private String       _attributeChangeListener;
-  private String       _validationError;
-  private ELContextTag _parentELContext;
+  private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(UIXComponentTag.class);
 
   // We rely strictly on ISO 8601 formats
   private static DateFormat  _ISO_DATE_FORMAT =
     new SimpleDateFormat("yyyy-MM-dd");
 
-  static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(UIXComponentTag.class);
+  private String       _rendered;
+  private String       _id;
+  private String       _attributeChangeListener;
+  private String       _validationError;
+  private ELContextTag _parentELContext;
 }



Mime
View raw message