< prev index next >

src/java.base/share/classes/java/lang/reflect/Proxy.java

Print this page
8200127: Replace collection.stream().forEach() with collection.forEach()
Reviewed-by: alanb


 576                 access = "exported";
 577             } else if (isPackagePrivateType(c)) {
 578                 access = "package-private";
 579             } else {
 580                 access = "module-private";
 581             }
 582             ClassLoader ld = c.getClassLoader();
 583             return String.format("   %s/%s %s loader %s",
 584                     c.getModule().getName(), c.getName(), access, ld);
 585         }
 586 
 587         static void trace(String cn,
 588                           Module module,
 589                           ClassLoader loader,
 590                           List<Class<?>> interfaces) {
 591             if (isDebug()) {
 592                 System.err.format("PROXY: %s/%s defined by %s%n",
 593                                   module.getName(), cn, loader);
 594             }
 595             if (isDebug("debug")) {
 596                 interfaces.stream()
 597                           .forEach(c -> System.out.println(toDetails(c)));
 598             }
 599         }
 600 
 601         private static final String DEBUG =
 602             GetPropertyAction.privilegedGetProperty("jdk.proxy.debug", "");
 603 
 604         private static boolean isDebug() {
 605             return !DEBUG.isEmpty();
 606         }
 607         private static boolean isDebug(String flag) {
 608             return DEBUG.equals(flag);
 609         }
 610 
 611         // ProxyBuilder instance members start here....
 612 
 613         private final List<Class<?>> interfaces;
 614         private final Module module;
 615         ProxyBuilder(ClassLoader loader, List<Class<?>> interfaces) {
 616             if (!VM.isModuleSystemInited()) {
 617                 throw new InternalError("Proxy is not supported until "




 576                 access = "exported";
 577             } else if (isPackagePrivateType(c)) {
 578                 access = "package-private";
 579             } else {
 580                 access = "module-private";
 581             }
 582             ClassLoader ld = c.getClassLoader();
 583             return String.format("   %s/%s %s loader %s",
 584                     c.getModule().getName(), c.getName(), access, ld);
 585         }
 586 
 587         static void trace(String cn,
 588                           Module module,
 589                           ClassLoader loader,
 590                           List<Class<?>> interfaces) {
 591             if (isDebug()) {
 592                 System.err.format("PROXY: %s/%s defined by %s%n",
 593                                   module.getName(), cn, loader);
 594             }
 595             if (isDebug("debug")) {
 596                 interfaces.forEach(c -> System.out.println(toDetails(c)));

 597             }
 598         }
 599 
 600         private static final String DEBUG =
 601             GetPropertyAction.privilegedGetProperty("jdk.proxy.debug", "");
 602 
 603         private static boolean isDebug() {
 604             return !DEBUG.isEmpty();
 605         }
 606         private static boolean isDebug(String flag) {
 607             return DEBUG.equals(flag);
 608         }
 609 
 610         // ProxyBuilder instance members start here....
 611 
 612         private final List<Class<?>> interfaces;
 613         private final Module module;
 614         ProxyBuilder(ClassLoader loader, List<Class<?>> interfaces) {
 615             if (!VM.isModuleSystemInited()) {
 616                 throw new InternalError("Proxy is not supported until "


< prev index next >