Unsafe (sun.misc.Unsafe) is one of the least understood and mysterious aspects of Java. As the name suggests, improper use of it can lead you to violate the ‘safety’ guarantees provided by Java and so the JDK builds in safeguards to make it difficult for the Java programmer to access it. In particular, trying to obtain a reference to its singleton instance in the JVM will throw a SecurityException in most cases.
The JDK itself uses Unsafe. You can see that in the Atomic classes: AtomicInteger, AtomicLong, etc., where you will see that Unsafe provides access to the CAS calls that these atomics use.
We've just announced general availability for Java on Sourcegraph. If you write Java, this means that you can now use Sourcegraph to:
Every feature mentioned in this post is available now for Java on Sourcegraph.com and Sourcegraph Enterprise. Scroll down for the detailed feature list.
Hey Java Developer,
If you are wondering whether there is a way to avoid these problems, I am very much pleased to inform you that there is an ORM tool called Hibernate that you can use to overcome this.
Hi, Spring fans! We’ve now finished two seasons — 11 episodes and a recap post each — of Spring Tips. I’m going to take a little while to dream up some more content and, before you know it, we’ll be back at it again! I’m always interested in hearing proposed topics so if you have some, please, by all means, shout it out loud to me on Twitter (@starbuxman) .
The motivations for me in doing these Spring Tips are to:
Multi-Threading in Computer Science represents a very intriguing topic, even after years of research and development for high quality, robust and efficient software. With equal emphasis on hardware improvements and the software that runs on it – we have newer paradigms for parallelism. The most important yet basic concepts are the ones which I present here. I then explain the intricacies of multi-threading in the Java Programming Language. Some of these are newer features and supported only from the Java Platform Standard Edition 5.0. Let us start with a quick overview and understanding of the core concepts.Thread Concepts in Operating Systems
Thread: A thread is a lightweight process, but it differs from a process in multiple ways. The primary features of a thread are that it creates a sense of execution of processes concurrently; it effectively distributes work and executes a single task, it can be used to schedule and asynchronously execute tasks, it has a more effective context switching mechanism than processes, and it shares the memory space along with other threads yet can have its own storage
In this article, you will receive overviews of Spring, Spring MVC, and Spring Boot, learn what problems they solve, and where they're best applied. The most important thing that you will learn is that Spring, Spring MVC, and Spring Boot are not competing for the same space. They solve different problems and they solve them very well.What Is the Core Problem That Spring Framework Solves?
Think long and hard. What’s the problem Spring Framework solves?
To gather insights on the state of the Java ecosystem today, we spoke to nine executives who are familiar with it. We asked these experienced Java professionals, "What other technical solutions do you use in conjunction with Java?" Here's what they told us:
What technical solutions do you use most frequently with Java?
Welcome to another installation of This Week in Spring!
Hey, folks! I hope everyone is enjoying their coding days (or nights, whichever you prefer). If you are here, then you are probably looking for a better or cleaner way to make your Scala code robust and readable altogether.
Recently, I have been going through some Scala code written by a majority of Java developers who would like to learn Scala and are fairly new to the language. I hope this blog helps them as well and that they learn something from it.
We just posted another consequential release of Bootique — version 0.22. The focus of the changes in the core was to make module customization more transparent and give more power to the users to shape the CLI (command-line interfaces) of their apps. There was a significant improvement in handling of the test data sets in bootique-jdbc-test. And, as has become a tradition lately, we’ve added 4 new top-level Bootique projects, providing integration facilities for JBoss Undertow, RabbitMQ, Apache Shiro, and also Kotlin!
Let’s start with the core changes…
I would never call myself a real programmer, but I have a healthy obsession with studying new languages that emerge, especially those that arrive with little baggage and attempt to solve current problems and new use cases. This brought about my explorations in recent years of Swift and Kotlin, both initially aimed to fix issues with the languages traditionally used in their worlds, but rapidly became used in more widespread contexts, and generally, have enthusiastic communities.
One of the positives of Kotlin was its interoperability with the language it intended to supplement and replace, as Kotlin runs in the JVM, it was relatively easy to run it alongside your existing Java stack, replacing components of, or complete code-bases. Last week JetBrains announced a tech preview of Kotlin/Native that compiles your code straight to machine code, opening it up to a whole other world of platforms and use cases where virtual machines aren’t desirable or possible. I couldn’t resist taking a look and seeing how it worked.
There seems to be a lot of misconceptions related to MVC. Some consider it a technique for code reuse, others think it’s how you group classes in web applications, and some have even mistaken it for the frameworks that claim to support the pattern. In this post, we’ll take a look at a paper written by Trygve Reenskaug and try to figure out what its original creator really means when he talks about MVC.MVC Pattern Language
The first two sentences of the abstract already shed some interesting light on MVC:
What does the concept of dependency mean in programming? Is it important in modern development process? Does the concept of dependency have a different meaning when we speak about procedural programming, object-oriented programming, or functional programming? In this post, I will try to sum up all the knowledge I gained during my life as a software developer.The Very Beginning
First of all, we need to have, clearly in mind, the concept of dependency in everyday language. Merriam-Webster gives the following definition of dependency: