22 Feb 2019

feedDZone Java Zone

Spring Sweets: Group Loggers With Logical Name [Snippet]

Spring Boot 2.1 introduced log groups. A log group is a logical name for one or more loggers. We can define log groups in our application configuration. Then, we can set the log level for a group, so all loggers in the group will get the same log level. This can be very useful to change a log level for multiple loggers that belong together with one setting. Spring Boot already provides two log groups by default: web and sql. In the following list, we see which loggers are part of the default log groups:

  • web: org.springframework.core.codec, org.springframework.http, org.springframework.web, org.springframework.boot.actuate.endpoint.web, org.springframework.boot.web.servlet.ServletContextInitializerBeans
  • sql: org.springframework.jdbc.core, org.hibernate.SQL

To define our own log group, we must add in our application configuration the key logging.group. followed by our log group name. Next, we assign all loggers that we want to be part of the group. Once we have defined our group, we can set the log level using the group name prefixed with the configuration key logging.level..

22 Feb 2019 5:01pm GMT

Professional Java Programmer: Tips and Tricks: #001 [Video]

What Is This Episode About?

A trick every Java developer should use: enabling SQL logging during development. Find out the why, how, and what in this short and actionable episode!

22 Feb 2019 11:01am GMT

Jackson Property Custom Naming Strategy

To serialize or deserialize to/from POJO, Jackson uses a bean naming convention. To accomplish this, it uses annotations. This annotations cover:

This quick tutorial demonstrates how to use built-in property naming strategies and how to create a custom one.

22 Feb 2019 8:01am GMT

Introduction to Android App Development With Kotlin: Input Validation and Navigation (Part 5)

Most apps must implement some form of navigation. Whenever we want to do something in an app, it's quite normal that we must navigate to another screen. Also, when an app takes in user input, it should be validated so that we don't end up with blank records in a database. Those are the two things that we'll be discussing in today's episode of our journey towards effective Android app development.

Lesson 5

Input Validation

Before we accept user input, we must set the rules. For example:

22 Feb 2019 5:01am GMT

21 Feb 2019

feedDZone Java Zone

Try to Avoid -XX:+UseGCLogFileRotation

Developers take advantage of the JVM argument -XX:+UseGCLogFileRotation to rotate GC log files.

For example:

21 Feb 2019 9:01pm GMT

This Week in Spring: Spring Cloud, New Releases, and More

Hi, Spring fans! Welcome to another installment of This Week in Spring! In the US, Monday was a public holiday, so today, Tuesday, feels a bit like Monday and I was happily going through the Monday motions and then I got a reminder that I had to write this week's installment! Oops! Thank goodness for technology.

I'm at San Francisco International Airport about to board a fight for the Washington DC edition of the SpringOne Tour. Are you going to be in Washington DC? Reach out and say hi! My direct messages on Twitter are correct, too.

21 Feb 2019 5:02pm GMT

Java Desktop Links of the Week: February 18

It's been a really long time - apologies for the massive gap since the last post. I promise to get back to more regular postings again. So without further ado, here are the links for this time:

21 Feb 2019 11:01am GMT

10 Essential Tools Every Java Developers Should Know

Hello, folks! We are already in the second month of 2019, and I am sure all of you have already made your goals about what to learn in 2019 and how to achieve them. I have been writing a series of articles to give you some ideas about the things you can learn and improve upon to become a better, well-rounded developer in 2019, learning new programming languages, frameworks, and libraries. These three things are extremely important to help you become a better Java developer, but as a wise person once said, "you are only as good as your tools." You should also look to upgrade your tools, learn new tools, and improve your understanding of old tolls that are still working well.

To help you with what tools you can learn in 2019, I have come up with this list of 10 essential tools for Java developers that I am going to share with you guys in this article. In the past, I have shared some useful testing tools for Java programmers, and this article is an extension of that, as it covers much more than automation testing tools.

21 Feb 2019 5:01am GMT

20 Feb 2019

feedDZone Java Zone

Updated Choices for Java Updates

duke choice

Last month was of particular significance to both Java developers and users. The reason was the release of update 202 of Oracle JDK 8, which was the final public update (for commercial users) of JDK 8 from Oracle. Users now need to think carefully about their strategy for updating the Java runtime in the future.

For non-commercial desktop users, updates to Oracle Java SE 8 will continue to be provided through the existing Java Update mechanism. According to Oracle, this will be, "…through at least the end of 2020." It is assumed that, when the first of these updates come out in April, the license will be changed to preclude the use of these updates in a commercial deployment.

20 Feb 2019 5:01pm GMT

JavaParser: Java Code Generation

