Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Different module types in Java 9

Java 9 is going to introduce a disruptive change to the Java platform -- Module System. The module system will change how Java applications work in the future. It's like changing the foundation of a house without impacting the house functionality and its top level structure. This obviously is a big challenge for the whole Java community. To bring as little pain as possible to migrate existing applications to Java 9 without refactoring the whole application, Java 9 will introduce a few different module types. In following sections, these different module types will be covered.But before co...

8,196 1       JAVA JAVA 9 JIGSAW MODULE SYSTEM UNNAMED MODULE AUTOMATIC MODULE NAMED MODULE


  String intern in Java

In Java, == is used to compare whether two objects have the same memory location, equals() is usually used to compare whether two objects have the same time and the same state.  When comparing two strings, normally we just want to know whether they have same content, so we can choose equals(). But since String comparison is so frequently needed, Java has worked on the String class to make == workable when comparing two String literals.The String class maintains a pool of empty string literals initially. Then when a new string is created, this new string will checked against...

3,854 0       JAVA STRING


  New features in Java 9

Java 9 is planned to be released in March 2017. It will be 3 years since Java 8 was released. Are you still excited about the new features introduced in Java 8 such as Lambda, new Date APIs etc? Now Java 9 is to be released and there are also quite a few fantastic new features to be introduced.Below is a list of major new features in Java 9.Modular system. Java 9 will introduce a brand new modular system to organize Java codes. The modular system will divide different packages into different modules to ensure reliable configuration and strong encapsulation. With this, you only need to shi...

17,402 4       JAVA NEW FEATURE JAVA 9


  Oracle released an urgent Java patch

On March 23, Oracle just released an urgent Java patch which is out of its normal update schedule. The security vulnerability is related to the Java SE running in web browsers on desktops. The CVE ID for this issue is CVE-2016-0636.With the unpatched Java, attackers can remotely exploit the target system without username and credentials. Successful exploits can impact the availability, integrity, and confidentiality of the user's system. When the user access pages containing malicious codes on an affected web browser, they are vulnerable to this attack.The vulnerability only affects ...

3,908 0       JAVA SECURITY ORACLE NEWS


  Three images to understand immutability of String in Java

String is immutable in Java. This means once a String object is created and instantiated, that object cannot be changed. Any operation on the String object will create a new Object instead of operating on the original content. Below are three images to help you understand String immutability in Java.Declare a StringString s = "abcd";s stores the reference to the string content created in the heap.Assign the String reference to another String variableString s2 = s;s2 stores the same reference to the same String object. Since the content is not changed, there will be only one actual object ...

4,442 1       JAVA STRING


  Access control in Java -- doPrivileged

Previously we have introduced how Java performs permission check to protect resource access. What if sometimes we need to give some class the temporary access to some resource which it initially doesn't have? AccessController provides six doPrivileged methods to fulfill this requirement.These six methods have below signatures :static T doPrivileged(PrivilegedAction action)static T doPrivileged(PrivilegedAction action, AccessControlContext context)static T doPrivileged(PrivilegedExceptionAction action)static T doPrivileged(PrivilegedExceptionAction action, AccessControlContext context)stat...

3,431 0       JAVA SECURITY DOPRIVILEGED


  Access control in Java -- Permission check order

Previously we showed you how to turn on SecurityManager in Java. After SecurityManager is turned on, a series of permission checks will be applied on the code you are calling in your application to protect some resources against malicious access such as files, sockets etc.To perform these permission checks, a set of Permissions will be created and checked using the AccessController. The AccessController has three purposes :To decide whether an access to a critical system resource is to be allowed or denied, based on the security policy currently in effect,To mark code as being "privileged", th...

3,353 0       JAVA SECURITY ACCESSCONTROLLER


  Canonicalize XML in Java

XML canonicalization is often used when there is need to create digital signature to be sent to peers for verification. Since digital signature is created based on XML data, the XML data has to be canonicalized before its signature value can be calculated. Even an extra space may affect the signature value calculated, hence it must follow some rules to canonicalize the XML data so that it has a standard format. This is why W3C created specification Canonical XML Version 1.1.This specification provides the rules to format element nodes, attribute nodes and namespace nodes etc. Different pr...

15,808 0       JAVA XML JAVA SECURITY