From robert.field at oracle.com Thu Mar 1 06:12:27 2018 From: robert.field at oracle.com (Robert Field) Date: Wed, 28 Feb 2018 22:12:27 -0800 Subject: RFR 8184445: JShell tests: fail intermittently if tests are run in high concurrent mode. In-Reply-To: <5A961075.6060007@oracle.com> References: <5a77bf38-7ce4-35c9-4721-65482b9a8fae@oracle.com> <52c15ebf-9adb-07ef-7d30-69ebbe6c598f@oracle.com> <5105b8c9-784b-c878-aff6-134dcb6bedfc@oracle.com> <5A961075.6060007@oracle.com> Message-ID: An updated version with only the launching tests in exclusiveAccess and the common harness code moved up into lib: ?? http://cr.openjdk.java.net/~rfield/8184445v1.webrev/ Warning: this takes this fix from tiny to massive. Much effort has already been put into hardening JShell's launching networking code.? There is probably more that could be done, but I wouldn't know what. -Robert On 02/27/18 18:14, Joseph D. Darcy wrote: > Hi Robert, > > I'd prefer if only the launching tests and other known failures were > segregated into a non-concurrent area. That would still let ~3/4 of > the tests proceed normally. > > As a follow-up, can an RFE be filed to harden the intermittently > failing tests against concurrent networking? > > Thanks, > > -Joe > > On 2/27/2018 12:21 PM, Robert Field wrote: >> OK, I did a survey of all the JShell bugs.? There are over a dozen >> intermittent test failures, almost all are probably network related.? >> But if we limit to just intermittent failures to launch, then there >> are seven. >> >> There are 17 tests of launching configuration, and 75 'normal' >> tests.? So, the launching configuration tests do fail >> disproportionately, 3 mentioned failures vs 5 mentioned failing files. >> >> The bug that highlighted the concurrent testing -- "JShell tests: >> fail intermittently if tests are run in high concurrent mode": >> ??? https://bugs.openjdk.java.net/browse/JDK-8184445 >> mentioned 'several' issues, the two included JTR files are, >> tellingly, normal tests. >> >> The non-launching intermittent failures are all normal tests. >> >> So, where does that leave us?? I could reduce the failures a bit at >> low time-cost by putting the launching configuration tests in the >> exclusiveAccess.dirs.? Or, I could, at considerable testing cost, >> address the broad swath. >> >> -Robert >> >> On 02/26/18 17:28, joe darcy wrote: >>> Hi Robert, >>> >>> On 2/26/2018 10:57 AM, Robert Field wrote: >>>> >>>> >>>> On 02/26/18 10:23, joe darcy wrote: >>>>> Hi Robert, >>>>> >>>>> The fix looks acceptable in terms of addressing the problem, but >>>>> is there a sense of how this might impact running time of the test >>>>> suite? >>>>> >>>>> Phrased differently, are there plans to make the tests more robust >>>>> to concurrent runs in the future? >>>> >>>> Hi Joe, >>>> >>>> There is a lot of network connection happening in these tests, most >>>> of which is in layers we don't control (JDI). We have been trying >>>> to lower the risk and we don't see failures running the tests >>>> ourselves, but intermittent failures scattered through the suite >>>> during testing (e.g. mach5) have been a constant problem. >>>> >>>> We will see the impact on test duration.? Default connection has >>>> three-level fail-over, the tests of other connection modes see >>>> failure far more frequently, so, if necessary, we can look at >>>> tuning this. >>>> >>> >>> From some quick checking, there are about 80 tests in that >>> directory. From one sample point on my laptop, the tests took a good >>> long while to run. If some of the tests can be reliably run >>> concurrently, I'd much prefer to see a subset of tests moved to a >>> sheltered directory. >>> >>> Thanks, >>> >>> -Joe >> > From robert.field at oracle.com Thu Mar 15 21:13:28 2018 From: robert.field at oracle.com (Robert Field) Date: Thu, 15 Mar 2018 14:13:28 -0700 Subject: RFR 8198801: JShell: user exception chained cause not retained Message-ID: <185d5de5-2389-7fc4-6136-d4b5870ab6cc@oracle.com> Please review. See bug report for details: ??? https://bugs.openjdk.java.net/browse/JDK-8198801 Webrev: ??? http://cr.openjdk.java.net/~rfield/8198801v0.webrev/ Thanks, Robert From bitterfoxc at gmail.com Sun Mar 18 14:06:09 2018 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Sun, 18 Mar 2018 23:06:09 +0900 Subject: RFR 8199762: JShell API: Failed to detect override when snippet to be overridden has been changed before Message-ID: Hi, Please review following: Webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8199762/webrev/ Bugs: https://bugs.openjdk.java.net/browse/JDK-8199762 Regards, shinyafox(Shinya Yoshida) From robert.field at oracle.com Mon Mar 19 00:11:19 2018 From: robert.field at oracle.com (Robert Field) Date: Sun, 18 Mar 2018 17:11:19 -0700 Subject: RFR 8199762: JShell API: Failed to detect override when snippet to be overridden has been changed before In-Reply-To: References: Message-ID: Thanks for reporting this and taking it on. An unwritten design choice is that Key and its subtypes are immutable. note that all Key fields are final.? Mutable fields are held on Snippet and its subtypes. Currently, only "isNew" methods are having their qualified parameter types computed (because modified methods (same signature) can't overwrite methods that haven't already been overwritten by the original).? A side-effect of that though is that though is in cases like this, it is sitting null.? You address this by moving it to MethodKey, but that has the problems mentioned above. For defined methods we always want it set. There seem to be a number of ways this could be done.? I believe, removing the "isNew &&" test would be the simplest. Thanks, Robert On 03/18/18 07:06, ShinyaYoshida wrote: > Hi, > > Please review following: > Webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8199762/webrev/ > > Bugs: https://bugs.openjdk.java.net/browse/JDK-8199762 > > Regards, > shinyafox(Shinya Yoshida) From bitterfoxc at gmail.com Tue Mar 20 06:44:52 2018 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Tue, 20 Mar 2018 15:44:52 +0900 Subject: RFR 8199762: JShell API: Failed to detect override when snippet to be overridden has been changed before In-Reply-To: References: Message-ID: Hi Robert, Thank you for the kind review. As you mentioned, removing "isNew &&" seems simplest, can keep the contract of Key classes and works well. I've updated the webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8199762/webrev.01/ Please check this again. Regards, shinyafox(Shinya Yoshida) 2018-03-19 9:11 GMT+09:00 Robert Field : > Thanks for reporting this and taking it on. > > An unwritten design choice is that Key and its subtypes are immutable. > note that all Key fields are final. Mutable fields are held on Snippet and > its subtypes. > > Currently, only "isNew" methods are having their qualified parameter types > computed (because modified methods (same signature) can't overwrite methods > that haven't already been overwritten by the original). A side-effect of > that though is that though is in cases like this, it is sitting null. You > address this by moving it to MethodKey, but that has the problems mentioned > above. > > For defined methods we always want it set. There seem to be a number of > ways this could be done. I believe, removing the "isNew &&" test would be > the simplest. > > Thanks, > Robert > > > > > On 03/18/18 07:06, ShinyaYoshida wrote: > >> Hi, >> >> Please review following: >> Webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8199762/webrev/ >> >> Bugs: https://bugs.openjdk.java.net/browse/JDK-8199762 >> >> Regards, >> shinyafox(Shinya Yoshida) >> > > From sormuras at gmail.com Tue Mar 20 21:13:44 2018 From: sormuras at gmail.com (Christian Stein) Date: Tue, 20 Mar 2018 22:13:44 +0100 Subject: /open URI Message-ID: Hi! Is supporting a URI as the parameter for /open a feature you'd consider to add? Something like /open https://host/path/script.jsh At the moment I'm semi-automatically pre-loading a set of required scripts using `Files.copy` before /open them as standard files. See [1] for details. Cheers, Christian [1] https://github.com/sormuras/bach#bootstrap-on-the-fly From spullara+kulla-dev at gmail.com Tue Mar 20 22:26:47 2018 From: spullara+kulla-dev at gmail.com (Sam Pullara) Date: Tue, 20 Mar 2018 15:26:47 -0700 Subject: Using jshell with libraries Message-ID: Hi all, I don't know if you all have talked this to death but the jshell as it exists today isn't that useful to me because almost all my use cases require either 3rd party libraries or local code. Downloading the code and setting the classpath in each environment I want to use it doesn't seem that great. So instead, I have been using a jshell variant: https://github.com/kawasima/try-artifact . The variant lets me easily add 3rd party dependencies in the shell from the central maven repository so you can do things like: | Welcome to JShell -- Version (version info not available) | Type /help for help -> /resolve com.amazonaws:aws-java-sdk-s3:1.11.297 | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-s3/1.11 .297/aws-java-sdk-s3-1.11.297.jar added to classpath | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-kms/1.1 1.297/aws-java-sdk-kms-1.11.297.jar added to classpath | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-core/1. 11.297/aws-java-sdk-core-1.11.297.jar added to classpath | Path /Users/sam/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar added to classpath | Path /Users/sam/.m2/repository/org/apache/httpcomponents/httpclient/4.5.5/httpclient-4.5.5.jar added to classpath | Path /Users/sam/.m2/repository/org/apache/httpcomponents/httpcore/4.4.9/httpcore-4.4.9.jar added to classpath | Path /Users/sam/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar added to classpath | Path /Users/sam/.m2/repository/software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2.jar added to classpath | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson -databind/2.6.7.1/jackson-databind-2.6.7.1.jar added to classpath | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson -annotations/2.6.0/jackson-annotations-2.6.0.jar added to classpath | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson -core/2.6.7/jackson-core-2.6.7.jar added to classpath | Path /Users/sam/.m2/repository/com/fasterxml/jackson/dataformat/j ackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7.jar added to classpath | Path /Users/sam/.m2/repository/joda-time/joda-time/2.8.1/joda-time-2.8.1.jar added to classpath | Path /Users/sam/.m2/repository/com/amazonaws/jmespath-java/1.11.297/jmespath-java-1.11.297.jar added to classpath -> var s3 = new com.amazonaws.services.s3.AmazonS3Client() | Added variable s3 of type com.amazonaws.services.s3.AmazonS3Client with initial value com.amazonaws.services.s3.AmazonS3Client at 463b4ac8 Which is obviously much easier than downloading the artifacts and managing the classpath. Has there been much thought in adding something like this to the jshell that comes with the JDK? Sam From robert.field at oracle.com Wed Mar 21 03:51:28 2018 From: robert.field at oracle.com (Robert Field) Date: Tue, 20 Mar 2018 20:51:28 -0700 Subject: Using jshell with libraries In-Reply-To: References: Message-ID: <302dca51-1949-d9c4-4151-5e0015776c7b@oracle.com> [Add cc: kawasima] Hi Sam, We have talked about this, but not talked it to death.? Mostly what we talked about are ways to make functionality like this available as a plug-in to JShell. Can you help my understanding of how you use these tools: once you have done your exploration with jshell/try-artifact, do you then download and use -classpath on the compiler or... ? Thanks, Robert On 03/20/18 15:26, Sam Pullara wrote: > Hi all, > > I don't know if you all have talked this to death but the jshell as it > exists today isn't that useful to me because almost all my use cases > require either 3rd party libraries or local code. Downloading the code and > setting the classpath in each environment I want to use it doesn't seem > that great. So instead, I have been using a jshell variant: > https://github.com/kawasima/try-artifact . The variant lets me easily add > 3rd party dependencies in the shell from the central maven repository so > you can do things like: > > | Welcome to JShell -- Version (version info not available) > > | Type /help for help > > > -> /resolve com.amazonaws:aws-java-sdk-s3:1.11.297 > > | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-s3/1.11 > .297/aws-java-sdk-s3-1.11.297.jar added to classpath > > | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-kms/1.1 > 1.297/aws-java-sdk-kms-1.11.297.jar added to classpath > > | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-core/1. > 11.297/aws-java-sdk-core-1.11.297.jar added to classpath > > | Path /Users/sam/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar > added to classpath > > | Path /Users/sam/.m2/repository/org/apache/httpcomponents/httpclient/4.5.5/httpclient-4.5.5.jar > added to classpath > > | Path /Users/sam/.m2/repository/org/apache/httpcomponents/httpcore/4.4.9/httpcore-4.4.9.jar > added to classpath > > | Path /Users/sam/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar > added to classpath > > | Path /Users/sam/.m2/repository/software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2.jar > added to classpath > > | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson > -databind/2.6.7.1/jackson-databind-2.6.7.1.jar added to classpath > > | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson > -annotations/2.6.0/jackson-annotations-2.6.0.jar added to classpath > > | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson > -core/2.6.7/jackson-core-2.6.7.jar added to classpath > > | Path /Users/sam/.m2/repository/com/fasterxml/jackson/dataformat/j > ackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7.jar added to > classpath > > | Path /Users/sam/.m2/repository/joda-time/joda-time/2.8.1/joda-time-2.8.1.jar > added to classpath > > | Path /Users/sam/.m2/repository/com/amazonaws/jmespath-java/1.11.297/jmespath-java-1.11.297.jar > added to classpath > > > -> var s3 = new com.amazonaws.services.s3.AmazonS3Client() > > | Added variable s3 of type com.amazonaws.services.s3.AmazonS3Client with > initial value com.amazonaws.services.s3.AmazonS3Client at 463b4ac8 > > > > Which is obviously much easier than downloading the artifacts and managing > the classpath. Has there been much thought in adding something like this to > the jshell that comes with the JDK? > > Sam From robert.field at oracle.com Wed Mar 21 03:58:43 2018 From: robert.field at oracle.com (Robert Field) Date: Tue, 20 Mar 2018 20:58:43 -0700 Subject: /open URI In-Reply-To: References: Message-ID: <235f22d0-60bc-971c-fee0-60ebc6445f3d@oracle.com> Thanks, I like it.? This seems like it would be useful in tutorials and education. I've created: ???? https://bugs.openjdk.java.net/browse/JDK-8199912 -Robert On 03/20/18 14:13, Christian Stein wrote: > Hi! > > Is supporting a URI as the parameter for /open > a feature you'd consider to add? Something like > > /open https://host/path/script.jsh > > At the moment I'm semi-automatically pre-loading > a set of required scripts using `Files.copy` before > /open them as standard files. See [1] for details. > > Cheers, > Christian > > [1] https://github.com/sormuras/bach#bootstrap-on-the-fly From spullara+kulla-dev at gmail.com Wed Mar 21 04:55:46 2018 From: spullara+kulla-dev at gmail.com (Sam Pullara) Date: Tue, 20 Mar 2018 21:55:46 -0700 Subject: Using jshell with libraries In-Reply-To: <302dca51-1949-d9c4-4151-5e0015776c7b@oracle.com> References: <302dca51-1949-d9c4-4151-5e0015776c7b@oracle.com> Message-ID: Let's say I want to send someone a jshell script that accesses S3. What do I tell them to do before running it? I'm not intending on using jshell for exploration but for running scripts. Even if I was though, I would just add those same artifacts to maven. UPDATE: While I was writing this I realize that you all didn't intend it to work this way at all and that it is supposed to be purely interactive. I don't know how you arrived at that decision but not being able to use it with #!/usr/bin/jshell ...script... is very surprising since the other normal repls like python, etc intend them to be used either for scripting or interactively. It deeply surprises me that jshell doesn't ignore the #! at the beginning and still outputs all its normal stuff when run in that way and ultimately enters interactive mode. Big miss imho. Guess I will move on since the intended use cases don't match up with my expectations. That said, I agree with you that the compiler should also resolve dependencies and we failed to make a module system that handled dependencies. Still saddens me that the module system is focused on access control rather than dependency resolution. I was on the original JSR and pushed as hard as I could for that for years. Sam On Tue, Mar 20, 2018 at 8:51 PM, Robert Field wrote: > [Add cc: kawasima] > > Hi Sam, > > We have talked about this, but not talked it to death. Mostly what we > talked about are ways to make functionality like this available as a > plug-in to JShell. > > Can you help my understanding of how you use these tools: once you have > done your exploration with jshell/try-artifact, do you then download and > use -classpath on the compiler or... ? > > Thanks, > Robert > > > > > On 03/20/18 15:26, Sam Pullara wrote: > >> Hi all, >> >> I don't know if you all have talked this to death but the jshell as it >> exists today isn't that useful to me because almost all my use cases >> require either 3rd party libraries or local code. Downloading the code and >> setting the classpath in each environment I want to use it doesn't seem >> that great. So instead, I have been using a jshell variant: >> https://github.com/kawasima/try-artifact . The variant lets me easily add >> 3rd party dependencies in the shell from the central maven repository so >> you can do things like: >> >> | Welcome to JShell -- Version (version info not available) >> >> | Type /help for help >> >> >> -> /resolve com.amazonaws:aws-java-sdk-s3:1.11.297 >> >> | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-s3/1.11 >> .297/aws-java-sdk-s3-1.11.297.jar added to classpath >> >> | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-kms/1.1 >> 1.297/aws-java-sdk-kms-1.11.297.jar added to classpath >> >> | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-core/1. >> 11.297/aws-java-sdk-core-1.11.297.jar added to classpath >> >> | Path /Users/sam/.m2/repository/commons-logging/commons-logging/1. >> 1.3/commons-logging-1.1.3.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/org/apache/httpcomponents/httpclie >> nt/4.5.5/httpclient-4.5.5.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/org/apache/httpcomponents/httpcore >> /4.4.9/httpcore-4.4.9.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/commons-codec/commons-codec/1.10/ >> commons-codec-1.10.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/software/amazon/ion/ion-java/1.0. >> 2/ion-java-1.0.2.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >> -databind/2.6.7.1/jackson-databind-2.6.7.1.jar added to classpath >> >> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >> -annotations/2.6.0/jackson-annotations-2.6.0.jar added to classpath >> >> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >> -core/2.6.7/jackson-core-2.6.7.jar added to classpath >> >> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/dataformat/j >> ackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7.jar added to >> classpath >> >> | Path /Users/sam/.m2/repository/joda-time/joda-time/2.8.1/joda- >> time-2.8.1.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/com/amazonaws/jmespath-java/1.11.2 >> 97/jmespath-java-1.11.297.jar >> added to classpath >> >> >> -> var s3 = new com.amazonaws.services.s3.AmazonS3Client() >> >> | Added variable s3 of type com.amazonaws.services.s3.AmazonS3Client >> with >> initial value com.amazonaws.services.s3.AmazonS3Client at 463b4ac8 >> >> >> >> Which is obviously much easier than downloading the artifacts and managing >> the classpath. Has there been much thought in adding something like this >> to >> the jshell that comes with the JDK? >> >> Sam >> > > From cay at horstmann.com Wed Mar 21 13:40:48 2018 From: cay at horstmann.com (Cay Horstmann) Date: Wed, 21 Mar 2018 06:40:48 -0700 Subject: Using jshell with libraries In-Reply-To: References: <302dca51-1949-d9c4-4151-5e0015776c7b@oracle.com> Message-ID: <04c55e5f-2f96-a390-2167-fd9ad455d34c@horstmann.com> Actually, I would like to be able to use jshell with the AWS library for exploration, not for running scripts. And yes, it would be a dreadful pain to have to manually identify and acquire a multitude of dependent JARs and add them to the class path. It's not a deal breaker for me if JShell never supports this scenario because I can always invoke the Scala REPL from sbt. But that's not a convenient option for everyone. I don't want to drag JPMS into the discussion. It is what it is, and it has nothing to do with dependency resolution. There is one standard for dependency resolution in the Java world--the ubiquitous mechanism used by Maven, Ivy, sbt, etc... Cheers, Cay Le 20/03/2018 ? 21:55, Sam Pullara a ?crit?: > Let's say I want to send someone a jshell script that accesses S3. What do > I tell them to do before running it? I'm not intending on using jshell for > exploration but for running scripts. Even if I was though, I would just add > those same artifacts to maven. > > UPDATE: While I was writing this I realize that you all didn't intend it to > work this way at all and that it is supposed to be purely interactive. I > don't know how you arrived at that decision but not being able to use it > with > > #!/usr/bin/jshell > ...script... > > is very surprising since the other normal repls like python, etc intend > them to be used either for scripting or interactively. It deeply surprises > me that jshell doesn't ignore the #! at the beginning and still outputs all > its normal stuff when run in that way and ultimately enters interactive > mode. Big miss imho. Guess I will move on since the intended use cases > don't match up with my expectations. > > That said, I agree with you that the compiler should also resolve > dependencies and we failed to make a module system that handled > dependencies. Still saddens me that the module system is focused on access > control rather than dependency resolution. I was on the original JSR and > pushed as hard as I could for that for years. > > Sam > > > On Tue, Mar 20, 2018 at 8:51 PM, Robert Field > wrote: > >> [Add cc: kawasima] >> >> Hi Sam, >> >> We have talked about this, but not talked it to death. Mostly what we >> talked about are ways to make functionality like this available as a >> plug-in to JShell. >> >> Can you help my understanding of how you use these tools: once you have >> done your exploration with jshell/try-artifact, do you then download and >> use -classpath on the compiler or... ? >> >> Thanks, >> Robert >> >> >> >> >> On 03/20/18 15:26, Sam Pullara wrote: >> >>> Hi all, >>> >>> I don't know if you all have talked this to death but the jshell as it >>> exists today isn't that useful to me because almost all my use cases >>> require either 3rd party libraries or local code. Downloading the code and >>> setting the classpath in each environment I want to use it doesn't seem >>> that great. So instead, I have been using a jshell variant: >>> https://github.com/kawasima/try-artifact . The variant lets me easily add >>> 3rd party dependencies in the shell from the central maven repository so >>> you can do things like: >>> >>> | Welcome to JShell -- Version (version info not available) >>> >>> | Type /help for help >>> >>> >>> -> /resolve com.amazonaws:aws-java-sdk-s3:1.11.297 >>> >>> | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-s3/1.11 >>> .297/aws-java-sdk-s3-1.11.297.jar added to classpath >>> >>> | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-kms/1.1 >>> 1.297/aws-java-sdk-kms-1.11.297.jar added to classpath >>> >>> | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-core/1. >>> 11.297/aws-java-sdk-core-1.11.297.jar added to classpath >>> >>> | Path /Users/sam/.m2/repository/commons-logging/commons-logging/1. >>> 1.3/commons-logging-1.1.3.jar >>> added to classpath >>> >>> | Path /Users/sam/.m2/repository/org/apache/httpcomponents/httpclie >>> nt/4.5.5/httpclient-4.5.5.jar >>> added to classpath >>> >>> | Path /Users/sam/.m2/repository/org/apache/httpcomponents/httpcore >>> /4.4.9/httpcore-4.4.9.jar >>> added to classpath >>> >>> | Path /Users/sam/.m2/repository/commons-codec/commons-codec/1.10/ >>> commons-codec-1.10.jar >>> added to classpath >>> >>> | Path /Users/sam/.m2/repository/software/amazon/ion/ion-java/1.0. >>> 2/ion-java-1.0.2.jar >>> added to classpath >>> >>> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >>> -databind/2.6.7.1/jackson-databind-2.6.7.1.jar added to classpath >>> >>> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >>> -annotations/2.6.0/jackson-annotations-2.6.0.jar added to classpath >>> >>> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >>> -core/2.6.7/jackson-core-2.6.7.jar added to classpath >>> >>> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/dataformat/j >>> ackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7.jar added to >>> classpath >>> >>> | Path /Users/sam/.m2/repository/joda-time/joda-time/2.8.1/joda- >>> time-2.8.1.jar >>> added to classpath >>> >>> | Path /Users/sam/.m2/repository/com/amazonaws/jmespath-java/1.11.2 >>> 97/jmespath-java-1.11.297.jar >>> added to classpath >>> >>> >>> -> var s3 = new com.amazonaws.services.s3.AmazonS3Client() >>> >>> | Added variable s3 of type com.amazonaws.services.s3.AmazonS3Client >>> with >>> initial value com.amazonaws.services.s3.AmazonS3Client at 463b4ac8 >>> >>> >>> >>> Which is obviously much easier than downloading the artifacts and managing >>> the classpath. Has there been much thought in adding something like this >>> to >>> the jshell that comes with the JDK? >>> >>> Sam >>> >> >> -- Cay S. Horstmann | http://horstmann.com | mailto:cay at horstmann.com From bitterfoxc at gmail.com Wed Mar 21 18:24:41 2018 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Thu, 22 Mar 2018 03:24:41 +0900 Subject: Using jshell with libraries In-Reply-To: <302dca51-1949-d9c4-4151-5e0015776c7b@oracle.com> References: <302dca51-1949-d9c4-4151-5e0015776c7b@oracle.com> Message-ID: Hi Sam, Cay, and Robert, As Robert mentioned above, I've tried to add plug-in feature to jshell. We was developing prototypes of plug-in feature like: jshell> /plugin add try-artifact.jar /resolve is installed jshel> /resolve com.amazonaws:aws-java-sdk-s3:1.11.297 installing com.amazonaws:aws-java-sdk-s3:1.11.297... jshell> // now you can use aws-java-sdk-s2 We ware close to the train, but unfortunately, we missed the train of JDK9. (Though we've started to discuss such feature after May/2016, the feature complete was May/2016 and feature extension complete was Dec/2016...) On the other hand, fortunately, we have a new rapid release cycle model. So if it can, I'd like to try to develop the plug-in feature again and ship it as soon as we can. What do you think? Can this kind of feature solve your issues? JFYI, shebang feature was also requested before and Brian says[1] ``` I understand why you'd like to coopt jshell into this -- after all, it is convenient and it seems "so close" -- but this is trying to turn jshell into something it wasn't designed for. But this wasn't an oversight; we deliberately chose to leave this *outside* of the jshell requirements, because it feels like an entirely different feature. More generally, "hacks" like this always come back to bite you. What you want is a "no main, no compile java runner". Jshell looks like that, but it isn't. When you have nothing, a little of something seems like a really good idea; but the warts will become apparent almost immediately. I'd much rather do nothing for this now, and consider doing something better in the future, than doing something bad now -- which is what this would be. ``` And we actually may have another feature of java command: http://openjdk.java.net/jeps/8192920 FYI for jshell with dependency management system, I'm developing jshell-integration with maven and gradle: https://github.com/bitterfox/jshell-maven-plugin https://github.com/bitterfox/jshell-gradle-plugin Using these plugin, you can launch jshell with dependencies written in pom.xml or build.gradle. [1]: http://mail.openjdk.java.net/pipermail/kulla-dev/2016-October/001689.html Regards, shinyafox(Shinya Yoshida) 2018-03-21 12:51 GMT+09:00 Robert Field : > [Add cc: kawasima] > > Hi Sam, > > We have talked about this, but not talked it to death. Mostly what we > talked about are ways to make functionality like this available as a > plug-in to JShell. > > Can you help my understanding of how you use these tools: once you have > done your exploration with jshell/try-artifact, do you then download and > use -classpath on the compiler or... ? > > Thanks, > Robert > > > > > On 03/20/18 15:26, Sam Pullara wrote: > >> Hi all, >> >> I don't know if you all have talked this to death but the jshell as it >> exists today isn't that useful to me because almost all my use cases >> require either 3rd party libraries or local code. Downloading the code and >> setting the classpath in each environment I want to use it doesn't seem >> that great. So instead, I have been using a jshell variant: >> https://github.com/kawasima/try-artifact . The variant lets me easily add >> 3rd party dependencies in the shell from the central maven repository so >> you can do things like: >> >> | Welcome to JShell -- Version (version info not available) >> >> | Type /help for help >> >> >> -> /resolve com.amazonaws:aws-java-sdk-s3:1.11.297 >> >> | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-s3/1.11 >> .297/aws-java-sdk-s3-1.11.297.jar added to classpath >> >> | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-kms/1.1 >> 1.297/aws-java-sdk-kms-1.11.297.jar added to classpath >> >> | Path /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-core/1. >> 11.297/aws-java-sdk-core-1.11.297.jar added to classpath >> >> | Path /Users/sam/.m2/repository/commons-logging/commons-logging/1. >> 1.3/commons-logging-1.1.3.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/org/apache/httpcomponents/httpclie >> nt/4.5.5/httpclient-4.5.5.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/org/apache/httpcomponents/httpcore >> /4.4.9/httpcore-4.4.9.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/commons-codec/commons-codec/1.10/c >> ommons-codec-1.10.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/software/amazon/ion/ion-java/1.0.2 >> /ion-java-1.0.2.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >> -databind/2.6.7.1/jackson-databind-2.6.7.1.jar added to classpath >> >> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >> -annotations/2.6.0/jackson-annotations-2.6.0.jar added to classpath >> >> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >> -core/2.6.7/jackson-core-2.6.7.jar added to classpath >> >> | Path /Users/sam/.m2/repository/com/fasterxml/jackson/dataformat/j >> ackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7.jar added to >> classpath >> >> | Path /Users/sam/.m2/repository/joda-time/joda-time/2.8.1/joda-tim >> e-2.8.1.jar >> added to classpath >> >> | Path /Users/sam/.m2/repository/com/amazonaws/jmespath-java/1.11.2 >> 97/jmespath-java-1.11.297.jar >> added to classpath >> >> >> -> var s3 = new com.amazonaws.services.s3.AmazonS3Client() >> >> | Added variable s3 of type com.amazonaws.services.s3.AmazonS3Client >> with >> initial value com.amazonaws.services.s3.AmazonS3Client at 463b4ac8 >> >> >> >> Which is obviously much easier than downloading the artifacts and managing >> the classpath. Has there been much thought in adding something like this >> to >> the jshell that comes with the JDK? >> >> Sam >> > > From robert.field at oracle.com Wed Mar 21 22:10:16 2018 From: robert.field at oracle.com (Robert Field) Date: Wed, 21 Mar 2018 15:10:16 -0700 Subject: Using jshell with libraries In-Reply-To: References: <302dca51-1949-d9c4-4151-5e0015776c7b@oracle.com> Message-ID: <4b653073-2efd-77e9-96b3-e004e7777db2@oracle.com> Thanks Shinya, I'd definitely like to see the plug-in functionality addressed. We have less than three months for the JDK 11 train, but if it is far enough long that would work, and if not JDK 12 is only six months after. As Cay points out, this resolution functionality would be useful for exploration as well.? Correct me if I'm wrong but there would be no precedent for integrating dependency management into the JDK?? Assuming that is true, then plug-in is the path for this. Allowing the plug-in JAR to be referenced by URI might ease usage. -Robert On 03/21/18 11:24, ShinyaYoshida wrote: > Hi Sam, Cay, and Robert, > > As Robert mentioned above, I've tried to add plug-in feature to jshell. > We was developing prototypes of plug-in feature like: > jshell> /plugin add try-artifact.jar > /resolve is installed > jshel> /resolve?com.amazonaws:aws-java-sdk-s3:1.11.297 > installing?com.amazonaws:aws-java-sdk-s3:1.11.297... > jshell> // now you can use aws-java-sdk-s2 > > We ware close to the train, but unfortunately, we missed the train of > JDK9. > (Though we've started to discuss such feature after May/2016, the > feature complete was May/2016 and feature extension complete was > Dec/2016...) > On the other hand, fortunately, we have a new rapid release cycle model. > So if it can, I'd like to try to develop the plug-in feature again and > ship it as soon as we can. > > What do you think? > Can this kind of feature solve your issues? > > JFYI, shebang feature was also requested before and Brian says[1] > ``` > I understand why you'd like to coopt jshell into this -- after all, it > is convenient and it seems "so close" -- but this is trying to turn > jshell into something it wasn't designed for. But this wasn't an > oversight; we deliberately chose to leave this *outside* of the jshell > requirements, because it feels like an entirely different feature. > More generally, "hacks" like this always come back to bite you. What > you want is a "no main, no compile java runner". Jshell looks like > that, but it isn't. When you have nothing, a little of something seems > like a really good idea; but the warts will become apparent almost > immediately. I'd much rather do nothing for this now, and consider > doing something better in the future, than doing something bad now -- > which is what this would be. > ``` > And we actually may have another feature of java command: > http://openjdk.java.net/jeps/8192920 > > FYI for?jshell with dependency management system, I'm developing > jshell-integration with maven and gradle: > https://github.com/bitterfox/jshell-maven-plugin > https://github.com/bitterfox/jshell-gradle-plugin > Using these plugin, you can launch jshell?with dependencies written in > pom.xml or build.gradle. > > [1]: > http://mail.openjdk.java.net/pipermail/kulla-dev/2016-October/001689.html > > Regards, > shinyafox(Shinya Yoshida) > > 2018-03-21 12:51 GMT+09:00 Robert Field >: > > [Add cc: kawasima] > > Hi Sam, > > We have talked about this, but not talked it to death. Mostly what > we talked about are ways to make functionality like this available > as a plug-in to JShell. > > Can you help my understanding of how you use these tools: once you > have done your exploration with jshell/try-artifact, do you then > download and use -classpath on the compiler or... ? > > Thanks, > Robert > > > > > On 03/20/18 15:26, Sam Pullara wrote: > > Hi all, > > I don't know if you all have talked this to death but the > jshell as it > exists today isn't that useful to me because almost all my use > cases > require either 3rd party libraries or local code. Downloading > the code and > setting the classpath in each environment I want to use it > doesn't seem > that great. So instead, I have been using a jshell variant: > https://github.com/kawasima/try-artifact > . The variant lets > me easily add > 3rd party dependencies in the shell from the central maven > repository so > you can do things like: > > |? Welcome to JShell -- Version (version info not available) > > |? Type /help for help > > > -> /resolve com.amazonaws:aws-java-sdk-s3:1.11.297 > > |? Path > /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-s3/1.11 > .297/aws-java-sdk-s3-1.11.297.jar added to classpath > > |? Path > /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-kms/1.1 > 1.297/aws-java-sdk-kms-1.11.297.jar added to classpath > > |? Path > /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-core/1. > 11.297/aws-java-sdk-core-1.11.297.jar added to classpath > > |? Path > /Users/sam/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar > added to classpath > > |? Path > /Users/sam/.m2/repository/org/apache/httpcomponents/httpclient/4.5.5/httpclient-4.5.5.jar > added to classpath > > |? Path > /Users/sam/.m2/repository/org/apache/httpcomponents/httpcore/4.4.9/httpcore-4.4.9.jar > added to classpath > > |? Path > /Users/sam/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar > added to classpath > > |? Path > /Users/sam/.m2/repository/software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2.jar > added to classpath > > |? Path > /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson > -databind/2.6.7.1/jackson-databind-2.6.7.1.jar > added to classpath > > |? Path > /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson > -annotations/2.6.0/jackson-annotations-2.6.0.jar added to > classpath > > |? Path > /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson > -core/2.6.7/jackson-core-2.6.7.jar added to classpath > > |? Path > /Users/sam/.m2/repository/com/fasterxml/jackson/dataformat/j > ackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7.jar > added to > classpath > > |? Path > /Users/sam/.m2/repository/joda-time/joda-time/2.8.1/joda-time-2.8.1.jar > added to classpath > > |? Path > /Users/sam/.m2/repository/com/amazonaws/jmespath-java/1.11.297/jmespath-java-1.11.297.jar > added to classpath > > > -> var s3 = new com.amazonaws.services.s3.AmazonS3Client() > > |? Added variable s3 of type > com.amazonaws.services.s3.AmazonS3Client with > initial value com.amazonaws.services.s3.AmazonS3Client at 463b4ac8 > > > > Which is obviously much easier than downloading the artifacts > and managing > the classpath. Has there been much thought in adding something > like this to > the jshell that comes with the JDK? > > Sam > > > From robert.field at oracle.com Wed Mar 21 23:03:42 2018 From: robert.field at oracle.com (Robert Field) Date: Wed, 21 Mar 2018 16:03:42 -0700 Subject: RFR 8199762: JShell API: Failed to detect override when snippet to be overridden has been changed before In-Reply-To: References: Message-ID: <3c079971-680d-9b78-287d-9f451f8748b8@oracle.com> Looks good! -Robert On 03/19/18 23:44, ShinyaYoshida wrote: > Hi Robert, > Thank you for the kind review. > > As you mentioned, removing "isNew &&" seems simplest, can keep the > contract of Key classes and works well. > > I've updated the webrev: > http://cr.openjdk.java.net/~shinyafox/kulla/8199762/webrev.01/ > > Please check this again. > > Regards, > shinyafox(Shinya Yoshida) > > 2018-03-19 9:11 GMT+09:00 Robert Field >: > > Thanks for reporting this and taking it on. > > An unwritten design choice is that Key and its subtypes are > immutable. note that all Key fields are final. Mutable fields are > held on Snippet and its subtypes. > > Currently, only "isNew" methods are having their qualified > parameter types computed (because modified methods (same > signature) can't overwrite methods that haven't already been > overwritten by the original).? A side-effect of that though is > that though is in cases like this, it is sitting null.? You > address this by moving it to MethodKey, but that has the problems > mentioned above. > > For defined methods we always want it set. There seem to be a > number of ways this could be done.? I believe, removing the "isNew > &&" test would be the simplest. > > Thanks, > Robert > > > > > On 03/18/18 07:06, ShinyaYoshida wrote: > > Hi, > > Please review following: > Webrev: > http://cr.openjdk.java.net/~shinyafox/kulla/8199762/webrev/ > > > Bugs: https://bugs.openjdk.java.net/browse/JDK-8199762 > > > Regards, > shinyafox(Shinya Yoshida) > > > From sormuras at gmail.com Thu Mar 22 11:43:44 2018 From: sormuras at gmail.com (Christian Stein) Date: Thu, 22 Mar 2018 12:43:44 +0100 Subject: Using jshell with libraries In-Reply-To: <4b653073-2efd-77e9-96b3-e004e7777db2@oracle.com> References: <302dca51-1949-d9c4-4151-5e0015776c7b@oracle.com> <4b653073-2efd-77e9-96b3-e004e7777db2@oracle.com> Message-ID: On Wed, Mar 21, 2018 at 11:10 PM, Robert Field wrote: > Thanks Shinya, > > I'd definitely like to see the plug-in functionality addressed. [...] > Which really sounds like a useful addition to jshell. > [...] Allowing the plug-in JAR to be referenced by URI might ease usage. > Reminds me of the "/open URI" feature request: https://bugs.openjdk.java.net/browse/JDK-8199912 At least the "load file from URI" implementation can be re-used then. Cheers, Christian From benjamin.john.evans at gmail.com Thu Mar 22 14:01:38 2018 From: benjamin.john.evans at gmail.com (Ben Evans) Date: Thu, 22 Mar 2018 10:01:38 -0400 Subject: Using jshell with libraries In-Reply-To: <4b653073-2efd-77e9-96b3-e004e7777db2@oracle.com> References: <302dca51-1949-d9c4-4151-5e0015776c7b@oracle.com> <4b653073-2efd-77e9-96b3-e004e7777db2@oracle.com> Message-ID: Hi Robert and Shinya, This sounds like an interesting idea, and I think it's an area where JUGs and the community would be interested in helping (either testing it and maybe helping with development of it). What state is the plugin mechanism currently in, and where's the code for it? Does it patch cleanly against HEAD? It would be great to get this in for 11, as it's the LTS release, and I suspect the next "baseline" release for most shops after Java 8. Thanks, Ben On Wed, Mar 21, 2018 at 6:10 PM, Robert Field wrote: > Thanks Shinya, > > I'd definitely like to see the plug-in functionality addressed. We have less > than three months for the JDK 11 train, but if it is far enough long that > would work, and if not JDK 12 is only six months after. > > As Cay points out, this resolution functionality would be useful for > exploration as well. Correct me if I'm wrong but there would be no > precedent for integrating dependency management into the JDK? Assuming that > is true, then plug-in is the path for this. Allowing the plug-in JAR to be > referenced by URI might ease usage. > > -Robert > > > > On 03/21/18 11:24, ShinyaYoshida wrote: >> >> Hi Sam, Cay, and Robert, >> >> As Robert mentioned above, I've tried to add plug-in feature to jshell. >> We was developing prototypes of plug-in feature like: >> jshell> /plugin add try-artifact.jar >> /resolve is installed >> jshel> /resolve com.amazonaws:aws-java-sdk-s3:1.11.297 >> installing com.amazonaws:aws-java-sdk-s3:1.11.297... >> jshell> // now you can use aws-java-sdk-s2 >> >> We ware close to the train, but unfortunately, we missed the train of >> JDK9. >> (Though we've started to discuss such feature after May/2016, the feature >> complete was May/2016 and feature extension complete was Dec/2016...) >> On the other hand, fortunately, we have a new rapid release cycle model. >> So if it can, I'd like to try to develop the plug-in feature again and >> ship it as soon as we can. >> >> What do you think? >> Can this kind of feature solve your issues? >> >> JFYI, shebang feature was also requested before and Brian says[1] >> ``` >> I understand why you'd like to coopt jshell into this -- after all, it is >> convenient and it seems "so close" -- but this is trying to turn jshell into >> something it wasn't designed for. But this wasn't an oversight; we >> deliberately chose to leave this *outside* of the jshell requirements, >> because it feels like an entirely different feature. More generally, "hacks" >> like this always come back to bite you. What you want is a "no main, no >> compile java runner". Jshell looks like that, but it isn't. When you have >> nothing, a little of something seems like a really good idea; but the warts >> will become apparent almost immediately. I'd much rather do nothing for this >> now, and consider doing something better in the future, than doing something >> bad now -- which is what this would be. >> ``` >> And we actually may have another feature of java command: >> http://openjdk.java.net/jeps/8192920 >> >> FYI for jshell with dependency management system, I'm developing >> jshell-integration with maven and gradle: >> https://github.com/bitterfox/jshell-maven-plugin >> https://github.com/bitterfox/jshell-gradle-plugin >> Using these plugin, you can launch jshell with dependencies written in >> pom.xml or build.gradle. >> >> [1]: >> http://mail.openjdk.java.net/pipermail/kulla-dev/2016-October/001689.html >> >> Regards, >> shinyafox(Shinya Yoshida) >> >> 2018-03-21 12:51 GMT+09:00 Robert Field > >: >> >> >> [Add cc: kawasima] >> >> Hi Sam, >> >> We have talked about this, but not talked it to death. Mostly what >> we talked about are ways to make functionality like this available >> as a plug-in to JShell. >> >> Can you help my understanding of how you use these tools: once you >> have done your exploration with jshell/try-artifact, do you then >> download and use -classpath on the compiler or... ? >> >> Thanks, >> Robert >> >> >> >> >> On 03/20/18 15:26, Sam Pullara wrote: >> >> Hi all, >> >> I don't know if you all have talked this to death but the >> jshell as it >> exists today isn't that useful to me because almost all my use >> cases >> require either 3rd party libraries or local code. Downloading >> the code and >> setting the classpath in each environment I want to use it >> doesn't seem >> that great. So instead, I have been using a jshell variant: >> https://github.com/kawasima/try-artifact >> . The variant lets >> me easily add >> 3rd party dependencies in the shell from the central maven >> repository so >> you can do things like: >> >> | Welcome to JShell -- Version (version info not available) >> >> | Type /help for help >> >> >> -> /resolve com.amazonaws:aws-java-sdk-s3:1.11.297 >> >> | Path >> /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-s3/1.11 >> .297/aws-java-sdk-s3-1.11.297.jar added to classpath >> >> | Path >> /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-kms/1.1 >> 1.297/aws-java-sdk-kms-1.11.297.jar added to classpath >> >> | Path >> /Users/sam/.m2/repository/com/amazonaws/aws-java-sdk-core/1. >> 11.297/aws-java-sdk-core-1.11.297.jar added to classpath >> >> | Path >> >> /Users/sam/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar >> added to classpath >> >> | Path >> >> /Users/sam/.m2/repository/org/apache/httpcomponents/httpclient/4.5.5/httpclient-4.5.5.jar >> added to classpath >> >> | Path >> >> /Users/sam/.m2/repository/org/apache/httpcomponents/httpcore/4.4.9/httpcore-4.4.9.jar >> added to classpath >> >> | Path >> >> /Users/sam/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar >> added to classpath >> >> | Path >> >> /Users/sam/.m2/repository/software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2.jar >> added to classpath >> >> | Path >> /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >> -databind/2.6.7.1/jackson-databind-2.6.7.1.jar >> added to classpath >> >> | Path >> /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >> -annotations/2.6.0/jackson-annotations-2.6.0.jar added to >> classpath >> >> | Path >> /Users/sam/.m2/repository/com/fasterxml/jackson/core/jackson >> -core/2.6.7/jackson-core-2.6.7.jar added to classpath >> >> | Path >> /Users/sam/.m2/repository/com/fasterxml/jackson/dataformat/j >> ackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7.jar >> added to >> classpath >> >> | Path >> >> /Users/sam/.m2/repository/joda-time/joda-time/2.8.1/joda-time-2.8.1.jar >> added to classpath >> >> | Path >> >> /Users/sam/.m2/repository/com/amazonaws/jmespath-java/1.11.297/jmespath-java-1.11.297.jar >> added to classpath >> >> >> -> var s3 = new com.amazonaws.services.s3.AmazonS3Client() >> >> | Added variable s3 of type >> com.amazonaws.services.s3.AmazonS3Client with >> initial value com.amazonaws.services.s3.AmazonS3Client at 463b4ac8 >> >> >> >> Which is obviously much easier than downloading the artifacts >> and managing >> the classpath. Has there been much thought in adding something >> like this to >> the jshell that comes with the JDK? >> >> Sam >> >> >> > From robert.field at oracle.com Thu Mar 22 18:29:40 2018 From: robert.field at oracle.com (Robert Field) Date: Thu, 22 Mar 2018 11:29:40 -0700 Subject: Using jshell with libraries In-Reply-To: References: <302dca51-1949-d9c4-4151-5e0015776c7b@oracle.com> <4b653073-2efd-77e9-96b3-e004e7777db2@oracle.com> Message-ID: > On Mar 22, 2018, at 4:43 AM, Christian Stein wrote: > > > > On Wed, Mar 21, 2018 at 11:10 PM, Robert Field > wrote: > Thanks Shinya, > > I'd definitely like to see the plug-in functionality addressed. [...] > > > Which really sounds like a useful addition to jshell. > > [...] Allowing the plug-in JAR to be referenced by URI might ease usage. > > Reminds me of the "/open URI" feature request: > > https://bugs.openjdk.java.net/browse/JDK-8199912 Not by accident. That is what got me thinking about it: if /open then jshell and jshell -start ? -Robert > > At least the "load file from URI" implementation can be re-used then. > > Cheers, > Christian From bitterfoxc at gmail.com Sat Mar 24 06:16:09 2018 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Sat, 24 Mar 2018 15:16:09 +0900 Subject: RFR 8199762: JShell API: Failed to detect override when snippet to be overridden has been changed before In-Reply-To: <3c079971-680d-9b78-287d-9f451f8748b8@oracle.com> References: <3c079971-680d-9b78-287d-9f451f8748b8@oracle.com> Message-ID: Robert, Thank you for the review. Just pushed: http://hg.openjdk.java.net/jdk/jdk/rev/f14852315495 Regards, shinyafox(Shinya Yoshida) 2018-03-22 8:03 GMT+09:00 Robert Field : > Looks good! > > -Robert > > > On 03/19/18 23:44, ShinyaYoshida wrote: > > Hi Robert, > Thank you for the kind review. > > As you mentioned, removing "isNew &&" seems simplest, can keep the > contract of Key classes and works well. > > I've updated the webrev: http://cr.openjdk.java.net/~shinyafox/kulla/ > 8199762/webrev.01/ > Please check this again. > > Regards, > shinyafox(Shinya Yoshida) > > 2018-03-19 9:11 GMT+09:00 Robert Field : > >> Thanks for reporting this and taking it on. >> >> An unwritten design choice is that Key and its subtypes are immutable. >> note that all Key fields are final. Mutable fields are held on Snippet and >> its subtypes. >> >> Currently, only "isNew" methods are having their qualified parameter >> types computed (because modified methods (same signature) can't overwrite >> methods that haven't already been overwritten by the original). A >> side-effect of that though is that though is in cases like this, it is >> sitting null. You address this by moving it to MethodKey, but that has the >> problems mentioned above. >> >> For defined methods we always want it set. There seem to be a number of >> ways this could be done. I believe, removing the "isNew &&" test would be >> the simplest. >> >> Thanks, >> Robert >> >> >> >> >> On 03/18/18 07:06, ShinyaYoshida wrote: >> >>> Hi, >>> >>> Please review following: >>> Webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8199762/webrev/ >>> >>> Bugs: https://bugs.openjdk.java.net/browse/JDK-8199762 >>> >>> Regards, >>> shinyafox(Shinya Yoshida) >>> >> >> > > From bitterfoxc at gmail.com Sat Mar 24 13:55:14 2018 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Sat, 24 Mar 2018 22:55:14 +0900 Subject: RFR 8129843: JShell: method cannot call method with different number of arguments Message-ID: Hi, Please review following: Bugs: https://bugs.openjdk.java.net/browse/JDK-8129843 Webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8129843/webrev/ Regards, shinyafox(Shinya Yoshida) From bitterfoxc at gmail.com Sat Mar 24 17:32:10 2018 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Sun, 25 Mar 2018 02:32:10 +0900 Subject: RFR 8199907: JShell API: NoSuchFieldError occurred due to accessing variables of intersection type inferred by `var` Message-ID: Hi, Please review the following fix: Webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8199907/webrev/ Bugs: https://bugs.openjdk.java.net/browse/JDK-8199907 Regards, shinyafox(Shinya Yoshida) From robert.field at oracle.com Sat Mar 24 21:00:03 2018 From: robert.field at oracle.com (Robert Field) Date: Sat, 24 Mar 2018 14:00:03 -0700 Subject: RFR 8199907: JShell API: NoSuchFieldError occurred due to accessing variables of intersection type inferred by `var` In-Reply-To: References: Message-ID: Hi Shinya, Thanks for finding and looking into this. Please add a description of the cause of the problem and the proposed fix to the bug. Please add documentation to the code. Thanks, Robert > On Mar 24, 2018, at 10:32 AM, ShinyaYoshida wrote: > > Hi, > > Please review the following fix: > Webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8199907/webrev/ > Bugs: https://bugs.openjdk.java.net/browse/JDK-8199907 > > Regards, > shinyafox(Shinya Yoshida) From bitterfoxc at gmail.com Sun Mar 25 06:55:25 2018 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Sun, 25 Mar 2018 15:55:25 +0900 Subject: RFR 8199907: JShell API: NoSuchFieldError occurred due to accessing variables of intersection type inferred by `var` In-Reply-To: References: Message-ID: Hi Robert, I've updated bug: https://bugs.openjdk.java.net/browse/JDK-8199907?focusedCommentId=14166600&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14166600 I've realized that there is more simple fix thus I've updated webrev also: http://cr.openjdk.java.net/~shinyafox/kulla/8199907/webrev.01/ Regards, shinyafox(Shinya Yoshida) 2018-03-25 6:00 GMT+09:00 Robert Field : > Hi Shinya, > > Thanks for finding and looking into this. > > Please add a description of the cause of the problem and the proposed fix > to the bug. > > Please add documentation to the code. > > Thanks, > Robert > > > > On Mar 24, 2018, at 10:32 AM, ShinyaYoshida > wrote: > > > > Hi, > > > > Please review the following fix: > > Webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8199907/webrev/ > > Bugs: https://bugs.openjdk.java.net/browse/JDK-8199907 > > > > Regards, > > shinyafox(Shinya Yoshida) > > From robert.field at oracle.com Mon Mar 26 18:51:58 2018 From: robert.field at oracle.com (Robert Field) Date: Mon, 26 Mar 2018 11:51:58 -0700 Subject: RFR 8199907: JShell API: NoSuchFieldError occurred due to accessing variables of intersection type inferred by `var` In-Reply-To: References: Message-ID: Shinya, The changes look good to me. Jan, This is your code being changed, so I would like your review. Thanks, Robert On 03/24/18 23:55, ShinyaYoshida wrote: > Hi Robert, > > I've updated bug: > https://bugs.openjdk.java.net/browse/JDK-8199907?focusedCommentId=14166600&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14166600 > > I've realized that there is more simple fix thus I've updatedwebrevalso: > http://cr.openjdk.java.net/~shinyafox/kulla/8199907/webrev.01/ > > > Regards, > shinyafox(Shinya Yoshida) > > 2018-03-25 6:00 GMT+09:00 Robert Field >: > > Hi Shinya, > > Thanks for finding and looking into this. > > Please add a description of the cause of the problem and the > proposed fix to the bug. > > Please add documentation to the code. > > Thanks, > Robert > > > > On Mar 24, 2018, at 10:32 AM, ShinyaYoshida > > wrote: > > > > Hi, > > > > Please review the following fix: > > Webrev: > http://cr.openjdk.java.net/~shinyafox/kulla/8199907/webrev/ > > > Bugs: https://bugs.openjdk.java.net/browse/JDK-8199907 > > > > > Regards, > > shinyafox(Shinya Yoshida) > > From robert.field at oracle.com Fri Mar 30 22:25:59 2018 From: robert.field at oracle.com (Robert Field) Date: Fri, 30 Mar 2018 15:25:59 -0700 Subject: RFR 8129843: JShell: method cannot call method with different number of arguments In-Reply-To: References: Message-ID: This is an important bug to fix -- not common but confusing and can't be easily worked around.? Nice work. Eval -- Nit: 950 don't know why this setWrap is being called again, was just done on line 941. Using the Iterable forEach rather than Stream's is good. Nit: the layout of 1048-1050 looks like overloadMethods() uses Result.? Another //where after Result would be one approach. Every eval is going to go through overloadMethods() which will loop through all methods, even when the eval contains no methods. Adding a cut-off would be good. The code needs more documentation JShell -- JShell is for conceptually very central functionality -- public and support of public.? I don't think this is the right place for matchedMethods(). Thanks, Robert On 03/24/18 06:55, ShinyaYoshida wrote: > Hi, > Please review following: > > Bugs: https://bugs.openjdk.java.net/browse/JDK-8129843 > Webrev: http://cr.openjdk.java.net/~shinyafox/kulla/8129843/webrev/ > > Regards, > shinyafox(Shinya Yoshida)