Posts

How and Why to Analyze, Generate and Transform Java Code Using Spoon

How and Why to Analyze, Generate and Transform Java Code Using Spoon

Spoon is a tool to analyze, generate, and transform Java code. In this article we will see what can be achieved by using techniques for processing code programmatically. I think these techniques are not very well-known or utilized and this is a pity because they can be incredibly useful. Who knows, some ideas could be […]

Functional Programming for Java: Getting Started with Vavr

Functional Programming for Java: Getting Started with Vavr

Java is an old language and there are many new kids on the block who are challenging it on its own terrain (the JVM). However when Java 8 arrived it brought a couple of interesting features. Those interesting features enabled the possibility of writing new amazing frameworks like the Spark web framework or Vavr, previously […]

ANTLR Mega Tutorial

The ANTLR Mega Tutorial

Parsers are powerful tools, and using ANTLR you could write all sort of parsers, usable from many different languages. In this complete tutorial we are going to: explain the basics: what a parser is, what it can be used for see how to setup ANTLR to be used from Javascript, Python, Java and C# discuss […]

Resolve method calls in Java code using the JavaSymbolSolver

Why I created the java-symbol-solver? A few years ago I started using JavaParser and then I started contributing. After a while I realized that many operations we want to do on Java code cannot be done just by using the Abstract Syntax Tree produced by a parser, we need also to resolve types, symbols and […]

How to build a symbol solver for Java, in Clojure

How to Build a Symbol Solver for Java, in Clojure

Last week we have seen how to build models of Java code from source and JAR files. Now we want to be able to solve symbols: in practice we want to link the symbol references in our source code to symbol declarations either in Java source files or jar files. This process is called symbol […]

Effective Java: a tool to explore and measure your Java code written in Clojure

Effective Java: a Tool to Explore and Measure Your Java Code

When I was working at TripAdvisor we had this internal book club. We started by reading Effective Java, this very famous book from Joshua Bloch. It is interesting and all but I think this book was so successful that most of his advices are now part of the Java culture: most of Java developers know them and sort […]

Mocking in Java: Why, Why Not and Also Those Awful Private Static Methods

  Unit tests: there are people out there surviving without, but in many cases you want to have this life insurance. Something to protect you from slipping an error, something to accompany your software also when you will have long forgotten it and someone else will have to figure out how to maintain that legacy […]