OnlyJava is your source for Blog Aggregation in the Java industry

Understand Java Callable and Future

 Mark As Read    

In Java multithreading programs, we extensively use Java Callable and Future. I believe all of you have the basic understanding of threads. In brief, The thread is a separate path of execution, so if you have to do a repetitive task, you can break the work into multiple chunks (tasks) and assign them to threads. Multiple Threads will execute tasks ...

Custom Annotation in Java for SQL Injection Safe Parameters

 Mark As Read    

Hi Java Developers, In the today’s world of ORM, we are mostly using JPA based implementations for our persistence.We also use JPA over Hibernate, Spring Data, or Spring JDBC templates quite often.

Convert Map to List in Java 8

 Mark As Read    

A Java 8 example to convert a Map to a ListConvertMapToList.javapackage com.mkyong.example; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; public class ConvertMapToList { public static void main(String[] args) { Map<Integer, String> map = new HashMap<>(); ...

Groovy Gotcha With the Every() Collection Method

 Mark As Read    

In the Groovy programming language, every object that implements the Iterable interface (such as List and Map objects) comes with the every() method. The every() method takes a closure as an argument and is supposed to evaluate whether every item in the collection meets the condition set forth in the closure:assert [ 3, 4 ].every{ element -> el...

The Most Popular Programming Languages of 2016

 Mark As Read    

Our annual look at the relative popularity of programming languages reveals that while Java still rules, other options are catching up for significant groups of developers. Just as important, more and more developers are taking a polyglot approach, leveraging multiple languages according to which one best solves a particular problem.Choosing a Lang...

Updating desktop caches and a tale of woe

 Mark As Read    

I recently updated some of the MATE components for Tribblix. On testing, various bits of MATE didn't work. Worse, various bits of Xfce didn't work.The first issue that was fairly easy to solve was that MATE was looking for its menus under /etc/xdg/menus, whereas it had installed them under /usr/etc/xdg/menus. I had to set XDG_CONFIG_DIRS=/usr/etc/x...

Using ANTLR From the Parse Tree to the Abstract Syntax Tree

 Mark As Read    

In this post we are going to see how to process and transform the information obtained from the parser. The ANTLR parser recognizes the elements present in the source code and build a parse tree. From the parse tree we will obtain the Abstract Syntax Tree which we will use to perform validation and produce compiled code.Note that the terminology ca...

3R Principles of Programming

 Mark As Read    

IntroductionProgramming is an Art. When we program, often we think that programs are a set of instructions fed to a computer for solving business use cases. Though it is true, programs also serve more than that in the real world.Let us start with a code snippet that runs without any problems.

Elastic Search Index and Performance tuning tips

 Mark As Read    

Index- What is that? Answer will not be as simple as sound. In layman language- An index is a data structure for storing the mapping of fields to the corresponding documents. The objective is to allow faster searches, often at the expense of increased memory usage and preprocessing time. Till now developers have worked on […]

TechArtifact 1 day ago

The Java Synchronizers

 Mark As Read    

Threads communication happens primarily by sharing access to fields and objects. Although extremely efficient, this form of communication is prone to errors such as thread interference and memory consistency. Synchronization is a tool that helps to prevent such errors.However, synchronization does not come for free and can introduce latency when ac...

5 Most Popular Hotels in Kuala Lumpur’s Golden Triangle

 Mark As Read    

Every country must have the golden triangle area as the central of its commercial, business, shopping, and entertainment. It’s usually located on the major streets that well facilitated and always been a perfect place to stay. The golden triangle of Malaysia obviously situated on the northeast side of Central Kuala Lumpur. Specifically, it is spraw...

LadyJava's Lounge 2 days ago

Introducing Redisson Live Objects (Object Hash Mapping)

 Mark As Read    

What is Redisson?Redisson is a Redis Java library that provides distributed Java objects and services including Set, Multimap, SortedSet, Map, List, Queue, BlockingQueue, Deque, BlockingDeque, Semaphore, Lock, AtomicLong, CountDownLatch, Publish / Subscribe, Bloom filter, Remote service, Spring cache, Executor service, Live Object service and most ...

The Evolution and Future of IDEs

 Mark As Read    

Being a developer today is perhaps more exhilarating than at any other time in history. We have incredible choice when it comes to languages and frameworks, and tools like GitHub and StackOverflow have connected millions to make sharing code and expertise simple and fast. These conveniences have allowed us all to spend more of our time being creati...

Java Concurrency Fork Join Pool

 Mark As Read    

The ForkJoinPool was introduced in Java 7. Is is similar to the Executor framework but with one difference. ForkjoinPools act in a recursive way, unlike Executor threads, which splits the task and submits smaller chunks to worker Threads. ForkJoinPool takes a big task, splits it into smaller tasks, and those smaller tasks split themselves again int...

One Exception to the Power of JDK 8 Collectors

 Mark As Read    

I’ve been using JDK 8 for over two years now and have found the new functional style of programming it provides really powerful. The thing that really impresses me about lambda expressions and streams is how I keep finding places where I am just blown away by how simple they make things.Let’s have a look at a recent example I found which nicely dem...

JUnit 5 Dynamic Tests — Generate Tests at Runtime

 Mark As Read    

In this article, I’d like to introduce about JUnit 5 Dynamic Tests feature which allows us to declare and run test cases generated at runtime.1. Static Tests vs. Dynamic Tests1.1. Static TestsTo get to know about the Dynamic Tests vs. Static Tests, let take a look at an example below. We have a very simple TranslatorEngine class which is responsibl...

The Elements of Programming Style [poll]

 Mark As Read    

In 1974 Brian Kernighan (yes, the Unix and The C Programming Language guy) and Bill Plauger (pair programming ground-breaker and another huge C and C++ wizard) wrote The Elements of Programming Style. The 56 maxims they proposed have influenced many programming books over the past four decades, but some of the issues treated are basically procedura...

Programming Android

 Mark As Read    

Get thoroughly up to speed on Android programming, and learn how to create up-to-date user experiences for both handsets and tablets. With this book's extensively revised second edition, you'll focus on Android tools and programming essentials, including best practices for using Android 4 APIs.

Java 3 days ago

Bakery Cleaning Tips

 Mark As Read    

Running a bakery can be a good deal of fun, but it’s also hard, tiring work. You’re constantly battling the heat and exhaustion as you keep up with orders and strive to come up with fresh ideas. To make matters worse, the demanding conditions in your kitchen are also taking a toll on your fixtures. […] No visits yet The post Bakery Cleaning T...

LadyJava's Lounge 3 days ago

Towards More Functional Java Using Streams and Lambdas

 Mark As Read    

In the last post I showed how the Java 7 try-with-resources feature reduces boilerplate code, but probably more importantly how it removes errors related to unclosed resources, thereby eliminating an entire class of errors. In this post, the first in an ad-hoc series on Java 8 features, I'll show how the stream API can reduce the lines of code, but...

Performance Improvements of Java Monitor From JDK 6 to 9

 Mark As Read    

The new JDK™ 9 early access release contains a JDK enhancement proposal JEP 143, Improve Contended Locking, to improve the performance of contended monitors. Monitors are used by the Java synchronized statement to lock access to a code block. If the synchronized block is called by several threads, the monitor becomes contended. This can degrade per...

This Week in Spring: Spinnaker and Spring Leaders

 Mark As Read    

Welcome to another installation of This Week in Spring! This week I’m in NYC (for the NYC Java SIG), Austin and San Francisco (for the Silicon Valley Spring User Group) talking to customers and doing meetups! We’ve got a lot to cover, as usual, so let’s get to it!Spinnaker is a continuous delivery tool from Netflix built on Spring Boot. It supports...

Regular Expression to Validate a Comma-Separated List of Email Addresses

 Mark As Read    

Recently I needed to create a regular expression to validate the format of a comma-separated list of email addresses. Just thought I’d share the result in case it is of use to anyone:w+@w+.w+(,s*w+@w+.w+)* Here’s an example of applying the pattern in Java:

Regular Expression to Validate a Comma-Separated List of Email Addresses

 Mark As Read    

EDIT It has already been pointed out by several readers that this expression doesn't handle a number of common cases. See the comments for an updated version.Recently I needed to create a regular expression to validate the format of a comma-separated list of email addresses. Just thought I’d share the result in case it is of use to anyone:

Gamer Poster

 Mark As Read    

Gamer Game Controller Poster by MalaysiaGiftsShop Browse Gamer Posters online at Zazzle.com http://java2everyone.blogspot.com

Java2everyone 4 days ago

This is NOT America's Next Top Best Friend T Shirt

 Mark As Read    

This is NOT America's Next Top Best Friend T Shirt by LittleThingsInLife Create your own t shirt designs online at Zazzle. http://java2everyone.blogspot.com

Java2everyone 4 days ago

Personalized Sweet 16 Keychain Favor/Gift

 Mark As Read    

Personalized Sweet 16 Keychain Favor/Gift by LittleThingsInLife Get your keychains personalized from Zazzle. http://java2everyone.blogspot.com

Java2everyone 4 days ago

You Are Such a Liar Camille! Dresses

 Mark As Read    

You Are Such a Liar Camille! Dresses by LittleThingsInLife Browse other Rhobh T-Shirts http://java2everyone.blogspot.com

Java2everyone 4 days ago

Sweet 16 Candy Table Gum

 Mark As Read    

Sweet 16 Candy Table Gum by LittleThingsInLife Check out other Sweet 16 Chewing Gum Favors at zazzle.com http://java2everyone.blogspot.com

Java2everyone 4 days ago

Well Jenelle Mug

 Mark As Read    

Well Jenelle Mug by LittleThingsInLife Check out more Well jenelle Mugs at Zazzle http://java2everyone.blogspot.com

Java2everyone 4 days ago

I'm the Blanche One Coffee Mug

 Mark As Read    

I'm the Blanche One Coffee Mug by LittleThingsInLife Create unique personalized cups and mugs at Zazzle http://java2everyone.blogspot.com

Java2everyone 4 days ago

The city goes to bed, & I can live inside my head T Shirt

 Mark As Read    

The city goes to bed, & I can live inside my head T Shirt by LittleThingsInLife Look at The city goes to bed T-Shirts online at Zazzle.com http://java2everyone.blogspot.com

Java2everyone 4 days ago

Personalized Sweet 16 Pin

 Mark As Read    

Personalized Sweet 16 Pin by LittleThingsInLife Make photo buttons at Zazzle. http://java2everyone.blogspot.com

Java2everyone 4 days ago

I Love Being A Theater Geek Shirt

 Mark As Read    

I Love Being A Theater Geek Shirt by LittleThingsInLife See more I love theater T-Shirts at zazzle.com http://java2everyone.blogspot.com

Java2everyone 4 days ago

Thank You Wedding Favor Pen

 Mark As Read    

Thank You Wedding Favor Pen by LittleThingsInLife Browse Wedding favor Pens online at Zazzle.com http://java2everyone.blogspot.com

Java2everyone 4 days ago

Getting Started and Testing with Angular CLI and Angular 2 (RC5)

 Mark As Read    

I started creating Angular 2 applications when it was in beta (back in March). To keep up with Angular 2's changes, I wrote a tutorial about developing with RC1 in June. Earlier this month, RC5 was released and many things changed once again. I think Scott Davis sums it up nicely in a tweet. They keep saying "Release C...

Raible Designs 4 days ago

Are You a ''Leading Edge'' Java Developer?

 Mark As Read    

There is clearly some differences on opinions out there and not all of them are positive for the JVM community. What does it mean to be a “leading edge” developer on the JVM. On the JVM, there are many languages like Scala, Kotlin and Clojure to name languages with real forward momentum.Are All Languages Welcome on the JVM?So can you program in two...

Refactoring Uncommon Design Smells

 Mark As Read    

We started working on design smells many years earlier than when we started writing our book "Refactoring for Software Design Smells" (see http://www.designsmells.com). I was digging through some of the old documents and remembered that we did not cover many smells, considering them to be "uncommon smells". By "uncommon smells", I mean the ones tha...

Using the Play Framework to Create a Java Web Application on Top of a .NET Back-End

 Mark As Read    

Java web applications have come a long way since the days of servlets and Java Server Pages (JSPs). There are now many Java web frameworks for a developer to choose from, including Spring MV...

GroovyBlogs.org 5 days ago

Using the Play Framework to Create a Java Web Application on Top of a .NET Back-End

 Mark As Read    

Java web applications have come a long way since the days of servlets and Java Server Pages (JSPs). There are now many Java web frameworks for a developer to choose from, including Spring MVC, Java Server Faces, Struts, GWT, Play, and Grails. As with many other emerging technologies, an abundance of choices of web frameworks will lead to developer...

Functional Default Arguments, Part Two

 Mark As Read    

In part one, we started to look at a new approach to defining default arguments for methods. Here we continue with a few detailed examples. Default Arguments and Functional ProgrammingLet me introduce you to the MaleProgrammer class, which I'll use as an example for the rest of this newsletter:

Signing NetBeans modules with a Time Stamping Authority (TSA)

 Mark As Read    

Signing JAR files is a very good practice. And while a proper certificate is not worth the price and effort, self-signing is still a step in the right direction.Ever since Java 5 jarsigner supported a Time Stamping Authority (TSA) with the --tsa and --tsacert parameters. A Time Stamping Authority is basically an online digital notary that certifies...

Emilian Bold's blog 5 days ago

When Web Companies Grow Up They Turn Into Java Shops [Video]

 Mark As Read    

Earlier this month I attended Pivotal’s SpringOne platform conference in Las Vegas. In case you’re not familiar with it, Spring is a Java Framework “that helps development teams everywhere build simple, portable, fast and flexible JVM-based systems and applications.”For some of you out there you may be thinking Java is old school and not relevant ...

JVM Debugger Memory View for IntelliJ IDEA

 Mark As Read    

Every day we try to find new ways to improve developer experience with IntelliJ IDEA. It may be a bugfix, a performance improvement, or a new feature (usually in this order). Today we’d like to introduce a new plugin called JVM Debugger Memory View.The plugin extends the built-in debugger with capabilities to explore objects in the JVM heap during ...

Functional Default Arguments, Part One

 Mark As Read    

OutlineJava lacks a built-in way to define default arguments for methods and constructors. Over the years, several approaches have been proposed, each with its pros and cons. The most widely-known one uses method overloading, though varargs, null values, the builder pattern, and even maps have been used as well. Here we propose a new approach based...

Plugging Leaky Abstractions

 Mark As Read    

In 2002, Joel Spolsky coined something he called “The Law of Leaky Abstractions.” In software, an “abstraction” hides complexity of an underlying system from those using the abstraction. Examples abound, but for a quick understanding, think of an ORM hiding from you the details of database interaction.The Law of Leaky Abstractions states that “al...

The Benefits of Coding Offline: On Encapsulated Codebases and Headspaces

 Mark As Read    

Last weekend I spent an afternoon at a coffee shop with no wifi in order to solve a problem that I thought should have been simple (automatic de-duping) but which had stumped me for weeks. (I was getting false positives in a pattern I couldn't figure out.)It took me less than an hour to solve the problem. Turns out I had been counting on one number...

New Dad Need More Coffee (Funny New Dad) Two-Tone Coffee Mug

 Mark As Read    

New Dad Need More Coffee (Funny New Dad) Two-Tone Coffee Mug by MalaysiaGiftsShop Find other New dad need more Mugs at zazzle.com http://java2everyone.blogspot.com

Java2everyone 6 days ago

Groovy Calamari - Issue 45 - 21st Aug 2016

 Mark As Read    

Comment About to head to the beach ?? but I am still reading GR8Conf US goodies. This is probably one of the few issues I have written so far without Grails links. However, th...

GroovyBlogs.org 6 days ago

JDK 9 @Deprecated Annotation Enhancements

 Mark As Read    

In the post What Might a New @Deprecated Look Like?, I used the description of JEP 277 ("Enhanced Deprecation") at that time to guide the creation of an enhanced customized @Deprecated annotation. Since that post, however, there have been significant changes made in JEP 277. This post summarizes the changes and the currently planned enhancements to...

Java
Welcome!
OnlyJava aggregates blogs for the Java industry.
Custom Feeds
Add any RSS feed to the information you read daily.
Blocked Feeds
Block feeds to remove blogs you’re not interested in.
Account Settings
Customize the site by adding or removing feeds.

About Us

OnlyJava is your source for all your Java news.

Have a Suggestion for Us?
Know of a Java blog that we're missing? Let us know!

Share OnlyJava.com