Re: More Groovy 3 woes

2020-05-16 Thread OCsite
Daniel, > On 16 May 2020, at 2:42, Daniel.Sun wrote: >> having enclosed all the “foo as bar”'s in ternary operators in parentheses > We have fixed some issues related to ternary operator since Groovy 3 was > released. Please provide a code snippet to show the ternary operator issue > you mentione

Re: parser problem?

2020-05-16 Thread OCsite
Daniel, just for the record, the problem occurs with “1>2?[3] as Set:null” and similar expressions. It is not caused, far as I understand, solely by “as”, but rather by a combination with the “safe” (non-NPE) indexing syntax, as Paul mentioned before. > On 16 May 2020, at 2:51, Daniel.Sun wro

Re: More Groovy 3 woes

2020-05-16 Thread OCsite
Daniel, > On 16 May 2020, at 10:58, Daniel.Sun wrote: > The joint compilation issue should be fixed in Groovy 3.0.4, which will be > released in a couple of days. > > If you want to try in a hurry, here is link to SNAPSHOT: > https://github.com/apache/groovy/actions/runs/106435124 great, thanks

Re: parser problem?

2020-05-18 Thread OCsite
Hi there, > On 16 May 2020, at 2:41, Paul King wrote: > I'd suggest creating an issue for this. We might be able to improve Groovy or > if not we should assess whether the current doco around safe indexing > explains possible interactions well enough. GROOVY-9561

How to test and deploy without groovy-all? (was: More Groovy 3 woes)

