Re: [PATCH] Prefer TMPDIR over hard coded /tmp

2018-04-25 Thread Alan Bateman
On 26/04/2018 01:45, Brian Burkhalter wrote: On Apr 25, 2018, at 5:38 PM, Brian Burkhalter wrote: The attached patch changed the behavior to use the content of the environment variable TMPDIR, if present. Note that this does not change where the hsperf* folders are created. The source ch

Re: Please review CSR : JDK-8200437 String#isBlank

2018-04-25 Thread Andrej Golovnin
Hi Jim, please add also the #isNotBlank() method. I know the one can write !str.isBlank(), but str.isNotBlank() is better from the readability standpoint of view. Also I think the new methods: #isBlank() #isNotBlank() // if you add it. #lines() and the old one String#isEmpty() should be defin

Re: (M) RFR: 8200167: Validate more special case invocations

2018-04-25 Thread David Holmes
Revised webrev: http://cr.openjdk.java.net/~dholmes/8200167/webrev.v2/ Karen formulated an additional test scenario invoking Object methods through an interface reference, which when turned into a new testcase demonstrated that the receiver typecheck was also missing in that case for Methodhan

Re: [PATCH] Prefer TMPDIR over hard coded /tmp

2018-04-25 Thread Bernd Eckenfels
Hello. For robustness reasons, should it maybe fall back to the hardcoded default if the target path does not exist or has the (obvious*) missing write permission? Gruss Bernd * with or without trying a actual write? -- http://bernd.eckenfels.net _ From: Brian Burkha

Re: [PATCH] regex matcher opt: remove redundant StringBuilder

2018-04-25 Thread Isaac Levy
yeah perhaps this is enough. Though users of appendReplacement are presumably after high performance loops or they'd be using a higher level API like replaceAll. I just can't imagine people using this API hit the format code exception in normal usage, and it's not like java is dumping junk into t

Re: [PATCH] Prefer TMPDIR over hard coded /tmp

2018-04-25 Thread Brian Burkhalter
On Apr 25, 2018, at 5:38 PM, Brian Burkhalter wrote: >> The attached patch changed the behavior to use the content of the >> environment variable TMPDIR, if present. Note that this does not change >> where the hsperf* folders are created. > > The source change looks OK to me aside from the co

Re: [PATCH] Prefer TMPDIR over hard coded /tmp

2018-04-25 Thread Brian Burkhalter
Hi Robert, On Apr 23, 2018, at 7:23 AM, Robert Stupp wrote: > For MacOS and Windows, Java prefers the user's temporary directory for > java.io.tmpdir, but not for Linux, where it is always set to /tmp. The burden > with this is that if you want to use a different temp directory, you have to >

Re: 8202284: FileChannel and FileOutpuStream variants of AtomicAppend should pass silently on macOS >= 10.13

2018-04-25 Thread Brian Burkhalter
https://bugs.openjdk.java.net/browse/JDK-8202290 to track this problem. Brian On Apr 25, 2018, at 3:37 PM, Brian Burkhalter wrote: > None yet. I awaiting direction as to whether I can reopen the inadvertently > resolved issue or whether I need to create a new issue with the same content. > I

Re: 8202284: FileChannel and FileOutpuStream variants of AtomicAppend should pass silently on macOS >= 10.13

2018-04-25 Thread Brian Burkhalter
None yet. I awaiting direction as to whether I can reopen the inadvertently resolved issue or whether I need to create a new issue with the same content. I think the latter. Brian On Apr 25, 2018, at 3:30 PM, Mikael Vidstedt wrote: > Which JBS issue is now covering the work of looking at the

Re: 8202284: FileChannel and FileOutpuStream variants of AtomicAppend should pass silently on macOS >= 10.13

2018-04-25 Thread Mikael Vidstedt
Which JBS issue is now covering the work of looking at the actual failure? Cheers, Mikael > On Apr 25, 2018, at 3:11 PM, Brian Burkhalter > wrote: > > Issue:https://bugs.openjdk.java.net/browse/JDK-8202284 > Patch:http://cr.openjdk.java.net/~bpb/8202284/webrev.00/ > > Suite o

