You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "John Patterson (JIRA)" <ji...@apache.org> on 2008/02/29 10:12:52 UTC

[jira] Created: (WICKET-1383) MiniMap IndexOutOfBoundsException when empty

MiniMap IndexOutOfBoundsException when empty
--------------------------------------------

                 Key: WICKET-1383
                 URL: https://issues.apache.org/jira/browse/WICKET-1383
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.1
            Reporter: John Patterson


findKey() assumes that there is at least one entry in the map

This checks first:



Index: /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java
===================================================================
--- /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java	(revision 614519)
+++ /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java	(working copy)
@@ -118,13 +118,16 @@
 	 */
 	public Object get(final Object key)
 	{
-		// Search for key
-		final int index = findKey(key);
-
-		if (index != -1)
+		if (size > 0)
 		{
-			// Return value
-			return values[index];
+			// Search for key
+			final int index = findKey(key);
+
+			if (index != -1)
+			{
+				// Return value
+				return values[index];
+			}
 		}
 
 		// Failed to find key



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-1383) MiniMap IndexOutOfBoundsException when empty

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-1383.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.2

> MiniMap IndexOutOfBoundsException when empty
> --------------------------------------------
>
>                 Key: WICKET-1383
>                 URL: https://issues.apache.org/jira/browse/WICKET-1383
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>            Reporter: John Patterson
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.2
>
>
> findKey() assumes that there is at least one entry in the map
> This checks first:
> Index: /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java
> ===================================================================
> --- /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java	(revision 614519)
> +++ /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java	(working copy)
> @@ -118,13 +118,16 @@
>  	 */
>  	public Object get(final Object key)
>  	{
> -		// Search for key
> -		final int index = findKey(key);
> -
> -		if (index != -1)
> +		if (size > 0)
>  		{
> -			// Return value
> -			return values[index];
> +			// Search for key
> +			final int index = findKey(key);
> +
> +			if (index != -1)
> +			{
> +				// Return value
> +				return values[index];
> +			}
>  		}
>  
>  		// Failed to find key

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1383) MiniMap IndexOutOfBoundsException when empty

Posted by "John Patterson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574556#action_12574556 ] 

John Patterson commented on WICKET-1383:
----------------------------------------

Oh actually the problem was in findKey() so the fix should go in there

> MiniMap IndexOutOfBoundsException when empty
> --------------------------------------------
>
>                 Key: WICKET-1383
>                 URL: https://issues.apache.org/jira/browse/WICKET-1383
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>            Reporter: John Patterson
>
> findKey() assumes that there is at least one entry in the map
> This checks first:
> Index: /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java
> ===================================================================
> --- /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java	(revision 614519)
> +++ /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java	(working copy)
> @@ -118,13 +118,16 @@
>  	 */
>  	public Object get(final Object key)
>  	{
> -		// Search for key
> -		final int index = findKey(key);
> -
> -		if (index != -1)
> +		if (size > 0)
>  		{
> -			// Return value
> -			return values[index];
> +			// Search for key
> +			final int index = findKey(key);
> +
> +			if (index != -1)
> +			{
> +				// Return value
> +				return values[index];
> +			}
>  		}
>  
>  		// Failed to find key

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-1383) MiniMap IndexOutOfBoundsException when empty

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-1383:
-------------------------------------

    Assignee: Igor Vaynberg

> MiniMap IndexOutOfBoundsException when empty
> --------------------------------------------
>
>                 Key: WICKET-1383
>                 URL: https://issues.apache.org/jira/browse/WICKET-1383
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>            Reporter: John Patterson
>            Assignee: Igor Vaynberg
>
> findKey() assumes that there is at least one entry in the map
> This checks first:
> Index: /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java
> ===================================================================
> --- /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java	(revision 614519)
> +++ /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/MiniMap.java	(working copy)
> @@ -118,13 +118,16 @@
>  	 */
>  	public Object get(final Object key)
>  	{
> -		// Search for key
> -		final int index = findKey(key);
> -
> -		if (index != -1)
> +		if (size > 0)
>  		{
> -			// Return value
> -			return values[index];
> +			// Search for key
> +			final int index = findKey(key);
> +
> +			if (index != -1)
> +			{
> +				// Return value
> +				return values[index];
> +			}
>  		}
>  
>  		// Failed to find key

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.