01: /*******************************************************************************
02: * Portions created by Sebastian Thomschke are copyright (c) 2005-2007 Sebastian
03: * Thomschke.
04: *
05: * All Rights Reserved. This program and the accompanying materials
06: * are made available under the terms of the Eclipse Public License v1.0
07: * which accompanies this distribution, and is available at
08: * http://www.eclipse.org/legal/epl-v10.html
09: *
10: * Contributors:
11: * Sebastian Thomschke - initial implementation.
12: *******************************************************************************/package net.sf.oval.internal.util;
13:
14: import java.util.List;
15:
16: import net.sf.oval.internal.CollectionFactoryHolder;
17:
18: /**
19: * @author Sebastian Thomschke
20: */
21: public class ThreadLocalList<T> extends ThreadLocal {
22: @Override
23: public List<T> initialValue() {
24: return CollectionFactoryHolder.getFactory().createList();
25: }
26:
27: @SuppressWarnings("unchecked")
28: @Override
29: public List<T> get() {
30: return (List<T>) super.get();
31: }
32: }
|