small medium large xlarge

Errata for Programming Groovy 2

 

The latest version of the book is P1.0, released almost 3 years ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:

If you've found a new error, please submit it.

  • Typo
  • Tech. error
  • Suggestion
  • Maybe next edition
  • Not a problem
  • Reported in: P1.0 (02-Aug-13)
#52300
PDF page: xvii

soooo--Shahzad Butt

  • Reported in: P1.0 (07-Aug-13)
#52335
PDF page: xvii
You list a method for computing a 5% raise on 80,000. That would be 4,000. However, your method is this: Integer.metaClass.percentRaise = { amount ...more...
  • Reported in: P1.0 (29-Apr-14)
#76745
PDF page: xvii

Soooo... is not a typo but the author is stressing "So".--Naga Pemmaraju

  • Reported in: P1.0 (02-Aug-13)
#52305
PDF page: xviii

and memory today than large computers had decades ago.

it should be

and memory today is larger than the large computers had decades ago.

  • Reported in: P1.0 (05-Aug-13)
#52316
PDF page: 5
groovy:000> 'mom'.l ERROR groovy.lang.MissingPropertyException: No such property: l for class: java.lang.String at groovysh_evaluate.run (g...more...
  • Reported in: P1.0 (05-Aug-13)
#52325
PDF page: 16
println "groovy -v".execute().text This didn't work for me on Windows 7. I get the following error. Caught: java.io.IOException: Cannot run prog...more...
  • Reported in: P1.0 (07-Aug-13)
#52340
PDF page: 16
You have an example like this: println "groovy -v".execute().text You say: "This code sample works on Unix-like systems and on Windows." Ho...more...
  • Reported in: P1.0 (09-Aug-13)
#52350
PDF page: 16
Instead of the following which doesn't work on windows. println "groovy -v".execute().text The following works on windows 7. since it's a shell co...more...
  • Reported in: B3.0 (05-Jul-13)
#52124
PDF page: 20
A minor point: On p. 20, you compare a Java class containing main() with a Groovy script. I understand your point that in Groovy you can just call a ...more...
  • Reported in: P1.0 (08-Aug-13)
#52342
PDF page: 22
On this page, you say: "To take advantage of this feature, define the first parameter as a Map." However, it's not clear to me that any of the...more...
  • Reported in: P1.0 (08-Aug-13)
#52348
PDF page: 26
I recommend an attempt to anticipate how people experiment. For example, on this page, I can try examples like this: def (verbPhrase, directObjec...more...
  • Reported in: P1.0 (29-Apr-14)
#76742
Paper page: 35

In script UsingCoffeeSize.groovy, the for-each loop can be
for(size in CoffeeSize) rather than for(size in CoffeSize.values())--Naga Pemmaraju

  • Reported in: P1.0 (29-Apr-14)
#76744
Paper page: 37

MethodMissingException should be MissingMethodException--Naga Pemmaraju

  • Reported in: P1.0 (08-Aug-13)
#52341
PDF page: 47
I would consider that some of your readers would experiment and maybe anticipate confusions. For example, on the WhatEquals script, you only run two...more...
  • Reported in: P1.0 (16-Aug-13)
#52388
PDF page: 50

First paragraph after code block at the top of the page

class name referenced has a typo - Calibrartor instead of Calibrator.
--Shannon Pieper

  • Reported in: P1.0 (13-May-14)
#76791
Paper page: 52

def arr = [1, 2, 3, 4, 5] as int[]
println arr2

variable 'arr' should be 'arr2'.--Naga Pemmaraju

  • Reported in: P1.0 (23-Feb-14)
#76449
Paper page: 70
Chapter 3: Static Compilation "javac -p NoStaticCompile" Should be "javap -c NoStaticCompile" (ie. the 'p' and 'c' are swapped incorrectly...more...
  • Reported in: P1.0 (10-Aug-13)
#52359
PDF page: 74
This page has the following text: "It stretches its hands and reaches out to the variable product in the scope of the caller of pickEven()." ...more...
  • Reported in: P1.0 (17-Aug-13)
#52406
PDF page: 85

Minor nit - completeOrder() instead of computeOrder() in the first paragraph--Shannon Pieper

  • Reported in: P1.0 (09-Aug-13)
#52356
PDF page: 112
You mention an eachWithIndex method but don't show its usage. Granted, someone can look it up but it wouldn't necessarily hurt to throw one line of ...more...
  • Reported in: P1.0 (09-Aug-13)
#52357
PDF page: 113
You mention the difference between iterating with each() and collect() but it's mostly words and two disjointed examples. I think it might be better...more...
  • Reported in: P1.0 (23-Mar-14)
#76562
PDF page: 135
The MODRANGEOUTPUT of "WorkingWithCollections/CreatingArrayList.groovy" produces a different output other than described in the book. Expected (see...more...
  • Reported in: B3.0 (18-Aug-13)
#52416
Paper page: 141
Chapter 7 (Exploring the GDK) under section 7.3: Custom Methods Using the Extension Modules. In Extension/FindPrice.groovy, the static and instance me...more...
  • Reported in: P1.0 (25-Aug-13)
#52462
PDF page: 141
Possible swapping of instance vs. static methods - just the labeling with the println of which method is static and which is instance. First one is l...more...
  • Reported in: P1.0 (14-Mar-15)
#78250
Paper page: 152
At end of section 9.1, command to create the database without password should be: mysql -u root < createdb.sql ..or with password: mysql -u root ...more...
  • Reported in: P1.0 (07-Mar-14)
#76493
PDF page: 253
Last paragraph sentence: Let’s look at an example of creating XML documents in Groov using a builder: should have Groovy instead of Groov --Eugene ...more...
  • Reported in: P1.0 (09-Aug-13)
#52353
PDF page: 281
At this point in the book, when I run the test you have described, it does not pass as this page says it should. Rather I get this: testMyMethod(...more...
  • Reported in: P1.0 (09-Aug-13)
#52354
PDF page: 281
(I really wish these errata sections had an edit aspect so you can edit your own previous entries.) For the last one I posted on page 281 -- (ent...more...
  • Reported in: B3.0 (05-Jul-13)
#52125
PDF page: 400

No example of main() in Groovy anywhere in the book? Seems like an important omission. --Andrew Binstock

  • Reported in: P1.0 (20-Mar-14)
#76552
PDF page: 1741
Note that the page number (1741) entered is the Kindle edition's Location. In the section about '==' in groovy versus java (WhatEquals.groovy is th...more...