equal
deleted
inserted
replaced
62 * jdk.nio.maxCachedBufferSize property. Even though |
62 * jdk.nio.maxCachedBufferSize property. Even though |
63 * ByteBuffer.capacity() returns an int, we're using a long here |
63 * ByteBuffer.capacity() returns an int, we're using a long here |
64 * for potential future-proofing. |
64 * for potential future-proofing. |
65 */ |
65 */ |
66 private static long getMaxCachedBufferSize() { |
66 private static long getMaxCachedBufferSize() { |
67 String s = java.security.AccessController.doPrivileged( |
67 String s = GetPropertyAction.getProperty("jdk.nio.maxCachedBufferSize"); |
68 new PrivilegedAction<String>() { |
|
69 @Override |
|
70 public String run() { |
|
71 return System.getProperty("jdk.nio.maxCachedBufferSize"); |
|
72 } |
|
73 }); |
|
74 if (s != null) { |
68 if (s != null) { |
75 try { |
69 try { |
76 long m = Long.parseLong(s); |
70 long m = Long.parseLong(s); |
77 if (m >= 0) { |
71 if (m >= 0) { |
78 return m; |
72 return m; |
469 |
463 |
470 static boolean atBugLevel(String bl) { // package-private |
464 static boolean atBugLevel(String bl) { // package-private |
471 if (bugLevel == null) { |
465 if (bugLevel == null) { |
472 if (!jdk.internal.misc.VM.isBooted()) |
466 if (!jdk.internal.misc.VM.isBooted()) |
473 return false; |
467 return false; |
474 String value = AccessController.doPrivileged( |
468 String value = GetPropertyAction.getProperty("sun.nio.ch.bugLevel"); |
475 new GetPropertyAction("sun.nio.ch.bugLevel")); |
|
476 bugLevel = (value != null) ? value : ""; |
469 bugLevel = (value != null) ? value : ""; |
477 } |
470 } |
478 return bugLevel.equals(bl); |
471 return bugLevel.equals(bl); |
479 } |
472 } |
480 |
473 |