src/share/classes/sun/awt/image/ImageFetcher.java
Print this page
rev 9830 : 8039642: Fix raw and unchecked warnings in sun.awt.*
Reviewed-by: darcy, prr
*** 150,160 ****
return null;
} finally {
info.numWaiting--;
}
}
! src = (ImageFetchable) info.waitList.elementAt(0);
info.waitList.removeElement(src);
}
return src;
}
}
--- 150,160 ----
return null;
} finally {
info.numWaiting--;
}
}
! src = info.waitList.elementAt(0);
info.waitList.removeElement(src);
}
return src;
}
}
*** 301,316 ****
fetcherThreadGroup = appContext.getThreadGroup();
}
final ThreadGroup fetcherGroup = fetcherThreadGroup;
java.security.AccessController.doPrivileged(
! new java.security.PrivilegedAction() {
public Object run() {
for (int i = 0; i < info.fetchers.length; i++) {
if (info.fetchers[i] == null) {
! ImageFetcher f = new ImageFetcher(
! fetcherGroup, i);
try {
f.start();
info.fetchers[i] = f;
info.numFetchers++;
break;
--- 301,315 ----
fetcherThreadGroup = appContext.getThreadGroup();
}
final ThreadGroup fetcherGroup = fetcherThreadGroup;
java.security.AccessController.doPrivileged(
! new java.security.PrivilegedAction<Object>() {
public Object run() {
for (int i = 0; i < info.fetchers.length; i++) {
if (info.fetchers[i] == null) {
! ImageFetcher f = new ImageFetcher(fetcherGroup, i);
try {
f.start();
info.fetchers[i] = f;
info.numFetchers++;
break;
*** 335,351 ****
static final int MAX_NUM_FETCHERS_PER_APPCONTEXT = 4;
Thread[] fetchers;
int numFetchers;
int numWaiting;
! Vector waitList;
private FetcherInfo() {
fetchers = new Thread[MAX_NUM_FETCHERS_PER_APPCONTEXT];
numFetchers = 0;
numWaiting = 0;
! waitList = new Vector();
}
/* The key to put()/get() the FetcherInfo into/from the AppContext. */
private static final Object FETCHER_INFO_KEY =
new StringBuffer("FetcherInfo");
--- 334,350 ----
static final int MAX_NUM_FETCHERS_PER_APPCONTEXT = 4;
Thread[] fetchers;
int numFetchers;
int numWaiting;
! Vector<ImageFetchable> waitList;
private FetcherInfo() {
fetchers = new Thread[MAX_NUM_FETCHERS_PER_APPCONTEXT];
numFetchers = 0;
numWaiting = 0;
! waitList = new Vector<>();
}
/* The key to put()/get() the FetcherInfo into/from the AppContext. */
private static final Object FETCHER_INFO_KEY =
new StringBuffer("FetcherInfo");