You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by James Carman <ja...@carmanconsulting.com> on 2006/05/10 11:50:51 UTC

RE: svn commit: r405622 - in /tapestry/tapestry4/trunk: contrib/src/java/org/apache/tapestry/contrib/table/components/ contrib/src/java/org/apache/tapestry/contrib/tree/components/ contrib/src/java/org/apache/tapestry/contrib/tree/components/

Ahhh.  Here's the commit message.  It got sent to my SPAM folder for some
reason.  This is the one that broke the unit tests.

-----Original Message-----
From: bwallace@apache.org [mailto:bwallace@apache.org] 
Sent: Tuesday, May 09, 2006 11:58 PM
To: commits@tapestry.apache.org
Subject: svn commit: r405622 - in /tapestry/tapestry4/trunk:
contrib/src/java/org/apache/tapestry/contrib/table/components/
contrib/src/java/org/apache/tapestry/contrib/tree/components/
contrib/src/java/org/apache/tapestry/contrib/tree/components/

Author: bwallace
Date: Tue May  9 20:57:57 2006
New Revision: 405622

URL: http://svn.apache.org/viewcvs?rev=405622&view=rev
Log:
[TAPESTRY-940] Fix Checkstyle Parameter reassignment errors

Modified:
 
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/table/
components/TableView.java
 
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/c
omponents/TreeDataView.java
 
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/c
omponents/table/TreeTableDataView.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/engine/Engin
eServiceLink.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/form/DatePic
ker.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/form/ListEdi
tMap.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/parse/Templa
teParser.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/BodyT
oken.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/InitT
oken.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/LetTo
ken.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/services/imp
l/RequestLocaleManagerImpl.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/Extensi
onSpecification.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/Default
PrimaryKeyConverter.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/excepti
on/ExceptionAnalyzer.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/text/Ex
tendedReader.java
 
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/valid/Number
Validator.java

Modified:
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/table/
components/TableView.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/contrib/src/java/org/
apache/tapestry/contrib/table/components/TableView.java?rev=405622&r1=405621
&r2=405622&view=diff
============================================================================
==
---
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/table/
components/TableView.java (original)
+++
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/table/
components/TableView.java Tue May  9 20:57:57 2006
@@ -245,18 +245,19 @@
      */
     protected ITableModel generateTableModel(SimpleTableState objState)
     {
+        SimpleTableState usableObjState = objState;
         // create a new table state if none is passed
-        if (objState == null)
+        if (usableObjState == null)
         {
-            objState = new SimpleTableState();
-
objState.getSortingState().setSortColumn(getInitialSortColumn(),
+            usableObjState = new SimpleTableState();
+
usableObjState.getSortingState().setSortColumn(getInitialSortColumn(),
                     getInitialSortOrder());
-            objState.getPagingState().setCurrentPage(getInitialPage());
+
usableObjState.getPagingState().setCurrentPage(getInitialPage());
         }
 
         // update the page size if set in the parameter
         if (isParameterBound("pageSize"))
-            objState.getPagingState().setPageSize(getPageSize());
+            usableObjState.getPagingState().setPageSize(getPageSize());
 
         // get the column model. if not possible, return null.
         ITableColumnModel objColumnModel = getTableColumnModel();
@@ -269,7 +270,7 @@
         // create and return an appropriate wrapper
         if (objSourceValue instanceof IBasicTableModel)
             return new BasicTableModelWrap((IBasicTableModel)
objSourceValue,
-                    objColumnModel, objState);
+                    objColumnModel, usableObjState);
 
         // otherwise, the source parameter must contain the data to be
displayed
         ITableDataModel objDataModel = null;
@@ -289,7 +290,7 @@
             throw new ApplicationRuntimeException(TableMessages
                     .invalidTableSource(this, objSourceValue));
 
-        return new SimpleTableModel(objDataModel, objColumnModel,
objState);
+        return new SimpleTableModel(objDataModel, objColumnModel,
usableObjState);
     }
 
     /**

Modified:
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/c
omponents/TreeDataView.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/contrib/src/java/org/
apache/tapestry/contrib/tree/components/TreeDataView.java?rev=405622&r1=4056
21&r2=405622&view=diff
============================================================================
==
---
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/c
omponents/TreeDataView.java (original)
+++
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/c
omponents/TreeDataView.java Tue May  9 20:57:57 2006
@@ -103,12 +103,13 @@
             ITreeModel objTreeModel, IMarkupWriter writer, IRequestCycle
cycle,
             int nRowPossiotionType, int[] arrConnectImages, boolean bLast)
     {
+        int rowPositionType = nRowPossiotionType;
         m_nTreeDeep = nDepth;
         int nNumberOfChildren =
objTreeModel.getTreeDataModel().getChildCount(
                 objParent);
         boolean bLeaf = (nNumberOfChildren == 0) ? true : false;
         m_objTreeRowObject = new TreeRowObject(objParent, objParentUID,
nDepth,
-                bLeaf, nRowPossiotionType, arrConnectImages);
+                bLeaf, rowPositionType, arrConnectImages);
 
         super.renderComponent(writer, cycle);
 
@@ -131,10 +132,10 @@
                         .getUniqueKey(objChild, objParentUID);
                 boolean bChildLast = !iter.hasNext();
                 if (bChildLast)
-                    nRowPossiotionType = TreeRowObject.LAST_ROW;
-                else nRowPossiotionType = TreeRowObject.MIDDLE_ROW;
+                    rowPositionType = TreeRowObject.LAST_ROW;
+                else rowPositionType = TreeRowObject.MIDDLE_ROW;
                 walkTree(objChild, objChildUID, nDepth + 1, objTreeModel,
-                        writer, cycle, nRowPossiotionType,
arrConnectImagesNew,
+                        writer, cycle, rowPositionType,
arrConnectImagesNew,
                         bChildLast);
             }
         }

Modified:
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/c
omponents/table/TreeTableDataView.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/contrib/src/java/org/
apache/tapestry/contrib/tree/components/table/TreeTableDataView.java?rev=405
622&r1=405621&r2=405622&view=diff
============================================================================
==
---
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/c
omponents/table/TreeTableDataView.java (original)
+++
tapestry/tapestry4/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/c
omponents/table/TreeTableDataView.java Tue May  9 20:57:57 2006
@@ -137,13 +137,13 @@
             Object objParentUID, int nDepth, ITreeModel objTreeModel,
             int nRowPossiotionType, int[] arrConnectImages, boolean bLast)
     {
+        int rowPositionType = nRowPossiotionType;
         m_nTreeDeep = nDepth;
-
         int nNumberOfChildren =
objTreeModel.getTreeDataModel().getChildCount(
                 objParent);
         boolean bLeaf = (nNumberOfChildren == 0) ? true : false;
         TreeRowObject objTreeRowObject = new TreeRowObject(objParent,
-                objParentUID, nDepth, bLeaf, nRowPossiotionType,
+                objParentUID, nDepth, bLeaf, rowPositionType,
                 arrConnectImages);
         arrAllExpandedNodes.add(objTreeRowObject);
 
@@ -166,10 +166,10 @@
                         .getUniqueKey(objChild, objParentUID);
                 boolean bChildLast = !iter.hasNext();
                 if (bChildLast)
-                    nRowPossiotionType = TreeRowObject.LAST_ROW;
-                else nRowPossiotionType = TreeRowObject.MIDDLE_ROW;
+                    rowPositionType = TreeRowObject.LAST_ROW;
+                else rowPositionType = TreeRowObject.MIDDLE_ROW;
                 walkTree(arrAllExpandedNodes, objChild, objChildUID,
-                        nDepth + 1, objTreeModel, nRowPossiotionType,
+                        nDepth + 1, objTreeModel, rowPositionType,
                         arrConnectImagesNew, bChildLast);
             }
         }

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/engine/Engin
eServiceLink.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/engine/EngineServiceLink.java?rev=405622&r1=405621&r2=4056
22&view=diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/engine/Engin
eServiceLink.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/engine/Engin
eServiceLink.java Tue May  9 20:57:57 2006
@@ -122,18 +122,21 @@
         StringBuffer buffer = new StringBuffer();
 
         if (scheme == null)
-            scheme = _request.getScheme();
+            buffer.append(_request.getScheme());
+        else
+            buffer.append(scheme);
 
-        buffer.append(scheme);
         buffer.append("://");
 
         if (server == null)
-            server = _request.getServerName();
-
-        buffer.append(server);
+            buffer.append(_request.getServerName());
+        else
+            buffer.append(server);
 
         if (port == 0)
-            port = _request.getServerPort();
+            buffer.append(_request.getServerPort());
+        else
+            buffer.append(port);
 
         if (!(scheme.equals("http") && port == DEFAULT_HTTP_PORT))
         {

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/form/DatePic
ker.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/form/DatePicker.java?rev=405622&r1=405621&r2=405622&view=d
iff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/form/DatePic
ker.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/form/DatePic
ker.java Tue May  9 20:57:57 2006
@@ -232,11 +232,12 @@
      */
     private static String escape(char c)
     {
+        char unescapedChar = c;
         StringBuffer b = new StringBuffer();
         for (int i = 0; i < 4; i++)
         {
-            b.append(Integer.toHexString(c & 0x000F).toUpperCase());
-            c >>>= 4;
+            b.append(Integer.toHexString(unescapedChar &
0x000F).toUpperCase());
+            unescapedChar >>>= 4;
         }
         b.append("u\\");
         return b.reverse().toString();

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/form/ListEdi
tMap.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/form/ListEditMap.java?rev=405622&r1=405621&r2=405622&view=
diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/form/ListEdi
tMap.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/form/ListEdi
tMap.java Tue May  9 20:57:57 2006
@@ -175,20 +175,21 @@
 
     protected Set updateSet(Set set, boolean value)
     {
+        Set updatedSet = set;
         if (value)
         {
-            if (set == null)
-                set = new HashSet();
+            if (updatedSet == null)
+                updatedSet = new HashSet();
 
-            set.add(_currentKey);
+            updatedSet.add(_currentKey);
         }
         else
         {
-            if (set != null)
-                set.remove(_currentKey);
+            if (updatedSet != null)
+                updatedSet.remove(_currentKey);
         }
 
-        return set;
+        return updatedSet;
     }
 
     /**

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/parse/Templa
teParser.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/parse/TemplateParser.java?rev=405622&r1=405621&r2=405622&v
iew=diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/parse/Templa
teParser.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/parse/Templa
teParser.java Tue May  9 20:57:57 2006
@@ -949,14 +949,15 @@
     private void processComponentStart(String tagName, String jwcId,
boolean emptyTag,
             int startLine, int cursorStart, Location startLocation) throws
TemplateParseException
     {
-        if (jwcId.equalsIgnoreCase(CONTENT_ID))
+        String componentId = jwcId;
+        if (componentId.equalsIgnoreCase(CONTENT_ID))
         {
             processContentTag(tagName, startLine, cursorStart, emptyTag);
 
             return;
         }
 
-        boolean isRemoveId = jwcId.equalsIgnoreCase(REMOVE_ID);
+        boolean isRemoveId = componentId.equalsIgnoreCase(REMOVE_ID);
 
         if (_ignoring && !isRemoveId)
             templateParseProblem(
@@ -968,11 +969,11 @@
         String type = null;
         boolean allowBody = false;
 
-        if (_patternMatcher.matches(jwcId, _implicitIdPattern))
+        if (_patternMatcher.matches(componentId, _implicitIdPattern))
         {
             MatchResult match = _patternMatcher.getMatch();
 
-            jwcId = match.group(IMPLICIT_ID_PATTERN_ID_GROUP);
+            componentId = match.group(IMPLICIT_ID_PATTERN_ID_GROUP);
             type = match.group(IMPLICIT_ID_PATTERN_TYPE_GROUP);
 
             String libraryId =
match.group(IMPLICIT_ID_PATTERN_LIBRARY_ID_GROUP);
@@ -988,8 +989,8 @@
             // New for 4.0: the component type may included slashes ('/'),
but these
             // are not valid identifiers, so we convert them to '$'.
 
-            if (jwcId == null)
-                jwcId = _idAllocator.allocateId("$" +
simpleType.replace('/', '$'));
+            if (componentId == null)
+                componentId = _idAllocator.allocateId("$" +
simpleType.replace('/', '$'));
 
             try
             {
@@ -1006,23 +1007,23 @@
         {
             if (!isRemoveId)
             {
-                if (!_patternMatcher.matches(jwcId, _simpleIdPattern))
+                if (!_patternMatcher.matches(componentId,
_simpleIdPattern))
                     templateParseProblem(
-                            ParseMessages.componentIdInvalid(tagName,
startLine, jwcId),
+                            ParseMessages.componentIdInvalid(tagName,
startLine, componentId),
                             startLocation,
                             startLine,
                             cursorStart);
 
-                if (!_delegate.getKnownComponent(jwcId))
+                if (!_delegate.getKnownComponent(componentId))
                     templateParseProblem(
-                            ParseMessages.unknownComponentId(tagName,
startLine, jwcId),
+                            ParseMessages.unknownComponentId(tagName,
startLine, componentId),
                             startLocation,
                             startLine,
                             cursorStart);
 
                 try
                 {
-                    allowBody = _delegate.getAllowBody(jwcId,
startLocation);
+                    allowBody = _delegate.getAllowBody(componentId,
startLocation);
                 }
                 catch (ApplicationRuntimeException e)
                 {
@@ -1051,7 +1052,7 @@
 
         if (!isRemoveId)
         {
-            addOpenToken(tagName, jwcId, type, startLocation);
+            addOpenToken(tagName, componentId, type, startLocation);
 
             if (emptyTag)
                 _tokens.add(_factory.createCloseToken(tagName,
getCurrentLocation()));

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/BodyT
oken.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/script/BodyToken.java?rev=405622&r1=405621&r2=405622&view=
diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/BodyT
oken.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/BodyT
oken.java Tue May  9 20:57:57 2006
@@ -38,16 +38,16 @@
     {
         if (buffer != null) throw new IllegalArgumentException();
 
-        buffer = new StringBuffer(_bufferLengthHighwater);
+        StringBuffer useBuffer = new StringBuffer(_bufferLengthHighwater);
 
-        writeChildren(buffer, session);
+        writeChildren(useBuffer, session);
 
-        session.addBodyScript(buffer.toString());
+        session.addBodyScript(useBuffer.toString());
 
         // Store the buffer length from this run for the next run, since
its
         // going to be approximately the right size.
 
-        _bufferLengthHighwater = Math.max(_bufferLengthHighwater, buffer
+        _bufferLengthHighwater = Math.max(_bufferLengthHighwater, useBuffer
                 .length());
     }
 }

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/InitT
oken.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/script/InitToken.java?rev=405622&r1=405621&r2=405622&view=
diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/InitT
oken.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/InitT
oken.java Tue May  9 20:57:57 2006
@@ -38,16 +38,16 @@
     {
         if (buffer != null) throw new IllegalArgumentException();
 
-        buffer = new StringBuffer(_bufferLengthHighwater);
+        StringBuffer useBuffer = new StringBuffer(_bufferLengthHighwater);
 
-        writeChildren(buffer, session);
+        writeChildren(useBuffer, session);
 
-        session.addInitializationScript(buffer.toString());
+        session.addInitializationScript(useBuffer.toString());
 
         // Store the buffer length from this run for the next run, since
its
         // going to be approximately the right size.
 
-        _bufferLengthHighwater = Math.max(_bufferLengthHighwater, buffer
+        _bufferLengthHighwater = Math.max(_bufferLengthHighwater, useBuffer
                 .length());
     }
 }

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/LetTo
ken.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/script/LetToken.java?rev=405622&r1=405621&r2=405622&view=d
iff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/LetTo
ken.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/script/LetTo
ken.java Tue May  9 20:57:57 2006
@@ -48,15 +48,15 @@
     {
         if (buffer != null) throw new IllegalArgumentException();
 
-        buffer = new StringBuffer(_bufferLengthHighwater);
+        StringBuffer useBuffer = new StringBuffer(_bufferLengthHighwater);
 
-        writeChildren(buffer, session);
+        writeChildren(useBuffer, session);
 
         // Store the symbol back into the root set of symbols.
 
         Map symbols = session.getSymbols();
 
-        String value = buffer.toString().trim();
+        String value = useBuffer.toString().trim();
 
         if (_unique) value = session.getUniqueString(value);
 
@@ -65,7 +65,7 @@
         // Store the buffer length from this run for the next run, since
its
         // going to be approximately the right size.
 
-        _bufferLengthHighwater = Math.max(_bufferLengthHighwater, buffer
+        _bufferLengthHighwater = Math.max(_bufferLengthHighwater, useBuffer
                 .length());
     }
 }

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/services/imp
l/RequestLocaleManagerImpl.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/services/impl/RequestLocaleManagerImpl.java?rev=405622&r1=
405621&r2=405622&view=diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/services/imp
l/RequestLocaleManagerImpl.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/services/imp
l/RequestLocaleManagerImpl.java Tue May  9 20:57:57 2006
@@ -108,17 +108,18 @@
 
     Locale filterRequestedLocale(String localeName)
     {
+        String requestLocaleName = localeName;
         if (_acceptedLocaleNamesSet.isEmpty())
-            return getLocale(localeName);
+            return getLocale(requestLocaleName);
 
         while (true)
         {
-            if (_acceptedLocaleNamesSet.contains(localeName))
-                return getLocale(localeName);
+            if (_acceptedLocaleNamesSet.contains(requestLocaleName))
+                return getLocale(requestLocaleName);
 
-            localeName = stripTerm(localeName);
+            requestLocaleName = stripTerm(requestLocaleName);
 
-            if (localeName.length() == 0)
+            if (requestLocaleName.length() == 0)
                 return _defaultLocale;
         }
     }

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/Extensi
onSpecification.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/spec/ExtensionSpecification.java?rev=405622&r1=405621&r2=4
05622&view=diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/Extensi
onSpecification.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/Extensi
onSpecification.java Tue May  9 20:57:57 2006
@@ -150,16 +150,17 @@
 
     private Object instantiateInstance(Class extensionClass, Object result)
     {
+        Object returnResult = result;
         try
         {
-            result = extensionClass.newInstance();
+            returnResult = extensionClass.newInstance();
         }
         catch (Exception ex)
         {
             throw new ApplicationRuntimeException(ex.getMessage(),
getLocation(), ex);
         }
 
-        return result;
+        return returnResult;
     }
 
     public String toString()

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/Default
PrimaryKeyConverter.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/util/DefaultPrimaryKeyConverter.java?rev=405622&r1=405621&
r2=405622&view=diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/Default
PrimaryKeyConverter.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/Default
PrimaryKeyConverter.java Tue May  9 20:57:57 2006
@@ -177,20 +177,21 @@
      */
     protected final Set updateValueSetForLastValue(Set set, boolean inSet)
     {
+        Set updatedSet = set;
         if (inSet)
         {
-            if (set == null)
-                set = new HashSet();
+            if (updatedSet == null)
+                updatedSet = new HashSet();
 
-            set.add(_lastValue);
+            updatedSet.add(_lastValue);
 
-            return set;
+            return updatedSet;
         }
 
-        if (set != null)
-            set.remove(_lastValue);
+        if (updatedSet != null)
+            updatedSet.remove(_lastValue);
 
-        return set;
+        return updatedSet;
     }
 
     /**

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/excepti
on/ExceptionAnalyzer.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/util/exception/ExceptionAnalyzer.java?rev=405622&r1=405621
&r2=405622&view=diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/excepti
on/ExceptionAnalyzer.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/excepti
on/ExceptionAnalyzer.java Tue May  9 20:57:57 2006
@@ -84,12 +84,13 @@
 
     public ExceptionDescription[] analyze(Throwable exception)
     {
+        Throwable thrown = exception;
         try
         {
 
-            while (exception != null)
+            while (thrown != null)
             {
-                exception = buildDescription(exception);
+                thrown = buildDescription(thrown);
             }
 
             ExceptionDescription[] result = new
ExceptionDescription[exceptionDescriptions.size()];

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/text/Ex
tendedReader.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/util/text/ExtendedReader.java?rev=405622&r1=405621&r2=4056
22&view=diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/text/Ex
tendedReader.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/util/text/Ex
tendedReader.java Tue May  9 20:57:57 2006
@@ -113,17 +113,19 @@
      */
     public synchronized int read(char[] cbuf, int off, int len) throws
IOException
     {
+        int offset = off;
         if (len <= 0)
             return 0;
+        int readLength = len;
         
         boolean extraChar = _hasBufferedChar;
         if (_hasBufferedChar) {
             _hasBufferedChar = false;
-            cbuf[off++] = _bufferedChar;
-            len--;
+            cbuf[offset++] = _bufferedChar;
+            readLength--;
         }
 
-        int read = _reader.read(cbuf, off, len);
+        int read = _reader.read(cbuf, offset, readLength);
         if (extraChar)
             read++;
         return read;
@@ -161,11 +163,12 @@
      */
     public synchronized long skip(long n) throws IOException
     {
-        if (_hasBufferedChar && n > 0) {
+        long skipChars = n;
+        if (_hasBufferedChar && skipChars > 0) {
             _hasBufferedChar = false;
-            n--;
+            skipChars--;
         }
-        return _reader.skip(n);
+        return _reader.skip(skipChars);
     }
 
     /** 

Modified:
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/valid/Number
Validator.java
URL:
http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/or
g/apache/tapestry/valid/NumberValidator.java?rev=405622&r1=405621&r2=405622&
view=diff
============================================================================
==
---
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/valid/Number
Validator.java (original)
+++
tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/valid/Number
Validator.java Tue May  9 20:57:57 2006
@@ -108,12 +108,13 @@
 
         public int compare(Number left, Number right)
         {
-            if (!left.getClass().equals(right.getClass()))
-                right = coerce(right);
+            Number comparisonRight = right;
+            if (!left.getClass().equals(comparisonRight.getClass()))
+                comparisonRight = coerce(comparisonRight);
 
             Comparable lc = (Comparable) left;
 
-            return lc.compareTo(right);
+            return lc.compareTo(comparisonRight);
         }
 
         /**




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org