Here you can find the source of objectsEqual(Object o1, Object o2)
public static boolean objectsEqual(Object o1, Object o2)
//package com.java2s; /*/*from w ww. ja v a 2 s .co m*/ * This file is part of the Scriba source distribution. This is free, open-source * software. For full licensing information, please see the LicensingInformation file * at the root level of the distribution. * * Copyright (c) 2006-2007 Kobrix Software, Inc. */ public class Main { /** * Returns if two strings are equal. This correctly handles null pointers, * as opposed to calling <code>o1.equals(o2)</code>. * @since jEdit 4.2pre1 */ public static boolean objectsEqual(Object o1, Object o2) { if (o1 == null) { if (o2 == null) return true; else return false; } else if (o2 == null) return false; else return o1.equals(o2); } }