|
1 | 1 | /* |
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. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
47 | 47 | import javax.imageio.spi.ServiceRegistry; |
48 | 48 | import javax.imageio.stream.ImageInputStream; |
49 | 49 | import javax.imageio.stream.ImageOutputStream; |
50 | | -import sun.awt.AppContext; |
51 | 50 |
|
52 | 51 | /** |
53 | 52 | * A class containing static convenience methods for locating |
@@ -108,9 +107,7 @@ public static void scanForPlugins() { |
108 | 107 | // ImageInputStreams |
109 | 108 |
|
110 | 109 | /** |
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. |
114 | 111 | */ |
115 | 112 | static class CacheInfo { |
116 | 113 | boolean useCache = true; |
@@ -144,17 +141,12 @@ public void setHasPermission(Boolean hasPermission) { |
144 | 141 | } |
145 | 142 | } |
146 | 143 |
|
| 144 | + private static final CacheInfo info = new CacheInfo(); |
| 145 | + |
147 | 146 | /** |
148 | | - * Returns the {@code CacheInfo} object associated with this |
149 | | - * {@code ThreadGroup}. |
| 147 | + * Returns the {@code CacheInfo} object. |
150 | 148 | */ |
151 | 149 | 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 | | - } |
158 | 150 | return info; |
159 | 151 | } |
160 | 152 |
|
|
0 commit comments