In this article, I'm going to show you how to generate Java code using theJavaParser. I couldn't find much of the documentation available with regards to code generation in javaparser.org or the manual. So, I thought putting this out would help someone who would like to experiment with the Java parser.

In its simplest form, the JavaParser library allows you to interact with Java source code as a Java object representation in a Java environment. More formally, we refer to this object representation as an Abstract Syntax Tree (AST). Also, it has the ability to manipulate the underlying structure of the source code. This can then be written to a file, providing developers with the facility to build their own code generating software.

20 Feb 2019 1:59pm GMT

It's a Kind of Magic: Kinds in Type Theory

I am not an expert of functional programming, nor the type theory. I am currently trying to enter the world of Haskell after I mess around in the Scala world for a while. When I first read about Kinds, I remember I was surprised, and a little bit scared. Is it possible that types have types? If so, what does this mean? In this little introductory post, I will try to explain what I understood during my journey through Kinds in Haskell.

The Beginning of All the Sadness

To make things simple, we start with the Java programming language. In Java, you can define a class (a type), which takes the input parameter another type. It is called a generic class. For example, think of the List<T> type. There is a type parameter T that one should provide to the compiler when dealing with a List to obtain concrete and usable types. Then, we have List<Integer>, List<String>, List<Optional<Double>>, and so on.

20 Feb 2019 11:01am GMT

Pagination and Sorting With Spring Data JPA

Overview

While dealing with a large amount of data, lazy processing is often essential. Even if a service returns a huge amount of data, the consumer is less likely to use it. Consider a shopping website where a customer searches for a product and the website has thousands of products to display. Fetching thousands of products and displaying them on a web page will be very time-consuming. In most cases, the customer may not even look at all of the products.

For such cases, a technique called Pagination is used. Only a small subset of products (page) is displayed at first and the customer can ask to see the next subset (page) and so on.

20 Feb 2019 8:01am GMT

Introduction to Android App Development With Kotlin: Layout Editor (Part 4)

With our knowledge of activities and fragments, it's time that we create a nice UI for our users. This lesson will cover the Layout Editor and Androids View widgets.

Lesson 4

Picking up where we left off last week, open the NewMovieFragment in the Project Structure View. Our aim is to update the current layout file in such a way that it will allow our users to input a movie title into an input box and then submit it. In the future lesson, we will learn to store this input (assuming it passes validation!) in a Room database and then display the list of all the movies in a list.

20 Feb 2019 5:01am GMT

19 Feb 2019

feedDZone Java Zone

Eclipse MAT — Incoming, Outgoing References

Eclipse Memory Analyzer (MAT) is a powerful tool for heap dump analysis. It has several great features to debug memory problems effectively. 'Incoming references' and 'outgoing references' are one such feature. In this article, let's discuss incoming references, outgoing references, and the difference between them.

In Eclipse MAT, when you right click on any object, you will see drop down menu. If you select 'List Objects' menu item, you will notice two options:

19 Feb 2019 9:01pm GMT

Breaking Static Dependency: How to Make Code Testable


Static dependency can be a nightmare for developers who write tests for their code. There is not much to do to get rid of static dependencies if they come with third-party libraries or NuGet packages. This blog post introduces two tricks to make code with static dependencies testable.

As a sample, I take one piece of non-commercial code that has a famous static dependency.

19 Feb 2019 5:01pm GMT

Moving Forward With Money-API, JSR 354: Motivation Behind the API

According to Wikipedia, money is any item or verifiable record that is generally accepted as payment for goods, services, and/or the repayment of debts in a particular country or socio-economic context. Money is represented by two parts: a numerical value and a currency. We deal with money in our programs every day, but the JDK doesn't provide a standard representation of wealth. What we need to know as developers is what data type is suitable for representing money.

The first attempt would be to use the primitive floating point types (double and float) that are available in the language. The author of Effective Java doesn't recommend using these types when precise values are required.

19 Feb 2019 3:40pm GMT

10 Nov 2011

feedPlanetJava

OSDir.com - Java: Red Hat's top secret Java Killer/Successor: The Ceylon Project

From the Ceylon dept.:

Gavin King of Red Hat/Hibernate/Seam fame recently unveiled the top secret project that he has been working on over the past two years, a new language and SDK designed to replace Java in the enterprise. The project came out of hiding without much fanfare or publicity at QCon Beijing in a keynote titled "The Ceylon Project - the next generation of Java language?".

10 Nov 2011 6:01am GMT

OSDir.com - Java: Oracle Introduces New Java Specification Requests to Evolve Java Community Process

From the Yet Another dept.:

To further its commitment to the Java Community Process (JCP), Oracle has submitted the first of two Java Specification Requests (JSRs) to update and revitalize the JCP.

10 Nov 2011 6:01am GMT

