Gentoo Archives: gentoo-commits

From: "Petteri Raty (betelgeuse)" <betelgeuse@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-db/hsqldb/files: StringComparator.java
Date: Fri, 04 Jul 2008 19:57:22
Message-Id: E1KErPB-0007Ma-2l@stork.gentoo.org
1 betelgeuse 08/07/04 19:57:17
2
3 Added: StringComparator.java
4 Log:
5 Version bump. Fixes bug #228697.
6 (Portage version: 2.2_rc1/cvs/Linux 2.6.25-gentoo-r5 i686)
7
8 Revision Changes Path
9 1.1 dev-db/hsqldb/files/StringComparator.java
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/hsqldb/files/StringComparator.java?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/hsqldb/files/StringComparator.java?rev=1.1&content-type=text/plain
13
14 Index: StringComparator.java
15 ===================================================================
16 /* Copyright (c) 2001-2008, The HSQL Development Group
17 * All rights reserved.
18 *
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions are met:
21 *
22 * Redistributions of source code must retain the above copyright notice, this
23 * list of conditions and the following disclaimer.
24 *
25 * Redistributions in binary form must reproduce the above copyright notice,
26 * this list of conditions and the following disclaimer in the documentation
27 * and/or other materials provided with the distribution.
28 *
29 * Neither the name of the HSQL Development Group nor the names of its
30 * contributors may be used to endorse or promote products derived from this
31 * software without specific prior written permission.
32 *
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
34 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
35 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
36 * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
37 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
38 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
39 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
41 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 */
45
46
47 package org.hsqldb.lib;
48
49 public class StringComparator implements ObjectComparator {
50
51 public int compare(Object a, Object b) {
52
53 // handle nulls
54 if (a == b) {
55 return 0;
56 }
57
58 if (a == null) {
59 return -1;
60 }
61
62 if (b == null) {
63 return 1;
64 }
65
66 return ((String) a).compareTo((String) b);
67 }
68 }
69
70
71
72 --
73 gentoo-commits@l.g.o mailing list