2020-05-18 Thread OCsite
Hi there, > On 16 May 2020, at 14:17, OCsite wrote: > First, can you (or anyone) please suggest what to do with my classpath now > when groovy-all's gone? I still can't see a reasonable solution for that :( All the documentation I've found so far is > http://g

Re: How to test and deploy without groovy-all? (was: More Groovy 3 woes)

2020-05-18 Thread OCsite
cy… > > > org.codehaus.groovy > groovy-all > 2.5.9 > provided > pom > > > Now, while I do admit I have not tried a build yet with Groovy 3, the Maven > dependency for groovy-all does exist… > > > > &g

Re: How to test and deploy without groovy-all? (was: More Groovy 3 woes)

2020-05-18 Thread OCsite
> everything from groovy/lib on the classpath. > > I hope that gives you some ideas. > - Keith > > 1. https://github.com/gradle/gradle-groovy-all > <https://github.com/gradle/gradle-groovy-all> > >> On May 18, 2020, at 8:43 AM, OCsite mailto:o...@ocs.cz>>

Re: How to test and deploy without groovy-all?

2020-05-18 Thread OCsite
Thanks again, but... > On 18 May 2020, at 17:07, Mauro Molinari wrote: > > Il 18/05/20 16:29, OCsite ha scritto: >> Or am I wrong and there is some magic which would prevent this scenario? > Your application will fail at compilation time if some JAR is missing. > ... I am

Re: How to test and deploy without groovy-all?

2020-05-18 Thread OCsite
> On 18 May 2020, at 18:12, Mauro Molinari wrote: > > Il 18/05/20 17:48, OCsite ha scritto: >> (Actually I can't imagine the Maven/Gradle workflow to be considerably >> different: the principle of creating the application package and installing >> it plus all t

Re: How to test and deploy without groovy-all?

2020-05-18 Thread OCsite
tom build environment, > not some "common build too"), and not "just JAR"s? > > My 5 cents, > T > > On Mon, May 18, 2020 at 6:47 PM OCsite mailto:o...@ocs.cz>> > wrote: > >> On 18 May 2020, at 18:12, Mauro Molinari > <mailto:mauro

Re: How to test and deploy without groovy-all?

2020-05-18 Thread OCsite
er than managing > pre-installed dependencies on a build server. > > Andy > > [1] https://imperceptiblethoughts.com/shadow/ > <https://imperceptiblethoughts.com/shadow/> > [2] https://github.com/andyjduncan/serverless-dyndns > <https://github.com/andyjduncan/

ASTT to correctly work with pre-processed sources?

2020-05-18 Thread OCsite
There's another thing I'd like to ask for a help with. Some of my groovy sources are actually pre-processed (in a way remotely similar to the well-known CPP, i.e., before groovyc is called, a temporary groovy source is generated from one or more original sources; it's the generated temp file wh

Re: How to test and deploy without groovy-all?

2020-05-19 Thread OCsite
nothing less. Is there really any danger that such a JAR would get amongst the other modules unintentionally and unwanted?!? Again, I do apologise for my massive ignorance, but I really can't see how :-O Thanks, OC > From: OCsite mailto:o...@ocs.cz>> > Reply-To: "users@groov

Re: How to test and deploy without groovy-all?

2020-05-19 Thread OCsite
torisation, there'll be 5 or 6 out :) > On 19 May 2020, at 7:15, Jochen Theodorou wrote: > On 19.05.20 03:53, OCsite wrote: >> Well, thanks, I'll check the thing, though at the first look it rather >> seems to be a tool for a Gradle project owner who wants to move his >>

Re: ASTT to correctly work with pre-processed sources?

2020-05-19 Thread OCsite
uch, there could be problems. And then some :) Been there, done that, returned to the external fixes, leaving the preprocessed-file name and linenumbers in generated .classes. Thanks and all the best, OC > On Tue, May 19, 2020 at 12:19 PM OCsite mailto:o...@ocs.cz>> > wrote: &g

Re: How to test and deploy without groovy-all?

2020-05-19 Thread OCsite
at approach, far as I know that is, is impossible with JARs, for there's no information of the inter-version compatibility at all, so the point is moot. > On 19 May 2020, at 13:32, Paul King wrote: > > > On Tue, May 19, 2020 at 8:32 PM OCsite mailto:o...@ocs.cz>> > wro

Re: Loading groovy files from a remote repository

2020-05-24 Thread OCsite
Hi there, far as I know, you have to build your own index which would contain the classname:pathname pairs for all classes — I am afraid there's no standard tool which would do that for you automatically. Alas, it is essentially impossible to obtain the class information directly from a groovy

ASTT to convert positional to named?

2020-05-31 Thread OCsite
Hi there, for both convenience and considerably improved source readability and robustness, I am considering an ASTT which would convert positional arguments to named ones, i.e., something like @Named foo(bar,int bax=666,List baz) { ... whatever ... } turned to something like foo(Map __map=

Re: do I miss something here, or is this a Groovy bug?

2020-06-05 Thread OCsite
And another thing which I don't understand and seems highly suspicious — do I just miss something of importance, or is it a bug? === 127 ocs /tmp> /usr/local/groovy-3.0.4/bin/groovy q Caught: java.lang.VerifyError: Bad type on operand stack Exception Details: Location: q.main([Ljava/lang/S

how to determine whether a method was compiled or runtime-added?

2020-06-05 Thread OCsite
The reason I am playing now with metaclass is that I would need to check for a given method whether it exists (that's easy), and if it does, whether it's an originally compiled one or one added dynamically at runtime. What's the best (most robust and reliable) way to do that? So far I haven't f

Re: do I miss something here, or is this a Groovy bug?

2020-06-05 Thread OCsite
port :) Thanks a lot! OC [1] Agreed, using this might lead someone who is used to an object-oriented language like Ruby or Smalltalk to believe that it would work properly when inherited, but it would not, for Java's at best half-OO, half-C++-like-crap. But that's beside the point her

Re: What projects use Groovy as its main development language ?

2020-06-27 Thread OCsite
Mg, my main client here in Czech Republic allowed me to turn all our WebObjects projects from Java to Groovy years ago (and still there are non-trivial parts of the legacy codebase in the original Java :)) Those project include a couple of web applications like e.g., an auctioning system or a

Re: Calling original method from extension class

2020-07-17 Thread OCsite
Alberto, far as I understand properly, at the very least you should be able to do that programmatically, like this (do not forget ExpandoMetaClass.enableGlobally()): def original=UnicastRemoteObject.metaClass.getMetaMethod("toString", new Class[]) UnicastRemoteObject.metaClass.toString=

Re: Omitting parentheses on .size() ?

2020-08-01 Thread OCsite
MG, > On 1 Aug 2020, at 14:59, MG wrote: > What was the reason again Groovy does not add getSize() here... ?-) Consistency I guess. Having a List.size would lead to a request to add Map.size, which alas would clash with Map['size']. All the best, OC > On 01/08/2020 04:06, Paul King wrote: >>

Re: Omitting parentheses on .size() ?

2020-08-04 Thread OCsite
Guys, > On 4 Aug 2020, at 16:13, MG wrote: > On 04/08/2020 15:16, Basurita wrote: >> On 8/1/20 14:41, MG wrote: >>> Hmmm, I am for consistency, but at least I use very few maps as compared to >>> lists, and rarely ever output the size of a map, but constantly for >>> lists, so having getSize() o

Re: problem during calling method from closure

2020-10-14 Thread OCsite
Anton, > ...You cannot refer to the method of an object that has not yet been > constructed. As a matter of fact, you can. This darned Java “method-calling” lingo is terribly misleading; we definitely should have sticked with Alan Kay's “message-sending”, and there would be much less misunders

build/runtime versions

2020-12-22 Thread OCsite
Hi there, I have just found one of my clients might be using at his deployment site a different Groovy version than the one used to build the application — probably the worst case was a pretty old runtime version 2.3.8 for an app built with 2.4.17 (seems it runs OK, strangely enough). (i) are

