Java Type Annotations #1: What's Being Annotated?

Java Type Annotations #1: What's Being Annotated? In the Java programming language, a type annotation is an annotation that can be applied to the use of a type. For example, when you declare that a class MyList implements the interface List, you are using the List type. In such c … | Continue reading


@objectos.com.br | 16 hours ago

The Java Qualified Superclass Constructor Invocation

The Java Qualified Superclass Constructor Invocation In Java, a nested class is a class declared within the body of another class. Nested classes can be either static or non-static. The non-static kind is commonly referred to as inner classes and maintain a special relationship w … | Continue reading


@objectos.com.br | 7 days ago

Annotations are just modifiers in Java (syntactically speaking)

Annotations are just modifiers in Java (syntactically speaking) Annotations add pieces of information to elements of a Java program. We can annotate a class declaration, a method declaration, a field declaration, and other declarations. We can also annotate uses of a type, such a … | Continue reading


@objectos.com.br | 13 days ago

Objectos PetClinic v002: No-Reload form submission with Objectos Way v0.1.9

Objectos PetClinic v002: No-Reload form submission with Objectos Way v0.1.9 Objectos Way is our library for writing web applications entirely in Java. It renders HTML on the server and sends it over the wire to the client. Web applications built with Objectos Way are far from sta … | Continue reading


@objectos.com.br | 1 month ago

Introducing Objectos PetClinic v001! (Part 2)

Introducing Objectos PetClinic v001! (Part 2) In the first post of this series, we introduced Objectos PetClinic v001, a web application that showcases: Objectos Way, our library for writing web applications in pure Java; and Objectos MK, a collection of Makefiles that allows you … | Continue reading


@objectos.com.br | 1 month ago

Introducing Objectos PetClinic v001! (Part 1)

Introducing Objectos PetClinic v001! (Part 1) I'm happy to announce the release of Objectos PetClinic v001! Objectos Petclinic is a web application written entirely in Java showcasing: Objectos Way, a library for writing web applications in Java; and Objectos MK, a collection of … | Continue reading


@objectos.com.br | 1 month ago

Generating Java source code with String Templates

Generating Java source code with String TemplatesWe can use String Templates in JDK 21 as a preview feature. One good use case I've found is to generate Java source code.So, in this blog post, we will write a String Template processor suited for generating Java source code. Addit … | Continue reading


@objectos.com.br | 10 months ago

The Java System::identityHashCode method

The Java System::identityHashCode methodThere's an ongoing project on OpenJDK called Lilliput. It is about reducing the size of an object header in the Hotspot JVM.Roman Kennke recently posted about the effort to have compact identity hash codes.It got me curious: how does the JV … | Continue reading


@objectos.com.br | 10 months ago

Reloading a Java class definition at runtime

Reloading a Java class definition at runtimeWhen developing the UI for a web application in Java, the following workflow might be common:make a change at some source file;recompile the project;restart the server; andtest the change.Restarting the server each time a change is made … | Continue reading


@objectos.com.br | 10 months ago

Stray semicolons in Java

Stray semicolons in JavaConsider the following Java class:public class ClassMembers { ; int field;;; void method() {} ;; ; ;; ;;; class Inner {} ; } It contains a number of stray semicolons.Is it legal Java code? In other words, does it compile?Let's learn.Class mem … | Continue reading


@objectos.com.br | 11 months ago

A custom java.io.InputStream implementation for testing

