Author: gseitz
Date: Wed May 14 14:06:51 2008
New Revision: 656434

URL: http://svn.apache.org/viewvc?rev=656434&view=rev
Log:
generics cleanup

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/ComponentTag.java
    
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/HtmlHandler.java
    
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/TagTypeHandler.java
    
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java

Modified: 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/ComponentTag.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/ComponentTag.java?rev=656434&r1=656433&r2=656434&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/ComponentTag.java 
(original)
+++ 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/ComponentTag.java 
Wed May 14 14:06:51 2008
@@ -18,7 +18,6 @@
 
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -90,7 +89,7 @@
         * about the tags origin is lost. In some cases like wicket:head and 
wicket:link this
         * information however is required.
         */
-       private WeakReference<Class< ? extends Component< ? >>> markupClassRef 
= null;
+       private WeakReference<Class<? extends Component<?>>> markupClassRef = 
null;
 
        /**
         * Tags which are detected to have only an open tag, which is allowed 
with some HTML tags like
@@ -109,9 +108,9 @@
         * based on this XmlTag.
         * 
         * @param name
-        *            The name of html tag
+        *              The name of html tag
         * @param type
-        *            The type of tag
+        *              The type of tag
         */
        public ComponentTag(final String name, final XmlTag.Type type)
        {
@@ -125,7 +124,7 @@
         * Construct.
         * 
         * @param tag
-        *            The underlying xml tag
+        *              The underlying xml tag
         */
        public ComponentTag(final XmlTag tag)
        {
@@ -171,14 +170,14 @@
                        return lst.iterator();
                }
 
-    return Collections.unmodifiableCollection(behaviors).iterator();
+               return Collections.unmodifiableCollection(behaviors).iterator();
        }
 
        /**
         * Gets whether this tag closes the provided open tag.
         * 
         * @param open
-        *            The open tag
+        *              The open tag
         * @return True if this tag closes the given open tag
         */
        @Override
@@ -197,7 +196,7 @@
         * bookmarkable URLs.
         * 
         * @param autolink