parsing multipart/related soaps?

2021-02-16 Thread OCsite
Hi there, I am working with SOAP through the groovy-wslite library (willing to switch to another if there's one, but haven't found any other). The problem is the server gives me multipart/related responses, which cause the groovy-wslite SAX parser to choke on “Content is not allowed in prolog”.

Re: parsing multipart/related soaps?

2021-02-16 Thread OCsite
Well meantime I've found SimpleMimeReader, which does not quite work as-is, but can be comparatively easily tweaked to do what's needed. Still, if there's a groovier option for a SOAP client than groovy-wslite+SimpleMimeReader, I'd be interested... Thanks, OC > On 17 Fe

recognise empty closure?

2021-02-17 Thread OCsite
Hi there, is it possible to reliably recognise an empty closure, i.e., „{}“, programmatically? def foo(Closure bar) { if (?bar-is-empty?) throw new Exception('The closure cannot be empty!') else bar() } foo { println "ok" } // OK foo { 1 } // OK foo { } // throws Thanks! OC

Re: recognise empty closure?

2021-02-18 Thread OCsite
runtime AFAIK, but we >> could check and set some property to closure while compiling, then get the >> property at runtime. It will be an new improvement, not sure if others like >> it or not. >> >> Cheers, >> Daniel Sun >> >> On 2021/02/17 15:06:4

Geb Safari automation

2021-06-13 Thread OCsite
Hi there, I'd like to use Geb for a Safari (not FF/Chrome) automation; can anyone help? I've tried steps from this article: https://blog.codecentric.de/en/2013/02/browser-automation-and-acceptance-testing-with-geb/ just updated for Safari instead of Firefox and using current versions of the fr

Re: dynamically install a method/property to be visible through reflexion?

2021-08-28 Thread OCsite
Rachel, Paul, thanks a lot! Pity not even today's Java supports something like Objective-C runtime support for managing the methods in a class :( Anyway, I might try to create my (sub)classes dynamically at runtime — this is an idea which did not occur to me before; and although I can see some

Re: dynamically install a method/property to be visible through reflexion?

2021-08-30 Thread OCsite
Jochen, thanks a lot! > On 29 Aug 2021, at 19:22, Jochen Theodorou wrote: > On 28.08.21 14:46, OCsite wrote: >> Pity not even today's Java supports something like Objective-C runtime >> support for managing the methods in a class :( >> >> Anyway, I

Re: Checking directory state using Groovy

2021-10-15 Thread OCsite
James, if I understand right, for this you need the canXXX methods of File, which is a standard Java API (all Java APIs are directly accessible from Groovy): https://docs.oracle.com/javase/8/docs/api/index.html?java/io/File.html I doubt there's a groovier way for that, but of course I might be

Re: Checking directory state using Groovy

2021-10-20 Thread OCsite
James, > On 20. 10. 2021, at 13:18, James McMahon wrote: > One thing I've been thinking about recently is whether these refinements > always make things easier to read and maintain, or more cryptic and > difficult? Some groovy things I've seen sometimes make it a little more > difficult to unw

Style guide (was: Checking directory state using Groovy)

2021-10-20 Thread OCsite
Just in case someone happens to be checking this guide now based on my recommendation... > On 20 Oct 2021, at 14:00, OCsite wrote: > There used to be a style guide amongst the documentation somewhere, let me > see... here you are: http://groovy-lang.org/style-guide.html > &l

3 > 4 regression

2023-11-01 Thread OCsite
Hi there, looks like 3 used to inline private static finals, while 4 does not, which causes the following regression. Is that the intended behaviour, or a bug? Thanks, OC === 1030 ocs /tmp> /usr/local/groovy-3.0.8/bin/groovy q wth 1032 ocs /tmp> /usr/local/groovy-4.0.0-alpha-1/bin/groovy q.m C

Re: Small survey on the usage of the metaclass system and MOP