A custom java.io.InputStream implementation for testingSuppose you are writing a HTTP/1.1 request parser in Java. For the purposes of this blog post, the API is the following:try (Socket socket = serverSocket.accept()) { MyHttpParser parser; parser = new MyHttpParser(); InputS … | Continue reading


@objectos.com.br | 11 months ago

The java.lang.InterruptedException: an introduction to the Java developer

The java.lang.InterruptedException: an introduction to the Java developerSuppose you are writing to a file in a Java application and, unfortunately, the disk is full.Regardless of your view on Java's exceptions, checked exceptions in particular, it is easy to understand why the f … | Continue reading


@objectos.com.br | 11 months ago

Pattern matching and flow scoping in Java

Pattern matching and flow scoping in JavaJEP 394 brought pattern matching to the Java language as a final, non-preview, feature.To be more precise, it brought a specific type of pattern matching, the type pattern, to a specific expression, the instanceof.Along with pattern matchi … | Continue reading


@objectos.com.br | 11 months ago

Learning Makefiles as a Java developer. Part 6: resolving transitive dependencies

Learning Makefiles as a Java developer. Part 6: resolving transitive dependenciesIn the previous post of this series we introduced the concept of "resolution files". It is part of our designed solution for handling transitive dependencies in our Makefile.Our solution implementati … | Continue reading


@objectos.com.br | 12 months ago

Learning Makefiles as a Java developer. Part 5: resolution files

Learning Makefiles as a Java developer. Part 5: resolution filesedit 2024-01-14: add a link to part 6 of the seriesOur project currently declares a single dependency: the SLF4J API library.This particular dependency declares no dependencies of its own. When our project depends on … | Continue reading


@objectos.com.br | 1 year ago

Learning Makefiles as a Java developer. Part 4: handling external dependencies

Learning Makefiles as a Java developer. Part 4: handling external dependenciesedit 2024-01-14: add a link to part 5 of the seriesIn the previous post we grew our project from a single class to multiple classes in a single package. In the process we have learned about empty target … | Continue reading


@objectos.com.br | 1 year ago

Learning Makefiles as a Java developer. Part 3: empty targets and more automatic variables

Learning Makefiles as a Java developer. Part 3: empty targets and more automatic variablesedit 2023-12-31: add a link to part 4 of the seriesIn the previous post of this series we discussed the concepts of phony targets, the default goal and Make variables. While we managed to do … | Continue reading


@objectos.com.br | 1 year ago

Learning Makefiles as a Java developer. Part 2: phony targets, default goal and variables

Learning Makefiles as a Java developer. Part 2: phony targets, default goal and variablesedit 2023-12-24: add a link to part 3 of the seriesIn the first post we've learned a few of the basic concepts of Make. To do so, we've created a Java project containing a single Java file. I … | Continue reading


@objectos.com.br | 1 year ago

Learning Makefiles as a Java developer. Part 1: targets, prerequisites and recipes

Learning Makefiles as a Java developer. Part 1: targets, prerequisites and recipesedit 2023-12-17: add a link to the examples source codeI once asked myself: is it possible to make a build system that bootstraps itself via JEP 330?In other words, is it possible to build a project … | Continue reading


@objectos.com.br | 1 year ago

Casamento de padrões e escopo de fluxo do Java

Casamento de padrões e escopo de fluxo do JavaA JEP 394, entregue na versão 16 do Java, trouxe de maneira definitiva o casamento de padrões (ou pattern matching em inglês) para a linguagem Java.Para ser mais exato, essa JEP trouxe um tipo específico de casamento de padrões, o pad … | Continue reading


@objectos.com.br | 1 year ago

Uma breve introdução às classes internas do Java

Uma breve introdução às classes internas do JavaSe você desenvolve aplicações na linguagem Java então deve escrever códigos como o abaixo:for (var elem : collection) { consume(elem); } Ou talvez:collection.stream() .filter(this::someFilter) .forEach(this::consume); Saiba que … | Continue reading


@objectos.com.br | 1 year ago

3 coisas que você não sabia sobre os métodos Java

3 coisas que você não sabia sobre os métodos JavaPara desenvolver aplicações em Java você cria e usa métodos o tempo inteiro.Dependendo do framework que você usa, os endpoints de uma API são codados em um método, por exemplo.Ainda que você use métodos diariamente há algumas coisa … | Continue reading


@objectos.com.br | 1 year ago

Testando duas implementações diferentes usando o mesmo teste no TestNG

Testando duas implementações diferentes usando o mesmo teste no TestNGEstou criando uma implementação parcial da linguagem AsciiDoc.A linguagem AsciiDoc possui uma documentação. Esta faz o papel de especificação até o momento. A documentação dá a entender que a especificação de f … | Continue reading


@objectos.com.br | 1 year ago

3 coisas que você não sabia sobre as anotações em Java

3 coisas que você não sabia sobre as anotações em JavaQuem desenvolve aplicações usando a linguagem Java quase certamente conhece as anotações.Por exemplo, considere a classe de um serviço hipotético abaixo:@NotThreadSafe public class MeuServico { ... } À classe foi adicionada a … | Continue reading


@objectos.com.br | 1 year ago

The Java Empty Statement

The Java Empty StatementWelcome to Objectos Weekly issue #023.The Java language has a statement that does nothing. It is aptly named "The Empty Statement". The following Java code compiles without errors:final void example() { while (shouldLoop()); ; if (test()); else; {;;; … | Continue reading


@objectos.com.br | 1 year ago

4 things you didn't know about the labeled statement in Java

4 things you didn't know about the labeled statement in JavaWelcome to Objectos Weekly issue #022.Earlier this week, I saw a tweet from the Red Hat Java team. It shows a variation of "Puzzle 22: Dupe of URL" from the Java Puzzlers book by Joshua Bloch and Neal Gafter. The book wa … | Continue reading


@objectos.com.br | 1 year ago

Introducing Objectos AsciiDoc. Objectos 0.6.0 released

Introducing Objectos AsciiDoc. Objectos 0.6.0 releasedWelcome to Objectos Weekly issue #021.I have released Objectos 0.6.0! It introduces Objectos AsciiDoc, an AsciiDoc processor written in pure Java.In this issue I will give a very short introduction to Objectos AsciiDoc. Just k … | Continue reading


@objectos.com.br | 1 year ago

Using the Objectos HTML Pseudo DOM API. Objectos 0.5.3 released

Using the Objectos HTML Pseudo DOM API. Objectos 0.5.3 releasedWelcome to Objectos Weekly issue #020.I have released Objectos 0.5.3! It introduces the Pseudo DOM (pseudom) API for Objectos HTML. The pseudom API replaces the Visitor API shown in the previous issue of the newslette … | Continue reading


@objectos.com.br | 1 year ago

Reducing CSS size by removing unused style class names. Objectos 0.5.2 released

Reducing CSS size by removing unused style class names. Objectos 0.5.2 releasedWelcome to Objectos Weekly issue #019.I have released Objectos 0.5.2! Like last week's release, this release contains almost no user facing changes; most of the changes were internal. Here are the list … | Continue reading


@objectos.com.br | 1 year ago

Creating a static site using pure Java. Objectos 0.5.1 released

Creating a static site using pure Java. Objectos 0.5.1 releasedWelcome to Objectos Weekly issue #018.I have released Objectos 0.5.1! Most of the work done on this release was internal. In other words, it contains just a few of user-facing changes. I expect the next few releases t … | Continue reading


@objectos.com.br | 1 year ago

Objectos 0.5.0 released. Introduces Objectos HTML

Objectos 0.5.0 released. Introduces Objectos HTMLWelcome to Objectos Weekly issue #017.I have released Objectos 0.5.0! It introduces Objectos HTML, an open-source Java library for generating HTML using pure Java. Though it is publicly released it is not ready for public consumpti … | Continue reading


@objectos.com.br | 1 year ago

A low-allocation template engine (Part 2). Objectos 0.4.4 released

A low-allocation template engine (Part 2). Objectos 0.4.4 released Welcome to Objectos Weekly issue #016.I have released Objectos 0.4.4. This is the last of the 0.4.x series, where I worked solely on the Objectos Code API. I will introduce Objectos HTML in the 0.5.x series next w … | Continue reading


@objectos.com.br | 1 year ago

A low-allocation template engine (Part 1). Objectos 0.4.3.1 released

A low-allocation template engine (Part 1). Objectos 0.4.3.1 released Welcome to Objectos Weekly issue #015.In this issue I want to talk a bit about how the Objectos template engines work under the hood. In particular, how it tries to achieve one of its goals: minimize allocation … | Continue reading


@objectos.com.br | 1 year ago

Why write templates in pure Java? Objectos 0.4.2 released

Why write templates in pure Java? Objectos 0.4.2 released Welcome to Objectos Weekly issue #014.I have released Objectos 0.4.2. It is an "epsilon" release focused on Objectos Code. It adds small increments in an attempt to make its API more "programmer-friendly" if you will.I wil … | Continue reading


@objectos.com.br | 1 year ago

Designing APIs is hard: Objectos 0.4.1 released.

Designing APIs is hard: Objectos 0.4.1 released.Welcome to Objectos Weekly #013.I have released Objectos 0.4.1. I plan to release small iterations of Objectos every week. It may be an overly optimistic goal so I won't mind too much if I miss a release on one week. So, at a minimu … | Continue reading


@objectos.com.br | 1 year ago

Objectos Weekly #012: Introducing Objectos Code

Objectos Weekly #012: Introducing Objectos CodeWelcome to Objectos Weekly issue #012.I am happy to announce the release of Objectos 0.4.0. This is the fourth public release of the Objectos suite of Java libraries in its new form.Objectos 0.4.0 introduces Objectos Code.Objectos Co … | Continue reading


@objectos.com.br | 1 year ago

Objectos Weekly #011: Instance initializers in Java

Objectos Weekly #011: Instance initializers in JavaWelcome to Objectos Weekly issue #011.In this issue, we will continue our discussion about blocks in Java.Apart from fields, methods, constructors and nested types, classes can also declare instance and static initializers. Synta … | Continue reading


@objectos.com.br | 1 year ago

Objectos Weekly #010: Blocks are statements in Java

Objectos Weekly #010: Blocks are statements in JavaWelcome to Objectos Weekly issue #010.You may have noticed I have been reading the Java Language Specification. I am learning a bunch of details about the language that are new to me. And I have been sharing these findings with y … | Continue reading


@objectos.com.br | 1 year ago

Objectos Weekly #009: Java varargs and non-accessible types

Objectos Weekly #009: Java varargs and non-accessible typesWelcome to Objectos Weekly issue #009.While working on Objectos Code this past week I faced a compilation error I had never seen before. With the benefit of hindsight, it is perhaps an obvious point. But I did not anticip … | Continue reading


@objectos.com.br | 1 year ago

Objectos Weekly #008: The Java receiver parameter

Objectos Weekly #008: The Java receiver parameterWelcome to Objectos Weekly issue #008.I hope you had a great Holiday season.In the first issue of 2023 we will discuss Java's receiver parameter. A feature of the language I did not know about until very recently.Let's begin.The Ja … | Continue reading


@objectos.com.br | 2 years ago

Objectos Weekly #007: Using var with non-accessible types

Objectos Weekly #007: Using var with non-accessible types Welcome to Objectos Weekly issue #007.I had hopes of sending out this issue on Sunday, December 25th. It turns out it is hard to get anything done after you had a very large meal and stayed up late with your family the nig … | Continue reading


@objectos.com.br | 2 years ago

Objectos Weekly #006: Using method references to invoke generic constructors

Objectos Weekly #006: Using method references to invoke generic constructorsWelcome to Objectos Weekly issue #006.In Java, constructors can declare type parameters. Also in Java, you can represent a deferred class instance creation with a method reference expression. How do you s … | Continue reading


@objectos.com.br | 2 years ago

Objectos Weekly #005: Java's contextual keywords, class names and method names

Objectos Weekly #005: Java's contextual keywords, class names and method namesWelcome to Objectos Weekly issue #005.This is the first issue sent via the email newsletter. If you have received this issue in your email and had any troubles opening it, I apologize in advance. I woul … | Continue reading


@objectos.com.br | 2 years ago

Objectos Weekly #004: Type annotations, canonical names and inner classes

Objectos Weekly #004: Type annotations, canonical names and inner classesedit 2022-12-10: add the 'static nested class' subsectionWelcome to Objectos Weekly issue #004.I was writing this issue when the power in my apartment went out and I heard a loud noise outside. I looked outs … | Continue reading


@objectos.com.br | 2 years ago