Pull to refresh
198.4

Java *

General-purpose computer-programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible

Show first
Rating limit
Level of difficulty

Big / Bug Data: Analyzing the Apache Flink Source Code

Reading time11 min
Views909
image1.png

Applications used in the field of Big Data process huge amounts of information, and this often happens in real time. Naturally, such applications must be highly reliable so that no error in the code can interfere with data processing. To achieve high reliability, one needs to keep a wary eye on the code quality of projects developed for this area. The PVS-Studio static analyzer is one of the solutions to this problem. Today, the Apache Flink project developed by the Apache Software Foundation, one of the leaders in the Big Data software market, was chosen as a test subject for the analyzer.
Read more →

Spring Boot app with Apache Kafka in Docker container

Reading time4 min
Views31K

Privet, comrads!

In this article i’ll show how easy it is to setup Spring Java app with Kafka message brocker. We will use docker containers for kafka zookeeper/brocker apps and configure plaintext authorization for access from both local and external net.

Link to final project on github can be picked up at the end of the article.

Read more

How To Build a Password Management Software Using JAVA?

Reading time5 min
Views14K

In this digital world, people prefer to work remotely. There are numerous tasks that each of us goes through every day. If I talk about an application's usage, then it has been predicted that there will be a 25% increase in global app downloads between 2018 and 2022

But it can be quite challenging for organizations to maintain and create multiple passwords. Hence, a password management software can be a great choice to manage this effectively. It is like your bank locker, where one can store numerous passwords. The users only need a master password to access the software.

Do You Know? 

Read More

Distributed File Systems

Reading time9 min
Views9.9K

The Big Data Tools plugin seamlessly integrates HDFS into your IDE and provides access to different cloud storage systems (AWS S3, Minio, Linode, Digital Open Space, GS, Azure). But is this the end? Have we implemented everything and now progress has stopped? Of course not.


In this short digest, we'll take a look at 15 popular distributed file systems available on the market and try to get a sense of their individual advantages.


Almost all of these systems are free or open-source, and you can find the sources on GitHub. The sites of these projects, their documentation, and online reviews provide most of the information we’ll consider here. Other than HDFS, none of these technologies have been implemented yet in Big Data Tools. But who knows? Perhaps someday we'll see them in our plugin.


Read more →

Big Data Tools Update 11 Is Out

Reading time3 min
Views1.8K

EAP 11 of the Big Data Tools plugin for IntelliJ IDEA Ultimate, PyCharm, and DataGrip is available starting today. You can install it from the JetBrains Plugin Repository or inside your IDE.


Big Data Tools is a new JetBrains plugin that allows you to connect to Hadoop and Spark clusters and monitor nodes, applications, and jobs. It also brings support for editing and running Zeppelin notebooks inside IntelliJ IDEA and DataGrip, so you can create, edit, and run Zeppelin notebooks without ever having to leave your favorite IDE. The plugin offers smart navigation, code completion, inspections, quick-fixes, and refactoring inside notebooks.


Read more →

ZTools for Apache Zeppelin

Reading time8 min
Views1.4K



Zeppelin is a web-based notebook for data engineers that enables data-driven, interactive data analytics with Spark, Scala, and more.


The project recently reached version 0.9.0-preview2 and is being actively developed, but there are still many things to be implemented.


One such thing is an API for getting comprehensive information about what's going on inside the notebook. There is already an API that completely solves the problems of high-level notebook management, but it doesn’t help if you want to do anything more complex.

Read more →

Checking WildFly, a JavaEE Application Server

Reading time9 min
Views682
image1.png

WildFly (formerly known as JBoss Application Server) is an open-source JavaEE application server developed and first released by JBoss in February, 2008. The primary goal of the project is to provide a set of tools usually required for enterprise Java applications. And since the server is used for developing enterprise applications, it is especially important to minimize the number of bugs and potential vulnerabilities in its code. Today, WildFly is being developed by the large company Red Hat, and they keep the code quality at a pretty high level. That said, our analyzer was still able to find a number of programming mistakes in the project.
Read more →

