Skip to content

Commit

Permalink
MONDRIAN: Integrate from //open/lu/release/mondrian/wm@13174 into Mon…
Browse files Browse the repository at this point in the history
…drian-3.1 branch

[git-p4: depot-paths = "//open/mondrian-release/3.1/": change = 13295]
  • Loading branch information
Will Gorman committed Jan 7, 2010
1 parent bc61cca commit f348b59
Show file tree
Hide file tree
Showing 17 changed files with 1,395 additions and 814 deletions.
2 changes: 1 addition & 1 deletion build.xml
Expand Up @@ -415,7 +415,7 @@ demo/access/MondrianFoodMart.mdb"/>
<ivy:retrieve symlink="${symlink}" type="jar,war"
pattern="${lib.dir}/[module].[ext]"/>
<ivy:retrieve symlink="${symlink}" type="source,javadoc"
pattern="${lib.dir}/[module]-[type].[ext]"/>
pattern="${lib.dir}/[module]-[type].[ext]"/>
</target>

<target name="cmdrunner" depends="jar">
Expand Down
51 changes: 51 additions & 0 deletions src/main/mondrian/olap/Util.java
Expand Up @@ -1977,6 +1977,57 @@ public static int hashArray(int h, Object [] a) {
return h;
}

/**
* Concatenates one or more arrays.
*
* <p>Resulting array has same element type as first array. Each arrays may
* be empty, but must not be null.
*
* @param a0 First array
* @param as Zero or more subsequent arrays
* @return Array containing all elements
*/
public static <T> T[] appendArrays(
T[] a0,
T[]... as)
{
int n = a0.length;
for (T[] a : as) {
n += a.length;
}
// Would use Arrays.copyOf but only exists in JDK 1.6 and higher.
//noinspection unchecked
T[] copy =
(T[]) Array.newInstance(a0.getClass().getComponentType(), n);
System.arraycopy(a0, 0, copy, 0, a0.length);
n = a0.length;
for (T[] a : as) {
System.arraycopy(a, 0, copy, n, a.length);
n += a.length;
}
return copy;
}

/**
* Adds an object to the end of an array. The resulting array is of the
* same type (e.g. <code>String[]</code>) as the input array.
*
* @param a Array
* @param o Element
* @return New array containing original array plus element
*
* @see #appendArrays
*/
public static <T> T[] append(T[] a, T o) {
Class clazz = a.getClass().getComponentType();
// Would use Arrays.copyOf but only exists in JDK 1.6 and higher.
//noinspection unchecked
T[] a2 = (T[]) Array.newInstance(clazz, a.length + 1);
System.arraycopy(a, 0, a2, 0, a.length);
a2[a.length] = o;
return a2;
}

/**
* Returns the cumulative amount of time spent accessing the database.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/mondrian/olap/fun/FunUtil.java
Expand Up @@ -2885,7 +2885,7 @@ static class SetWrapper {
* object which indicates the the cell is not in the cache yet) next,
* then numbers and strings are compared by value.
*/
private static class DescendingValueComparator implements Comparator {
public static class DescendingValueComparator implements Comparator {
/**
* The singleton.
*/
Expand Down

0 comments on commit f348b59

Please sign in to comment.