Author Archives: Kristijan Rebernišak

About Kristijan Rebernišak

Java EE developer currently working at Five Minutes Ltd. Spends free time playing futsal, kitesurfing, snowboarding and learning new technologies.

Check user permission using aspect-oriented programming

In this post we will show a example of simple and clean way to check your users permissions across your application using aspect-oriented programming (AOP).
Read more

Leave a comment · Posted in Blog, Five Minutes, Java, Technology

Empty is always better than null

It is not uncommon to see methods that look something like this:

private List cheesesInStock = ...;

/**
 * @return an array containing all of the cheeses in the shop,
 *         or null if no cheeses are available for purchase.
 */
public Cheese[] getCheeses() {
    if (cheesesInStock.size() == 0)
        return null;
    ...
}

Read more

Leave a comment · Posted in Blog