JavaCC 21 Parser Generator

Reading time4 min
Views2.6K

JavaCC 21 is a continuation of work on the venerable JavaCC parser generator, originally developed at Sun Microsystems in the 1990’s and released under a liberal open source license in 2003. It is currently the most advanced version of JavaCC. It has many feature enhancements (with more to come soon) and also generates much more modern, readable Java code. Also, certain key bugs have finally been fixed. (N.B. The “21” in JavaCC 21 is not a version number. It is simply part of the project name and means that this is a JavaCC for the 21st century!)

Read more →

How to write Palindrome Polyglot Quines

Reading time10 min
Views2.6K
PalidromePolyglotQuine

I offer a solution to one beautiful task — writing code that outputs its text is valid for interpreters and compilers of different languages and is correctly executed when reversing its sources.


Not so long ago I learned about code that can be both interpreted in PHP and compiled to Java: PhpJava.java. As it turned out, this idea is not new: code which is valid for several compilers or interpreters is called a polyglot. It is possible to write such code because of the peculiarities of processing strings and comments in different interpreters or compilers.

Read more →

Checking the Code of XMage, and Why You Won't Be Able to Get the Special Rare Cards of the Dragon's Maze Collection

Reading time13 min
Views672
image1.png

XMage is a client-server application for playing Magic: The Gathering (MTG). XMage's development was started in early 2010. Since then, it has seen 182 releases, attracted an army of contributors, and it's still being actively developed even now. All that makes it a good reason for us to contribute to its development too! So, today the PVS-Studio unicorn is going to check the code base of XMage and maybe even get into a fight with some entities.
Read more →

Delayed queue in Java and Redis

Reading time6 min
Views8.9K

Several years ago we had to solve how to enqueue events with an arbitrary delay, e.g. check a status of a payment 3 hours later, or send notification to a client in 45 minutes. At that point of time, we didn't find suitable libraries to accomplish this task, which didn't require us to spend time on configuration and maintenance. After analysing possible solutions we ended up building our own small library delayed queue in Java language on top of Redis storage engine. In this article I'll explain capabilities of this library, alternatives and problems we solved during creation process.

Read more →

7 Ultimate Programming languages For Mobile App Development

Reading time5 min
Views4.8K
"image"

Do you know that 21% of people open an app 50+ times per day? Yes, you heard that right. With the rapid development of technology, the mobile app now made many things possible, which was previously unthinkable.

And that's why there is an incredible increase in the number of mobile users. According to a recent mobile app development stat, the number of mobile users worldwide is projected to increase to 6.95 billion by the end of 2020.

In the last couple of years, the mobile app development industry has grown manifold, changing how businesses function around the world. If you are planning to jump into mobile app development, then choosing the right programming language will be the most significant challenge.

There are more than 600 programming languages, and each one has its own perks and popularity. Are you pondering which language would be best for developing a stunning app?

Several factors come to mind when making this choice, but the most important one is the language's demand. Here in this blog, I have listed the best programming language for mobile apps in terms of popularity and demand. Let's start!
Read more →

Under the Hood of PVS-Studio for Java: How We Develop Diagnostics

Reading time8 min
Views461

To keep it interesting, this time I'd like to tell about our approach to developing and polishing diagnostic rules for PVS-Studio Java. You will learn how we keep existing warnings consistent across releases and why the new ones aren't too weird. I'll also share a bit of inside information on what plans we, the Java team, have for the future, and show you a few interesting (and a few plain) bugs we found using the diagnostics from the upcoming release.
Read more →

Spring transaction management. Isolation and propagation

Reading time3 min
Views29K

Introduction


In my opinion transaction management is a really important topic for each backend developer. In general, people don’t pay attention to it while using Spring framework.


But I think, it is important to know how to use transactions properly. Because sometimes can happen that there was an exception thrown inside your method, but transaction was not rolled back and it is not clear why? Or some other “strange” cases.

