It started when I decided to upgrade my cucumber-jvm example to the latest version (1.1.3). Quickly after upgrading, I hit that error:
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.get(ArrayList.java:324)
at gherkin.formatter.JSONFormatter.getFeatureElement(JSONFormatter.java:199)
at gherkin.formatter.JSONFormatter.addHook(JSONFormatter.java:156)
at gherkin.formatter.JSONFormatter.before(JSONFormatter.java:147)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
This is known issue, that has already been fixed in gherkin.
So I rebuilt gherkin locally, thinking it would solve all my problems, and I was still the exact same error, at the same line number. After changing version, deleting the jar from the Maven repository, I was still getting the same error, so it was clear that the class was being pulled from somewhere else.
It turns out the jar was being pulled from cucumber-picocontainer
, which uses shade to create an über-jar with its dependencies, including gherkin. How did I figure that out? Using this piece of code:
URL location = JSONFormatter.class.getProtectionDomain().getCodeSource().getLocation();
System.err.println(location.getPath());
The solution to the problem is therefore to rebuild gherkin, then cucumber-picocontainer, and you’re sorted.
Alternatively you can also just rebuild gherkin, and then make sure it is defined before cucumber-picocontainer
:
]]><dependency> <groupId>info.cukes</groupId> <artifactId>gherkin</artifactId> <version>2.11.8</version> <scope>test</scope> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-picocontainer</artifactId> <version>1.1.3</version> <scope>test</scope> </dependency>
Happy Canada Day!
]]>Et pour la rigolade, la version japonaise
]]>La fournée 2006 a apporté son lot de chansons traditionnelles, de textes en gaélique, de flûtiau, de danse du ventre, avec un panel d’accents parfois très irritants ; si vous voulez juger sur pièce, vous avez le choix dans le cheptel que voici.
]]>Au rayon voix à consommer sans modération aucune, la Petite Voix espiègle de C’est pas sorcier se pose bien là, aussi!
]]>Last Saturday, I went to England for the third time in my life. That was a bit strange to hear the English accent all over the place, as we only hear it… on TV here. I had the feeling I had stepped into a Channel 4 soap opera. Spooky.
The other thing is that, unlike in Ireland, smoking in pubs is allowed. This is pretty amazing how fast you get used to the non-smoking ban. So much so that whenever anyone was lighting in the pub we went to for a scampi and chips on Saturday evening (as you do), Ellen and I were looking at each other, a bit surprised.
Anyway, all that to say I had the time to read the Irish Times thoroughly for you on the plane and I thought I might share a few thoughts with you.
Amongst other things, there was the transcript of the speech that Mrs. Mary McAleese, President of the Irish Republic, made at a conference about the 90^th^ anniversary of the Easter Rising. Something to do with good nationalism vs. bad nationalism. A very long text, anyway.
This is an interesting text politically speaking, but I was somewhat surprised to find the following paragraph:
A Google search for the phrase “narrow nationalism” produces about 28,000 results. It is almost as though some people cannot use the word “nationalism” without qualifying it by the word “narrow”. But that does not make it correct.
Sure doesn’t. When you do that search, you indeed get just below 28,000 results. And guess what? You get more than 14,000,000 hits for “nationalism”—around 0.2% of the results actually bring back “narrow nationalism”… But my point is something different altogether. In my opinion, this is a bit like trying to find the spelling of a word by typing a word in different ways and seeing which one gets the most hits. This is dangerous.
This is not the first time that I hear or read a politician, or even a journalist, quoting the number of hits on Google for such or such word, as if this was an absolute reference: “oh well, if Google returns so many results, it must be [good/correct/bad]”. The thing is, you can put any adjective between the square brackets, because you can make Google’s results say whatever you want in any context. This is why I think this is pure lack of imagination that forces journalists or politicians to open Google, type in the words about which they are supposed to write and see what they get. Same goes for Wikipedia as it also seems to be a favourite.
I just think of the papers the pupils will write in a few years. They will all be inspired by the first couple of links picked from Google and the relevant articles in Wikipedia. Marking them is going to be a very dull task for the teachers… And the Encyclopædia Britannica, written by competent authors, will be covered with a thick layer of dust. Google and Wikipedia are in the process of becoming the knowledge repositories in which people are looking for information. This is rather disturbing as they are certainly not the most accurate, nor the most authoritative in most subjects.
Also in the same issue of the IT, an article about a firefighter sueing Dublin City Council over loud sirens which seemingly caused him hearing loss. He was not wearing any ear plugs for about 20 years and now suffers irreversible hearing damage. This is a very sad story, but the journalist probably wanted to make a good pun when he/she decided to finish the article with the following sentence:
The hearing resumes on Wednesday.
To finish with, I’d like to point out this recipe published in today’s Guardian which, surely, will make you all happy and give you all the confidence in English food you were lacking. Yum, yum, tasty!
]]>