OSDir.com - Java: No copied Java code or weapons of mass destruction found in Android

From the Fact Checking dept.:

ZDNET: Sometimes the sheer wrongness of what is posted on the web leaves us speechless. Especially when it's picked up and repeated as gospel by otherwise reputable sites like Engadget. "Google copied Oracle's Java code, pasted in a new license, and shipped it," they reported this morning.



Sorry, but that just isn't true.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Java SE 7 Released

From the Grande dept.:

Oracle today announced the availability of Java Platform, Standard Edition 7 (Java SE 7), the first release of the Java platform under Oracle stewardship.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Java SE 7 Passes JCP

From the Jitters dept.:

The next edition of Java has been approved by a Java Community Process executive committee, but not without some acrimony.

10 Nov 2011 6:01am GMT

OSDir.com - Java: JDK 7 RC1 Released

From the JDK dept.:

After an initial round of testing we've declared build 147 to be the first Release Candidate of JDK 7.



There are only thirteen changes in this build. Over half of them are administrivial updates that don't affect the actual code; the remainder are true showstoppers, including several hard VM crashes and a JIT correctness bug identified by an Eclipse unit test.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Google Files Sizzling Answer to Oracle's Amended Java Complaint

From the Counter dept.:

Google has filed its answer to Oracle's amended complaint and its memorandum opposing Oracle's Motion to Dismiss. And we find out why Google didn't just roll over and pay Oracle for a license. Oracle asked in its motion to dismiss that the counterclaims alleging that Oracle's patents are invalid be dismissed. So Google explains more thoroughly why it believes they are in fact invalid. First, Google asserts:



Each of the Patents-in-Suit is invalid under 35 U.S.C. § 101 because one or more claims are directed to abstract ideas or other non-statutory subject matter.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache loses Java showdown vote to Oracle

From the Dis Harmony dept.:

The Apache Software Foundation - one of tech's most influential open-source groups - is closer to quitting Java's governing body after losing a stand-off vote against Oracle on Java.



The Reg has learned that with 75 per cent of qualifying Java Community Process (JCP) members having voted on whether to ratify Oracle's proposed roadmap for Java 7 and 8, Oracle's plan has been accepted.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache Software Foundation Resigns from Java Community Process

From the So Long dept.:

The Apache Software Foundation has resigned its seat on the Java SE/EE Executive Committee. Apache has served on the EC for the past 10 years, winning the JCP "Member of the Year" award 4 times, and recently was ratified for another term with support from 95% of the voting community. Further, the project communities of the ASF, home to Apache Tomcat, Ant, Xerces, Geronimo, Velocity and nearly a 100 mainstay java components have implemented countless JSRs and serve on and contribute to many of the JCPs technical expert groups.



We'd like to provide some explanation to the community as to why we're taking this significant step.



The recent Java SE 7 vote was the last chance for the JCP EC to demonstrate that the EC has any intent to defend the JCP as an open specification process, and demonstrate that the letter and spirit of the law matter. To sum up the issues at stake in the vote, we believe that while continuing to fail to uphold their responsibilities under the JSPA, Oracle provided the EC with a Java SE 7 specification request and license that are self-contradictory, severely restrict distribution of independent implementations of the spec, and most importantly, prohibit the distribution of independent open source implementations of the spec. Oracle has refused to answer any reasonable and responsible questions from the EC regarding these problems.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache Discontinues Independent Java Implementation 'Harmony'

From the DisHarmony dept.:

After the resignation of Apache from the Java SE/EE Executive Committee, the time has now come for Harmony to be added to the Apache Attic. Harmony was 'the project to produce an open source cleanroom implementation of Java.' An open vote was taken within the Project Management Committee, which resulted in a 20-2 majority to discontinue development.

10 Nov 2011 6:01am GMT

Javable: YourKit Java Profiler 7.0 released

The major update to YourKit Java Profiler has been released. Version 7.0 includes

10 Nov 2011 6:01am GMT

Javable: Sun phases out mobile Java

Sun will gradually phase out mobile Java (Java Micro Edition) and move respective services to Standard Edition. "We're trying to converge

10 Nov 2011 6:01am GMT

Javable: Google Android SDK is available

The development kit and API for Google mobile platform, Android, has been released.

10 Nov 2011 6:01am GMT

Javable: Consumer JRE Early Access

Sun has started an early access program to Java SE 6 Update N (formerly known as the "Consumer

10 Nov 2011 6:01am GMT

Javable: NetBeans 6.0 released

New version of pure Java IDE has been released, with support for many new

10 Nov 2011 6:01am GMT

Javable: Happy New Year!

We wish a Happy New Year to all our readers and contributers. Hope to see you all in 2008.

10 Nov 2011 6:01am GMT