2024-01-08 Thread OCsite
Jochen, > On 8. 1. 2024, at 16:10, Jochen Theodorou wrote: > I would like to know from users on this list mostly if they are using > specific features of the meta class system and MOP, but especially what for. > > (1) categories > ... > use (CategoryClass) { > // some code and callstack here in

Re: Small survey on the usage of the metaclass system and MOP

2024-01-09 Thread OCsite
2024, at 22:12, Jochen Theodorou wrote: > > On 08.01.24 20:42, OCsite wrote: > [...]> - the extension class list is collected compile-time and (eventually >> when my build script creates the application) automatically added to the >> /org.codehaus.groovy.runtime.Extensio

Re: String comparison tests on exception messages keep failing due to >'< character keeps getting removed!

2024-05-13 Thread OCsite
Tommy, I am afraid I do not quite follow you. The assert seems to work all right, far as I can say: === 1029 ocs /tmp> /usr/local/groovy-4.0.21/bin/groovy q all ok 1031 ocs /tmp> === Do I overlook something of importance here? All the best, OC > On 13. 5. 2024, at 18:45, Tommy Svensson wro

Re: Sort on linkedlists with double values (inside main list)

2024-05-21 Thread OCsite
In general, this is not a safe approach, unless you are sure that the sorting algorithm is stable (never reordering items regarded „same“). I regret to say I do not know whether Groovy sort is documented to be always stable or not. All the best, OC > On 21. 5. 2024, at 7:12, M.v.Gulik wrote:

Re: Where do you find a community?

2024-05-26 Thread OCsite
Martin, I'd say the community is right here. Whenever I needed a help and neither the (excellent, in my opinion) documentation nor sites like Groovy Goodness (mrhaki, definitely worth checking whenever in doubt) helped, I've asked here, and almost always I've got helpful and very knowledgeable

How to make Geb work?

2024-10-17 Thread OCsite
Hi there, based on the latest debate in the devlist, I'm trying to play with Geb. The Book of Geb quite explicitly says that all I need is geb-core jar, a WebDriver driver implementation and the selenium-support jar , nevertheless, it does

Re: groovydoc woes

2025-02-04 Thread OCsite
icator Sorry you lost me here. With whom? > and we can try to sort out what is going on. Great, thanks a lot! And I haste to add the priority of all these requests is pretty low :) OC > On Wed, Feb 5, 2025 at 6:03 AM OCsite wrote: >> >> Hi there, >> >> I've

groovydoc woes

2025-02-04 Thread OCsite
Hi there, I've tried to use groovydoc, and at the first look, it does not seem to work quite well. Does anyone really use the thing? For one, it seems to ignore packages completely — although each of my classes contain the “package” line all right, the generated documentation shows “Default Pa

remove a class in ASTT?

2025-02-06 Thread OCsite
Hi there, is it possible, when encountering a class node in an ASTT, to remove it? Or to ensure somehow that the compiler skips it and does not generate anything further for it? The CONVERSION phase, if important. Thanks! OC

Re: Minor breaking change of chop(Iterator, int...) method for Groovy 5

2025-04-05 Thread OCsite
Hi there, > On 4. 4. 2025, at 23:09, Mattias Reichel wrote: > I don't see a problem making a breaking change in a major version update. Well it's always somewhat at the inconvenient side for us who maintain a big codebase. On the other hand, when it's easy to find and fix all the places where

Re: safe call evaluates arguments first?

2025-03-27 Thread OCsite
Thanks! Should I add a jira? Or will you? Or not worth one? All the best, OC > On 27. 3. 2025, at 21:28, Jochen Theodorou wrote: > > On 27.03.25 18:11, o...@ocs.cz wrote: >> Hi there, >> >> I've just bumped into this behaviour, as shown e.g., by the code quoted >> below. A safe method call f

Re: Compiling Java with Groovy

2025-04-07 Thread OCsite
Jochen, > On 7. 4. 2025, at 14:00, Jochen Theodorou wrote: > I wonder though... why use Groovy to compile Java? My own use case was that I've turned big Java projects to Groovy; the only reasonable way I've found was 1. to rename all .java sources to .groovy 2. to fix things which did not compi

Re: groovysh easily breaks

2025-04-30 Thread OCsite
Well either the following code makes sense, in which case it works, or use :c to cleanup, what's the problem? === 1068 ocs ~/Projects/WO_XC_2018> /usr/local/groovy-4.0.24/bin/groovysh Groovy Shell (4.0.24, JVM: 11.0.4-BellSoft) Type ':help' or ':h' for help. --

Re: groovysh easily breaks

2025-05-02 Thread OCsite
MG, well we got :D. Also we got :S, :x, and :p — just try :? All the best, OC > On 30. 4. 2025, at 17:25, MG wrote: > > Wait, we have :c - can we also get :o :) :D ... > > Ch;-)eers, > mg > > On 30/04/2025 14:22, OCsite wrote: >> Well either the following code

Re: safe call evaluates arguments first?

2025-03-29 Thread OCsite
https://issues.apache.org/jira/browse/GROOVY-11591 > On 28. 3. 2025, at 17:26, Jochen Theodorou wrote: > > please add an issue > > On 3/28/25 00:10, OCsite wrote: >> Thanks! >> >> Should I add a jira? Or will you? Or not worth one? >> >> All the

Re: Potential to include java.time.* as a default import for Groovy 5

2025-06-02 Thread OCsite
MG, just as for > ... letting people define their own... I might be just missing something of importance or not getting properly what you mean here, but I'd say Groovy already supports defining our own “compound imports” pretty nicely; there are at the very least two ways I know of: - you ca