I faced this issue of UBUNTU 18.04. I saw other solution on the internet, but they did not work for me. I hope this blog helps you. Citrix complains about “User Trust rsa certification authority” permission does not exists. The /etc/ssl/certs folder has a permission file with exact same name USERTrust_RSA_Certification_Authority.pem . So, I copied this certificate from […]
How to prevent java reflection to create new instance by accessing private constructor of a class
This code will work on Java 9 and above. StackWalker was added in java 9. You can watch me work on this code on YouTube. We can use class check to make sure, the private constructor is not accessed from any other class. You can read entire source code at github. To restrict the access, […]
Use java reflection api to access private constructor of a class and create an instance
This code will work in Java 9 and above. You can watch my Youtube video, where I am working on this code. In java, we can use reflection apis to access all the properties of a java class. In this blog, I will show you how you can make a private constructor public and use […]
How to call c or cpp function from java, JNI native function implementation
I am running ubuntu 18.04 and java version 15. You can watch me work on this code on YouTube. Java provides a feature where we can call C or C++ functions. This should be used in the cases, where you need more performance. In that cases, you can just skip the JVM and call the […]
Why thread priority should not be used as base while designing multi-threaded applications
In October or November of 2018, I was asked a question in interview process by an interviewer from Sapient, Noida, India. The interviewer Subrata Kundu asked .. What is Thread priority? I said, thread priority is a kind of relative importance given to threads with respect to each other. That relative importance can be a […]
java.util.function.IntPredicate implementation using Modern Java
In this blog, I am going to show how to implement IntPredicate using lambdas. And, use them to do useful work. I am going to create a person class. Which has three properties, age, salary and name. And, I will use lambdas to find count of person, who are above thirty years of age or […]
java.util.function.IntFunction implementation using modern java
IntFunction is a functional interface, it takes an int and returns a reference type. This reference type can be specified by using generic type specification. We can implement it in different ways. Implement using a regular class. private class IntFuncImpl implements IntFunction<Integer>{ @Override public Integer apply(final int intValue) { return Integer.valueOf(intValue); } } Implement using […]
Double Unary Operator Implementation using modern java
DoubleUnaryOperator is a functional interface that lives in java.util.function package. It has one function applyAsDouble, which takes a double and returns a double. It is called an UnaryOperator, because it performs it’s action on a single argument. And, that single argument is of double type that’s why it has Double in it’s name. We can implement […]
Implement Prototype Design Pattern Using Java Base libraries features.
Java provides inbuilt features to implement Prototype design pattern. But, before using that I will show you how you can create a prototype without any help from any libraries. So, we have a Person class. public class Person { private String firstName; private String lastName; private String country; public Person(){} public Person(final String firstName, final String lastName, […]
Builder Design Pattern implementation in Java
There are many cases where, you do not need to provide values for all the variables and it is still a valid object, for example Java HttpClient. To this class you just have to provide a very basic minimum values and it will work. In the classes, where an instance is expected to work with […]