I have a large code base (written by me) that uses a Stack data structure. This was used for convenience, and I use it as a Stack sometimes or Vector / List at another time.
After a performance review, it was decided that we did not want to pay extra for synchronization security. I now need to replace this structure with unsynchronized (and it is mentioned many times in the code).
I was glad to know that the Apache collections include the ArrayStack that I definitely want (just like the Java stack, but not in sync). However, this does not have generics, like modern Java 5 code (which I use). And I'm not going to convert my code to look like Java 1.4
So, is there any other replacement for Java 5 to replace Java Stack or do I need to write my own?
Update:
I used LinkedList with the configured pop / push methods.
java stack data-structures
kazanaki
source share