Skip to content

Commit fddba3b

Browse files
committed
8375350: Remove usage of AppContext from javax.imageio implementation
Reviewed-by: kizune, dnguyen
1 parent 1d889b9 commit fddba3b

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/java.desktop/share/classes/javax/imageio/ImageIO.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,6 @@
4747
import javax.imageio.spi.ServiceRegistry;
4848
import javax.imageio.stream.ImageInputStream;
4949
import javax.imageio.stream.ImageOutputStream;
50-
import sun.awt.AppContext;
5150

5251
/**
5352
* A class containing static convenience methods for locating
@@ -108,9 +107,7 @@ public static void scanForPlugins() {
108107
// ImageInputStreams
109108

110109
/**
111-
* A class to hold information about caching. Each
112-
* {@code ThreadGroup} will have its own copy
113-
* via the {@code AppContext} mechanism.
110+
* A class to hold information about caching.
114111
*/
115112
static class CacheInfo {
116113
boolean useCache = true;
@@ -144,17 +141,12 @@ public void setHasPermission(Boolean hasPermission) {
144141
}
145142
}
146143

144+
private static final CacheInfo info = new CacheInfo();
145+
147146
/**
148-
* Returns the {@code CacheInfo} object associated with this
149-
* {@code ThreadGroup}.
147+
* Returns the {@code CacheInfo} object.
150148
*/
151149
private static synchronized CacheInfo getCacheInfo() {
152-
AppContext context = AppContext.getAppContext();
153-
CacheInfo info = (CacheInfo)context.get(CacheInfo.class);
154-
if (info == null) {
155-
info = new CacheInfo();
156-
context.put(CacheInfo.class, info);
157-
}
158150
return info;
159151
}
160152

0 commit comments

Comments
 (0)