You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Michael Dick <mi...@gmail.com> on 2007/05/03 00:59:09 UTC
Re: svn commit: r534647 - /incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
How about a testcase? :-)
On 5/2/07, wisneskid@apache.org <wi...@apache.org> wrote:
>
> Author: wisneskid
> Date: Wed May 2 15:53:39 2007
> New Revision: 534647
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=534647
> Log:
> Fix for issue OPENJPA-51. It should also resolve issue OPENJPA-173.
> Change to use BitSet.
>
> Modified:
>
> incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
>
> Modified:
> incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
> URL:
> http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?view=diff&rev=534647&r1=534646&r2=534647
>
> ==============================================================================
> ---
> incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
> (original)
> +++
> incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
> Wed May 2 15:53:39 2007
> @@ -26,6 +26,7 @@
> import java.sql.Types;
> import java.util.AbstractList;
> import java.util.ArrayList;
> +import java.util.BitSet;
> import java.util.Collection;
> import java.util.Collections;
> import java.util.HashMap;
> @@ -164,7 +165,7 @@
> // bit 1 : correspond to alias 1, etc.
> // if the bit is set, the corresponding alias has been removed from
> parent
> // and recorded under subselect.
> - private int _removedAliasFromParent = 0;
> + private BitSet _removedAliasFromParent = new BitSet(16);
>
> /**
> * Helper method to return the proper table alias for the given alias
> index.
> @@ -1496,7 +1497,7 @@
> return;
> if (_parent._joins != null && !_parent._joins.isEmpty()) {
> boolean removed = false;
> - if (_removedAliasFromParent > 0)
> + if (!_removedAliasFromParent.isEmpty())
> removed = _parent._joins.joins().removeAll(pj.joins());
> if (!removed)
> pj.joins().removeAll(_parent._joins.joins());
> @@ -1914,7 +1915,7 @@
> if (alias != null) {
> if (removeAliasFromParent) {
> recordTableAlias(table, key, alias);
> - _removedAliasFromParent |= (1 << alias.intValue());
> + _removedAliasFromParent.set(alias.intValue());
> }
> return alias;
> }
>
>
>