You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jr...@apache.org on 2010/12/18 02:55:53 UTC
svn commit: r1050567 -
/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java
Author: jrthomerson
Date: Sat Dec 18 01:55:52 2010
New Revision: 1050567
URL: http://svn.apache.org/viewvc?rev=1050567&view=rev
Log:
fixes WICKET-3265 for 1.4.x branch
Modified:
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java
Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java?rev=1050567&r1=1050566&r2=1050567&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java Sat Dec 18 01:55:52 2010
@@ -776,24 +776,21 @@ public abstract class Component implemen
}
}
- private final Object data_set(int index, Object object)
+ private final void data_set(int index, Object object)
{
if (index > data_length() - 1)
{
- throw new IndexOutOfBoundsException();
+ throw new IndexOutOfBoundsException("can not set data at " + index +
+ " when data_length() is " + data_length());
}
else if (index == 0 && !(data instanceof Object[] && !(data instanceof MetaDataEntry<?>[])))
{
- Object old = data;
data = object;
- return old;
}
else
{
Object[] array = (Object[])data;
- Object old = array[index];
array[index] = object;
- return old;
}
}
@@ -811,7 +808,8 @@ public abstract class Component implemen
}
if (position > currentLength)
{
- throw new IndexOutOfBoundsException();
+ throw new IndexOutOfBoundsException("can not insert data at " + position +
+ " when data_length() is " + currentLength);
}
if (currentLength == 0)
{
@@ -851,7 +849,7 @@ public abstract class Component implemen
}
}
- private Object data_remove(int position)
+ private final void data_remove(int position)
{
int currentLength = data_length();
@@ -861,9 +859,7 @@ public abstract class Component implemen
}
else if (currentLength == 1)
{
- Object old = data;
data = null;
- return old;
}
else if (currentLength == 2)
{
@@ -871,12 +867,10 @@ public abstract class Component implemen
if (position == 0)
{
data = current[1];
- return current[0];
}
else
{
data = current[0];
- return current[1];
}
}
else
@@ -893,8 +887,6 @@ public abstract class Component implemen
final int left = currentLength - position - 1;
System.arraycopy(current, position + 1, data, position, left);
}
-
- return current[position];
}
}