-        *            enable/disable automatic href conversion
+        *              enable/disable automatic href conversion
         */
        public final void enableAutolink(final boolean autolink)
        {
@@ -282,7 +281,7 @@
        /**
         * @see org.apache.wicket.markup.parser.XmlTag#getString(String)
         * @param key
-        *            The key
+        *              The key
         * @return The string value
         */
        public final CharSequence getString(String key)
@@ -332,7 +331,7 @@
 
        /**
         * @param id
-        *            Required component id
+        *              Required component id
         * @return True if this tag is an open tag with the given component name
         * @see org.apache.wicket.markup.parser.XmlTag#isOpen()
         */
@@ -352,7 +351,7 @@
 
        /**
         * @param id
-        *            Required component id
+        *              Required component id
         * @return True if this tag is an openclose tag with the given 
component id
         * @see org.apache.wicket.markup.parser.XmlTag#isOpenClose()
         */
@@ -401,11 +400,11 @@
        }
 
        /**
-        * Copies all internal properties from this tag to <code>dest</code>. 
This is basically
-        * cloning without instance creation.
+        * Copies all internal properties from this tag to <code>dest</code>. 
This is basically cloning
+        * without instance creation.
         * 
         * @param dest
-        *            tag whose properties will be set
+        *              tag whose properties will be set
         */
        void copyPropertiesTo(final ComponentTag dest)
        {
@@ -427,9 +426,9 @@
        /**
         * @see org.apache.wicket.markup.parser.XmlTag#put(String, boolean)
         * @param key
-        *            The key
+        *              The key
         * @param value
-        *            The value
+        *              The value
         */
        public final void put(final String key, final boolean value)
        {
@@ -439,9 +438,9 @@
        /**
         * @see org.apache.wicket.markup.parser.XmlTag#put(String, int)
         * @param key
-        *            The key
+        *              The key
         * @param value
-        *            The value
+        *              The value
         */
        public final void put(final String key, final int value)
        {
@@ -451,9 +450,9 @@
        /**
         * @see org.apache.wicket.markup.parser.XmlTag#put(String, CharSequence)
         * @param key
-        *            The key
+        *              The key
         * @param value
-        *            The value
+        *              The value
         */
        public final void put(String key, CharSequence value)
        {
@@ -463,9 +462,9 @@
        /**
         * @see org.apache.wicket.markup.parser.XmlTag#put(String, StringValue)
         * @param key
-        *            The key
+        *              The key
         * @param value
-        *            The value
+        *              The value
         */
        public final void put(String key, StringValue value)
        {
@@ -475,7 +474,7 @@
        /**
         * @see org.apache.wicket.markup.parser.XmlTag#putAll(Map)
         * @param map
-        *            a key/value map
+        *              a key/value map
         */
        public final void putAll(final Map<String, Object> map)
        {
@@ -485,7 +484,7 @@
        /**
         * @see org.apache.wicket.markup.parser.XmlTag#remove(String)
         * @param key
-        *            The key to remove
+        *              The key to remove
         */
        public final void remove(String key)
        {
@@ -514,7 +513,7 @@
         * wicket:id="componentId".
         * 
         * @param id
-        *            The component's id assigned to the tag.
+        *              The component's id assigned to the tag.
         */
        public final void setId(final String id)
        {
@@ -524,7 +523,7 @@
        /**
         * @see org.apache.wicket.markup.parser.XmlTag#setName(String)
         * @param name
-        *            New tag name
+        *              New tag name
         */
        public final void setName(String name)
        {
@@ -534,7 +533,7 @@
        /**
         * @see org.apache.wicket.markup.parser.XmlTag#setNamespace(String)
         * @param namespace
-        *            New tag name namespace
+        *              New tag name namespace
         */
        public final void setNamespace(String namespace)
        {
@@ -545,9 +544,9 @@
         * Assuming this is a close tag, assign it's corresponding open tag.
         * 
         * @param tag
-        *            the open-tag
+        *              the open-tag
         * @throws RuntimeException
-        *             if 'this' is not a close tag
+        *              if 'this' is not a close tag
         */
        public final void setOpenTag(final ComponentTag tag)
        {
@@ -559,7 +558,7 @@
         * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT.
         * 
         * @param type
-        *            The new type
+        *              The new type
         */
        public final void setType(final Type type)
        {
@@ -606,11 +605,11 @@
         * Write the tag to the response
         * 
         * @param response
-        *            The response to write to
+        *              The response to write to
         * @param stripWicketAttributes
-        *            if true, wicket:id are removed from output
+        *              if true, wicket:id are removed from output
         * @param namespace
-        *            Wicket's namespace to use
+        *              Wicket's namespace to use
         */
        public final void writeOutput(final Response response, final boolean 
stripWicketAttributes,
                final String namespace)
@@ -653,7 +652,7 @@
                                        response.write(key);
                                        CharSequence value = getString(key);
 
-                                       // attributes without values are 
possible, e.g. 'disabled'
+                                       // attributes without values are 
possible, e.g.' disabled'
                                        if (value != null)
                                        {
                                                response.write("=\"");
@@ -727,7 +726,7 @@
         * Sets the component path of wicket elements
         * 
         * @param path
-        *            path
+        *              path
         */
        void setPath(final String path)
        {
@@ -760,8 +759,7 @@
         * 
         * @return wicketHeaderClass
         */
-       @SuppressWarnings("unchecked")
-       public Class< ? extends Component< ? >> getMarkupClass()
+       public Class<? extends Component<?>> getMarkupClass()
        {
                return (markupClassRef == null ? null : markupClassRef.get());
        }
@@ -770,9 +768,9 @@
         * Set the class of wicket component which contains the wicket:head tag.
         * 
         * @param wicketHeaderClass
-        *            wicketHeaderClass
+        *              wicketHeaderClass
         */
-       public void setMarkupClass(Class< ? extends Component< ? >> 
wicketHeaderClass)
+       public void setMarkupClass(Class<? extends Component<?>> 
wicketHeaderClass)
        {
                if (wicketHeaderClass == null)
                {
@@ -780,7 +778,7 @@
                }
                else
                {
-                       markupClassRef = new WeakReference<Class< ? extends 
Component< ? >>>(wicketHeaderClass);
+                       markupClassRef = new WeakReference<Class<? extends 
Component<?>>>(wicketHeaderClass);
                }
        }
 
@@ -812,7 +810,7 @@
         * Sets ignore.
         * 
         * @param ignore
-        *            If true than MarkupParser will remove it from the markup
+        *              If true than MarkupParser will remove it from the markup
         */
        public void setIgnore(boolean ignore)
        {
@@ -829,7 +827,7 @@
 
        /**
         * @param auto
-        *            True, if wicket:id has been automatically created 
(internal component)
+        *              True, if wicket:id has been automatically created 
(internal component)
         */
        public void setAutoComponentTag(boolean auto)
        {
@@ -840,7 +838,7 @@
         * Gets userData.
         * 
         * @param key
-        *            The key to store and retrieve the value
+        *              The key to store and retrieve the value
         * @return userData
         */
        public Object getUserData(final String key)
@@ -857,9 +855,9 @@
         * Sets userData.
         * 
         * @param key
-        *            The key to store and retrieve the value
+        *              The key to store and retrieve the value
         * @param value
-        *            The user specific value to store
+        *              The user specific value to store
         */
        public void setUserData(final String key, final Object value)
        {

Modified: 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/HtmlHandler.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/HtmlHandler.java?rev=656434&r1=656433&r2=656434&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/HtmlHandler.java
 (original)
+++ 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/HtmlHandler.java
 Wed May 14 14:06:51 2008
@@ -40,7 +40,7 @@
        private static final Logger log = 
LoggerFactory.getLogger(HtmlHandler.class);
 
        /** Tag stack to find balancing tags */
-       final private ArrayListStack stack = new ArrayListStack();
+       final private ArrayListStack<ComponentTag> stack = new 
ArrayListStack<ComponentTag>();
 
        /** Map of simple tags. */
        private static final Map<String, Boolean> doesNotRequireCloseTag = new 
HashMap<String, Boolean>();
@@ -82,7 +82,7 @@
                        // If there's still a non-simple tag left, it's an error
                        while (stack.size() > 0)
                        {
-                               final ComponentTag top = 
(ComponentTag)stack.peek();
+                               final ComponentTag top = stack.peek();
 
                                if (!requiresCloseTag(top.getName()))
                                {
@@ -115,7 +115,7 @@
                        if (stack.size() > 0)
                        {
                                // Pop the top tag off the stack
-                               ComponentTag top = (ComponentTag)stack.pop();
+                               ComponentTag top = stack.pop();
 
                                // If the name of the current close tag does 
not match the
                                // tag on the stack then we may have a 
mismatched close tag
@@ -135,7 +135,7 @@
                                                {
                                                        break;
                                                }
-                                               top = (ComponentTag)stack.pop();
+                                               top = stack.pop();
 
                                                // Does new top of stack 
mismatch too?
                                                mismatch = 
!top.hasEqualTagName(tag);
@@ -173,7 +173,7 @@
         * Gets whether this tag does not require a closing tag.
         * 
         * @param name
-        *            The tag's name, e.g. a, br, div, etc.
+        *              The tag's name, e.g. a, br, div, etc.
         * @return True if this tag does not require a closing tag
         */
        public static boolean requiresCloseTag(final String name)

Modified: 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/TagTypeHandler.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/TagTypeHandler.java?rev=656434&r1=656433&r2=656434&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/TagTypeHandler.java
 (original)
+++ 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/TagTypeHandler.java
 Wed May 14 14:06:51 2008
@@ -36,7 +36,7 @@
 public final class TagTypeHandler extends AbstractMarkupFilter
 {
        /** Tag stack to find balancing tags */
-       final private ArrayListStack stack = new ArrayListStack();
+       final private ArrayListStack<ComponentTag> stack = new 
ArrayListStack<ComponentTag>();
 
        /** Map of simple tags. */
        private static final Map<String, Boolean> requireOpenBodyCloseTag = new 
HashMap<String, Boolean>();
@@ -67,7 +67,7 @@
                // If there is something in the stack, ...
                while (stack.size() > 0)
                {
-                       final ComponentTag top = (ComponentTag)stack.pop();
+                       final ComponentTag top = stack.pop();
                        return top;
                }
 
@@ -108,7 +108,7 @@
         * Gets whether this tag does not require open-body-close tags.
         * 
         * @param name
-        *            The tag's name, e.g. a, br, div, etc.
+        *              The tag's name, e.g. a, br, div, etc.
         * @return True if this tag must be converted into open-body-close if 
openClose
         */
        public static boolean requiresOpenBodyCloseTag(final String name)

Modified: 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java?rev=656434&r1=656433&r2=656434&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java
 (original)
+++ 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java
 Wed May 14 14:06:51 2008
@@ -56,7 +56,7 @@
        }
 
        /** Allow to have link regions within link regions */
-       private ArrayListStack autolinkStatus;
+       private ArrayListStack<Boolean> autolinkStatus;
 
        /** Current status */
        private boolean autolinking = true;
@@ -73,7 +73,7 @@
         * Set the default value for autolinking
         * 
         * @param enable
-        *            if true, autolinks are enabled
+        *              if true, autolinks are enabled
         */
        public void setAutomaticLinking(final boolean enable)
        {
@@ -130,12 +130,12 @@
                                        {
                                                if (autolinkStatus == null)
                                                {
-                                                       autolinkStatus = new 
ArrayListStack();
+                                                       autolinkStatus = new 
ArrayListStack<Boolean>();
                                                }
 
                                                // remember the current setting 
to be reset after the
                                                // region
-                                               
autolinkStatus.push(Boolean.valueOf(autolinking));
+                                               
autolinkStatus.push(autolinking);
                                        }
 
                                        // html allows to represent true in 
different ways
@@ -147,13 +147,13 @@
                                        catch (StringValueConversionException e)
                                        {
                                                throw new 
WicketRuntimeException("Invalid autolink attribute value \"" +
-                                                               autolink + 
"\"");
+                                                       autolink + "\"");
                                        }
                                }
                                else if (tag.isClose())
                                {
                                        // restore the autolink setting from 
before the region
-                                       autolinking = 
((Boolean)autolinkStatus.pop()).booleanValue();
+                                       autolinking = autolinkStatus.pop();
                                }
 
                                return wtag;
@@ -170,7 +170,7 @@
         * tag handler with the markup parser through 
Application.newMarkupParser().
         * 
         * @param tag
-        *            The current tag being parsed
+        *              The current tag being parsed
         * @return If true, tag will become auto-component
         */
        protected boolean analyzeAutolinkCondition(final ComponentTag tag)


Reply via email to