I don't know why you needed to change the constructor, but I'm quite sure 
that 
you shouldn't use an instance method to set values in a static variable.

-- 
Lew

On Wednesday, February 15, 2012 10:27:05 PM UTC-8, Subba wrote:
>
> My application uses Java BitSet API, i never had problem with in 
> Android Ginger Bread and below version. All of sudden Android Ice 
> Cream Sandwich, it giving wrong results. 
>
>    code: 
>
>   public class BitTracker 
>   { 
>     private static BitSet m_FileIds = new BitSet(65535); 
>
>     private void init() 
>     { 
>        for(int i=0; i<=63; i++) 
>         { 
>           m_FileIds.set(i); 
>         } 
>     } 
>
>     public int GetUnUsedId() 
>     { 
>         int iUnusedId = m_FileIds.nextClearBit(1); 
>
>        return iUnusedId; 
>      } 
>     } 
>
>    BitTracker tracker = new BitTracker(); 
>    tracker.init(); 
>    int unusedID = tracker.GetUnUsedId(); 
>
> //In ICS unusedID returns "65536" 
>
> //In GingerBread unusedID returns "64" 
>
> I am able to fix the issue by changing this line 
>
>  private static BitSet m_FileIds = new BitSet(65535); //old one 
>
>  private static BitSet m_FileIds = new BitSet(); //new one 
>
> It seems to be working. I still can't understand what's deal with ICS 
> vs. GingerBread.. Is there any Java compatible version difference in 
> android ICS vs. GB or below versions..Curious to know..

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to