Re: 8202062: Put FileChannel and FileOutpuStream variants of AtomicAppend on problem list

2018-04-25 Thread Brian Burkhalter
On Apr 24, 2018, at 11:05 PM, Alan Bateman wrote: > On 24/04/2018 23:15, Brian Burkhalter wrote: >> https://bugs.openjdk.java.net/browse/JDK-8202062 >> >> Recently more frequent failures have been observed on macOS. Put on the >> problem list until the underlying cause can be determined. >> >

8202284: FileChannel and FileOutpuStream variants of AtomicAppend should pass silently on macOS >= 10.13

2018-04-25 Thread Brian Burkhalter
Issue: https://bugs.openjdk.java.net/browse/JDK-8202284 Patch: http://cr.openjdk.java.net/~bpb/8202284/webrev.00/ Suite of [1]. Remove AtomicAppend tests from the problem list instead making then pass silently for macOS version >= 10.13. Thanks, Brian [1] http://mail.openjdk.java.net/piperm

Re: RFR: 8202184: Reduce time blocking the ClassSpecializer cache creating SpeciesData

2018-04-25 Thread Claes Redestad
Hi Peter, too late! :-) Good observation about us creating a new Function every time we look up an item. If we go with an Object as a reservation marker we could get away with a singleton static Function and still use computeIfAbsent (which I think is clearer and avoids creating a reservation

Re: RFR: JDK-8202105: jshell tool: on exiting, terminal echo is disabled

2018-04-25 Thread Xueming Shen
On 04/25/2018 01:39 PM, Jan Lahoda wrote: So, if I understand correctly, it would be: boolean flipEcho; and the readPassword would do something like: if (echo0() != false) { if (echo0()) { ... flipEcho = true; echo(false); } if (flipEcho) { //this would also be in the shutdown ho

Re: RFR: JDK-8202105: jshell tool: on exiting, terminal echo is disabled

2018-04-25 Thread Martin Buchholz
On Wed, Apr 25, 2018 at 1:34 PM, Jan Lahoda wrote: > > IIRC the call to System.console() in jshell/jline that is part of this > problem is basically a way to call Console.istty() - the returned Console > is not used. I was considering tweaking jshell to avoid this issue, and I > think it would be

Re: RFR: JDK-8202105: jshell tool: on exiting, terminal echo is disabled

2018-04-25 Thread Jan Lahoda
So, if I understand correctly, it would be: boolean flipEcho; and the readPassword would do something like: if (echo0() != false) { flipEcho = true; echo(false); } if (flipEcho) { //this would also be in the shutdown hook echo(!echo0()); } I guess I can do that (the variant with

Re: RFR: JDK-8202105: jshell tool: on exiting, terminal echo is disabled

2018-04-25 Thread Jan Lahoda
Hi Sherman, JShell uses two processes - the main one interacts with the terminal and compiles the user's snippets. The other one runs the snippets, and is not connected to a terminal, so System.console() does not work there. IIRC the call to System.console() in jshell/jline that is part of th

Re: RFR: JDK-8202105: jshell tool: on exiting, terminal echo is disabled

2018-04-25 Thread John Rose
On Apr 25, 2018, at 12:07 PM, Martin Buchholz wrote: > > For bonus points, only create the shutdown hook the first time readPassword > is called with echo on to appease the Emacs shell users with pitchforks. FTR, I use Emacs shell for everything except jshell, and have to launch a separate shell

Re: RFR: JDK-8202105: jshell tool: on exiting, terminal echo is disabled

2018-04-25 Thread Martin Buchholz
I keep hoping for something simpler. Is it possible to have more than one Console object? Looks like NO. Assuming no, then you simply need one static flag boolean restoreEcho; (it could also be an instance field of Console - that would be slightly more principled) In readPassword you check cur

Re: RFR: 8201274: Launch Single-File Source-Code Programs

2018-04-25 Thread Jonathan Gibbons
Kumar, Thank you for your feedback; I will incorporate it in the next webrev. -- Jon On 04/25/2018 09:38 AM, Kumar Srinivasan wrote: Hi John, I focused mainly on the native side, looks ok, except for a couple of minor issues. java.c 1320 const char *prop = "-Djdk.internal.j

Please review CSR : JDK-8200437 String#isBlank

2018-04-25 Thread Jim Laskey
Please review and mark as reviewed https://bugs.openjdk.java.net/browse/JDK-8200437

Please review CSR : JDK-8200378 String#strip, String#stripLeading, String#stripTrailing

2018-04-25 Thread Jim Laskey
Please review and mark as reviewed https://bugs.openjdk.java.net/browse/JDK-8200378

Please review CSR : JDK-8200373 String#trim JavaDoc should clarify meaning of space

2018-04-25 Thread Jim Laskey
Please review and mark as reviewed https://bugs.openjdk.java.net/browse/JDK-8200373

Please review CSR : JDK-8200425 String#lines

2018-04-25 Thread Jim Laskey
Please review and mark as reviewed https://bugs.openjdk.java.net/browse/JDK-8200425

Re: [11] RFR: 8202026 8193552 : ISO 4217 Amendment #165 # 166 Update

2018-04-25 Thread naoto . sato
Hi Leo, Although JDK11 is slated in 09/2018, enabling amendment 166 now is technically a bug, as it will be effective from June 4. Please use the transition mechanism in make/data/currency/CurrencyData.properties and test/jdk/java/util/Currency/tablea1.txt. OTOH, there are old (past) transit

Re: RFR: 8202184: Reduce time blocking the ClassSpecializer cache creating SpeciesData

2018-04-25 Thread Peter Levart
Hi Claes, Your patch is OK from logical point of view, but something bothers me a little. For each species data that gets cached, at least 3 objects are created: - the Function passed to computeIfAbsent - the unresolved SpeciesData object that serves as a placeholder - the 2nd resolved Specie

Re: RFR: 8201274: Launch Single-File Source-Code Programs

2018-04-25 Thread Kumar Srinivasan
Hi John, I focused mainly on the native side, looks ok, except for a couple of minor issues. java.c 1320 const char *prop = "-Djdk.internal.javac.source="; 1321 size_t size = JLI_StrLen(prop) + JLI_StrLen(value) + 1; 1322 char *propValue = (char

Re: RFR: JDK-8202105: jshell tool: on exiting, terminal echo is disabled

2018-04-25 Thread Xueming Shen
On 4/25/18, 9:02 AM, Martin Buchholz wrote: It would be more correct I think for Console to track if there is a pending readPassword in progress and try to restore echo on exit only if so. But a little annoying to implement (need an additional boolean?) I think that is what Jan proposed "to a

Re: JDK 11 RFR of 8200478: For boxing conversion javac uses Long.valueOf which does not guarantee caching according to its javadoc

2018-04-25 Thread joe darcy
Hi Jon, On 4/25/2018 8:57 AM, Jonathan Gibbons wrote: Joe, While I note that the primary text has been modified to include long types, the italic comment that follows still ends with the following: Notice that integer literals of type|long|are allowed, but not required, to be shared. --

Re: RFR: JDK-8202105: jshell tool: on exiting, terminal echo is disabled

2018-04-25 Thread Martin Buchholz
It would be more correct I think for Console to track if there is a pending readPassword in progress and try to restore echo on exit only if so. But a little annoying to implement (need an additional boolean?) On Wed, Apr 25, 2018 at 8:52 AM, Xueming Shen wrote: > > Hi Jan, > > I saw System.con

Re: JDK 11 RFR of 8200478: For boxing conversion javac uses Long.valueOf which does not guarantee caching according to its javadoc

2018-04-25 Thread Jonathan Gibbons
Joe, While I note that the primary text has been modified to include long types, the italic comment that follows still ends with the following: Notice that integer literals of type|long|are allowed, but not required, to be shared. -- Jon On 4/25/18 8:18 AM, joe darcy wrote: Hi David, On

Re: RFR: JDK-8202105: jshell tool: on exiting, terminal echo is disabled

2018-04-25 Thread Xueming Shen
Hi Jan, I saw System.console() returns null inside jshell ... but it seems there are 2 vms. I would assume jshell itself sets the terminal to raw and then call System.console()? for example an alternative for this issue is to ask jshell's impl to call System.console() before going into raw m

Re: RFR: JDK-8190187: C++ code calling JNI_CreateJavaVM can be killed by Java

2018-04-25 Thread Adam Farley8
Hi All, Here is the code to resolve JDK-8190187: http://cr.openjdk.java.net/~mhorie/8190187/hg_diff.txt Could a committer please take the fix and: 1) Complete the CSR process for the new JNI Return code. 2) Commit the changes that contain the Return code. And, optionally, 3) Perform 1 and 2

Re: JDK 11 RFR of 8200478: For boxing conversion javac uses Long.valueOf which does not guarantee caching according to its javadoc

2018-04-25 Thread joe darcy
Hi David, On 4/25/2018 5:08 AM, David Holmes wrote: Hi Joe, On 25/04/2018 10:30 AM, joe darcy wrote: Hello, Please review the patch below to update the specification of Long.valueOf(long) to require caching on [-128, 127]. The JDK implementation of this functionality has always cached in th

Re: [PATCH] RFR Bug-pending: Enable Hotspot to Track Native Memory Usage for Direct Byte Buffers

2018-04-25 Thread Adam Farley8
> On 13/04/2018 15:14, Adam Farley8 wrote: >> Hi Alan, Peter, >> >> I see that native memory is tracked in java.nio.Bits, but that only includes what the user thinks they are allocating. >> >> When the VM adds extra memory to the allocation amount this extra bit is not represented in the Bits

Re: JDK 11 RFR of 8200478: For boxing conversion javac uses Long.valueOf which does not guarantee caching according to its javadoc

2018-04-25 Thread David Holmes
Hi Joe, On 25/04/2018 10:30 AM, joe darcy wrote: Hello, Please review the patch below to update the specification of Long.valueOf(long) to require caching on [-128, 127]. The JDK implementation of this functionality has always cached in that region, even though it is not required. Seems ve

RFR: JDK-8202105: jshell tool: on exiting, terminal echo is disabled

2018-04-25 Thread Jan Lahoda
Hi, Under: https://bugs.openjdk.java.net/browse/JDK-8194750 j.i.Console was changed to capture the state of the terminal echo at creation time, and to restore it on shutdown. That is problematic at least in jshell, where the terminal is already in the raw mode when j.i.Console is created, an

Re: RFR: 8202184: Reduce time blocking the ClassSpecializer cache creating SpeciesData

2018-04-25 Thread Peter Levart
On 04/25/2018 10:06 AM, Claes Redestad wrote: Besides, CHM.computeIfAbsent has a non-synchronizing fast-path for when the key exists, lines 1731-1734:     else if (fh == h    // check first node without acquiring lock && ((fk = f.key) == key || (fk != null && ke

Re: RFR: 8202184: Reduce time blocking the ClassSpecializer cache creating SpeciesData

2018-04-25 Thread Claes Redestad
Hi Paul, On 2018-04-24 21:01, Paul Sandoz wrote: Hi, This looks good. thanks! Took me a while to understand the interactions: you need to replace not update otherwise there is a race on isResolved (which currently queries multiple state, there is no singular guard here). We could push isR

Re: RFR: 8202184: Reduce time blocking the ClassSpecializer cache creating SpeciesData

2018-04-25 Thread Claes Redestad
Hi Peter, On 2018-04-25 08:36, Peter Levart wrote: Hi Claes, Nice play with CHM and safe publication. thanks, I was curious how you'd react to this. :-) If findSpecies() is on a hot concurrent path, [...] It'd be surprising if it was: findSpecies is typically called once for a specific

Re: RFR of JDK-8201469,test under java/rmi should be restricted to not run concurrently

2018-04-25 Thread Hamlin Li
Hi Paul, Joe, Thank you for the comments. Following directories are added in the exclusiveAccess.dirs list: */  java/rmi   (so, java/rmi/Naming is removed)/**/ /**/  com/sun/jndi/rmi/**/ /**/  sun/rmi/* for the test/bug number and time cost please check following table, here time cost is the