Read more →

The Testcontainers’ MongoDB Module and Spring Data MongoDB Reactive in Action

Reading time19 min
Views5.6K

1. Introduction


How can I easily test my MongoDB multi-document transaction code without setting up MongoDB on my device? One might argue that they have to set it up first because in order to carry out such a transaction it needs a session which requires a replica set. Thankfully, there is no need to create a 3-node replica set and we can run these transactions only against a single database instance.

Read more →

IntelliJ IDEA: Structural Search and Replace

Reading time11 min
Views7.7K

Modern IDEs are very powerful tools that can help developers in all kinds of situations. Unfortunately, much of this power is often lost because many functions remain unknown to developers, hiding in the shadows.


Simple example of the one of the such functions

Did you know that when you press F2 in IntelliJ IDEA, the cursor will jump to the nearest error in the file? And in the absence of an error – to the nearest warning? It seems that this is a secret only a few people know about.


Structural search and replace is one such pair of features. They can be extremely useful in situations where a whole variety of other functions can’t quite get the job done.


In this post, I will present some of these situations and go beyond artificial cases by demonstrating examples of real code from two projects:


  1. 3D-engine for game development, jMonkeyEngine, which is an example of a big, interesting project.
  2. My own pet project, plantuml-native-image, where I experiment with compiling PlantUML into native executable code using GraalVM Native Image.

In fact, it is this second project that encouraged me to write this post but I’m getting ahead of myself. First things first...

Read more →

Small things that pollute your code

Reading time4 min
Views2.4K
I'm not going to discuss global things like design patterns and so on, as there's enough literature on that topic. Instead, I'd like to attract your attention to some small things that still affect lucidity and maintainability of a code.

Polluting code with 'test-only' methods or access modifiers


First of all, if you give access to something that shouldn't be used in production code, it gets used sooner or later. Just because it exist. The argument that it's an internal stuff doesn't work as it absolutely shouldn't be matter, writing you a library or isolated project! Treat people who will add anything to your internal codebase the same way as if they use your existing code as a different library.

Thus, if for some reason in test, you need to call something that should not be called on prod — use reflection or whatever else but do not expose it in production code! And there's no reason to afraid of reflection for test proposes, at the end, you using Mockito, shouldn't it be bad in that case as well?
Read more →

The PVS-Studio analyzer: detecting potential compatibility issues with Java SE API

Reading time9 min
Views708

Рисунок 9

2019 was a very busy year in terms of conferences. Our team could leave for whole weeks on business trips. As you know, the conference is perfect time to share knowledge. In addition to giving talks and telling many interesting things at our booth, we also learned a lot from communicating with conference participants and speakers. So at the Joker 2019 conference in fall, a talk from Dalia Abo Sheasha «Migrating beyond Java 8» inspired us to implement a new diagnostic rule that allows us to detect incompatibilities in the Java SE API between different versions of Java. This is what we will talk about.
Read more →

Java vs .Net: Who will Reign in the Future?

Reading time6 min
Views50K
As the time is changing, technologies are expanding and with that, the priority and the importance of the technical languages are also changing. So, usually, it becomes difficult to pick when we have to choose between two languages.

 

 

java vs .net


 

Here we will see the battle between Java and Microsoft .Net in order to make this clear which language is better to choose. For that, you may also have a quick look at this short video:
Read more →

NSA, Ghidra, and Unicorns

Reading time12 min
Views961

NSA, Ghidra, and Unicorns

This time, the PVS-Studio team's attention was attracted by Ghidra, a big bad reverse-engineering framework allowing developers to analyze binary files and do horrible things to them. The most remarkable fact about it is not even that it's free and easily extensible with plugins but that it was developed and uploaded to GitHub for public access by NSA. On the one hand, you bet NSA has enough resources for keeping their code base clean. On the other hand, new contributors, who are not well familiar with it, may have accidentally introduced bugs that could stay unnoticed. So, we decided to feed the project to our static analyzer and see if it has any code issues.
Read more →