Home » Java » Core Java (page 9)

Core Java

History and Motivations Behind Java’s Maligned Serialization

Issues related to Java’s serialization mechanism are well-advertised. The entire last chapter of Effective Java 1st Edition (Chapter 10) and of Effective Java 2nd Edition (Chapter 11) are dedicated to the subject of serialization in Java. The final chapter of Effective Java 3rd Edition (Chapter 12) is still devoted to serialization, but includes a new item (Item 85) that goes ...

Read More »

Hide It All!

In an earlier post, I wrote the following words: in an object-oriented codebase the kit should be as discrete as possible. The more you use the development kit, the less object-oriented your code really is or your abstractions are not the best they can be.. I feel the need to elaborate this point, since it is quite strong and that ...

Read More »

Extending abstract classes with abstract classes in Java

The example issue When I was creating the Java::Geci abstract class AbstractFieldsGenerator and AbstractFilteredFieldsGenerator I faced a not too complex design issue. I would like to emphasize that this issue and the design may seem obvious for some of you, but during my recent conversation with a junior developer (my son, Mihály specifically, who also reviews my articles because his ...

Read More »

JDK 13: VM.events Added to jcmd

CSR (Compatibility and Specification Review) JDK-8224601 [“Provide VM.events diagnostic command”] is implemented in JDK 13 as of JDK 13 Early-Access Build #24 (dated 2019/6/6) and was added via Enhancement JDK-8224600 [“Provide VM.events command”]. The CSR‘s “Summary” describes this enhancement: “Add a VM.events command to jcmd to display event logs.” The CSR’s “Solution” states, “Add a command to jcmd to print ...

Read More »

Callback hell and Reactive patterns

One of the ways that I have better understood the usefulness of aReactive Streams based approach is how it simplifies a Non-blocking IO call. This post will be a quick walkthrough of the kind of code involved in making a synchronous remote call, then show how layering in Non-blocking IO though highly efficient in the use of resources(especially threads) introduces ...

Read More »

Reflection is the most important Java API

The other day I was wondering – which is the most important Java API. Which of the SE and EE APIs is the one that makes most of the Java ecosystem possible and that could not have just been recreated as a 3rd party library. And as you’ve probably guessed by the title – I think it’s the Reflection API. ...

Read More »

Using Java 12 in Eclipse

1. Install JDK 12 Link: https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html 2. Install Eclipse 4.11 Link: https://download.eclipse.org/eclipse/downloads/drops4/R-4.11-201903070500 3. Install Eclipse Java 12 Support Start Eclipse and go to Help > Install New Software. Add Update Site: https://download.eclipse.org/eclipse/updates/4.11-P-builds. Install Eclipse Java 12 support for 2019-03 development stream from the list of available software 4. Add Java 12 JRE to Eclipse Go to Window > Preferences, navigate ...

Read More »

Reflection selector expression

Java::Geci is a code generator that runs during unit test time. If the generated code fits the actual version of the source code then the test does not fail. If there is a need for any modification then the tests modify the source code and fail. For example, there is a new field that needs a setter and getter then ...

Read More »

Java 12: Switch Expressions

In Java 12, the switch statement has been enhanced so that it can be used as an expression. It is now also possible to switch on multiple constants in a single case, resulting in code that is more concise and readable. These enhancements are a preview language feature, which means that they must be explicitly enabled in the Java compiler ...

Read More »