View | Details | Raw Unified | Return to bug 64488
Collapse All | Expand All

(-)a/java/jakarta/el/ImportHandler.java (-3 / +21 lines)
Lines 19-24 package jakarta.el; Link Here
19
import java.lang.reflect.Field;
19
import java.lang.reflect.Field;
20
import java.lang.reflect.Method;
20
import java.lang.reflect.Method;
21
import java.lang.reflect.Modifier;
21
import java.lang.reflect.Modifier;
22
import java.security.AccessController;
23
import java.security.PrivilegedAction;
22
import java.util.Collections;
24
import java.util.Collections;
23
import java.util.HashMap;
25
import java.util.HashMap;
24
import java.util.HashSet;
26
import java.util.HashSet;
Lines 33-38 public class ImportHandler { Link Here
33
35
34
    private static final Map<String,Set<String>> standardPackages = new HashMap<>();
36
    private static final Map<String,Set<String>> standardPackages = new HashMap<>();
35
37
38
    private static final boolean IS_SECURITY_ENABLED =
39
    (System.getSecurityManager() != null);
40
36
    static {
41
    static {
37
        // Servlet 5.0
42
        // Servlet 5.0
38
        Set<String> servletClassNames = new HashSet<>();
43
        Set<String> servletClassNames = new HashSet<>();
Lines 452-458 public class ImportHandler { Link Here
452
             * for the case where the class does exist is a lot less than the
457
             * for the case where the class does exist is a lot less than the
453
             * overhead we save by not calling loadClass().
458
             * overhead we save by not calling loadClass().
454
             */
459
             */
455
            if (cl.getResource(path) == null) {
460
            Boolean isResourceNull;
461
            if (IS_SECURITY_ENABLED) {
462
                isResourceNull = AccessController.doPrivileged(
463
                    new PrivilegedAction<Boolean>() {
464
465
                    @Override
466
                    public Boolean run() {
467
                        return cl.getResource(path) == null;
468
                    }
469
                    
470
                });
471
            } else {
472
                isResourceNull =  cl.getResource(path) == null;
473
            }
474
            if (isResourceNull) {
456
                return null;
475
                return null;
457
            }
476
            }
458
        } catch (ClassCircularityError cce) {
477
        } catch (ClassCircularityError cce) {
Lines 489-492 public class ImportHandler { Link Here
489
     */
508
     */
490
    private static class NotFound {
509
    private static class NotFound {
491
    }
510
    }
492
}
511
}
493
- 

Return to bug 64488