❯ Guillaume Laforge

Java

I'm a Java Champion!

The Java Champions recently nominated me to become a Java Champion! Please welcome the new Java Champions. @antoine_sd @javajudd @glaforge @kenkousen @kito99 @vlad_mihalcea@leomrlima @net0pyr @shelajev @rgransberger @rmehmandarov @Sander_Mak @SeanMiPhillips Well done to all of you @OracleDevs @java #odevcommunity pic.twitter.com/X9yeek641s — Java Champions (@Java_Champions) November 22, 2017 There’s also a post on the Java Champions’ blog, and InfoQ also echoed the new nominees recently. I’m super happy and proud of this nomination, and I’m looking forward to continuing being involved in the Java ecosystem, present at Java-friendly conferences, contribute to Open Source projects using Java and Apache Groovy, and write articles here and there using my favorite languages. Read more...

The JDK built-in web server with Apache Groovy

In my timeline, I saw a tweet from Joe Walnes about the built-in HTTP server available in the JDK since Java 6. It’s super convenient, starts super fast, easy to use, but I often forget about it. I’d probably not use it for serving planet-wide load, but it’s very useful when you need to create a quick service, a little mock for testing some web or micro-service. Here’s a little hello world for the fun. Read more...

JavaOne — How languages influence each other: Reflections on 14 years of Apache Groovy

Last week, I was in San Francisco for my tenth JavaOne! I had two sessions: one on the past / present / future of Java Platform-as-a-Service offerings, and one on programming language influences, and particularly how was Apache Groovy influenced, and how it also inspired other languages. Here’s the abstract: Languages have been influencing one another since the dawn of computer programming. There are families of languages: from Algol descendants with begin/end code blocks to those with curly braces such as C. Read more...

Apache Groovy and Google App Engine at JavaOne

I’ll be back at JavaOne in San Francisco in October to speak about Apache Groovy and Google App Engine. Apache Groovy I’ve been involved with the Apache Groovy project for 14 years now, it’s a long time, and it’s interesting to see how the language has evolved over time, how it was influenced by other languages, but also how it influenced those other languages itself! Let’s see which operators or syntax constructs evolved and moved from one to the other. Read more...

Trying out Apache Groovy's new Antlr4 parser with Java 8 support

Apache Groovy is coming up with a new parser, that supports the Java 8 syntax elements, as well as some new notation and operators of its own (like !in, !instanceof or ?[] for safe navigation with collections, or with ?= for Elvis assignment). I blogged recently about the fact that you can try this new flavor online on this forked Groovy Web Console version, without the need of installing everything. But today I’ll tell you how to build it for yourself in order to run it on your machine. Read more...

Flying East to Singapore

In two weeks, I’ll be flying east, much further east than I’ve ever been! I’ll visit Singapore! And I’ll have a pretty busy week with several events: conference, meetup, user groups, brown bag lunch… and I’ll talk about Groovy, Machine Learning, and chatbots! First of all, on Wednesday 31st, I’ll participate to the Singapore Java User Group, where I’ll give an update on Apache Groovy (the latest improvements, new features, the roadmap). Read more...

Testing Java 8 Snippets on the new App Engine Java 8 runtime

A new Java 8 runtime for Google App Engine standard is coming soon, and is currently in alpha testing. You can request to join the alpha program, if you want to try it out for yourself. But I wanted to let anyone play with it, easily, to see how well the Java 8 APIs work, but also to try some Java 8 syntax too. So here’s a web console where you can do just that! Read more...

Back from JavaOne

After some trouble getting to San Francisco because of strikes, transportation issues, burnt control tower, and more… I managed to land to JavaOne! I missed my own first talk and I was glad and grateful that CĂ©dric could present it for me. At JavaOne, the Groovy project received the award from ZeroTurnaround / RebelLabs, for the “Best Tech - Geek Choice Award” : Youpi mon projet a reçu un prix de l’innovation ! Read more...

How to remove accents from a String

My little puzzle of the day is to find how to remove accents from a String. There are different alternatives, different strategies, but none really suits my needs – or my taste. The naive approach is to use String.replace() to replace manually all characters, with a correspondance table, like “Ă©” should be replaced with “e”, etc. That’s fine for some languages I know, like French or German, or even some latin languages, since we share the same alphabet. Read more...

Castor tip: generating Java classes for XSD simple types

At work, I’m using Castor XML to Java binding to marshall/unmarshall messages in my Web Services, inside a custom framework (Struts, OJB, JAXM, etc). I have defined my messages as XSD Schemas, and I’m using Castor’s Maven plugin to auto-generate my Java classes at build time. All is good and well… Hmm, almost! Castor’s SourceGenerator generates Java classes for complex types and elements, but not for simple types, and unfortunately, I badly needed to marshall those simple types as well. Read more...