3307N/A/*
3307N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3307N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3307N/A *
3307N/A * This code is free software; you can redistribute it and/or modify it
3307N/A * under the terms of the GNU General Public License version 2 only, as
3307N/A * published by the Free Software Foundation.
3307N/A *
3307N/A * This code is distributed in the hope that it will be useful, but WITHOUT
3307N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3307N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3307N/A * version 2 for more details (a copy is included in the LICENSE file that
3307N/A * accompanied this code).
3307N/A *
3307N/A * You should have received a copy of the GNU General Public License version
3307N/A * 2 along with this work; if not, write to the Free Software Foundation,
3307N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3307N/A *
3307N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3307N/A * or visit www.oracle.com if you need additional information or have any
3307N/A * questions.
3307N/A */
3307N/A
3307N/Apackage com.foo;
3307N/A
3307N/Aimport java.text.*;
3307N/Aimport java.util.*;
3307N/A
3307N/A/**
3307N/A * FooDateFormat provides SimpleDateFormat methods required for the SPI testing.
3307N/A */
3307N/Apublic class FooDateFormat extends DateFormat {
3307N/A private SimpleDateFormat sdf;
3307N/A
3307N/A public FooDateFormat(String pattern, Locale loc) {
3307N/A sdf = new SimpleDateFormat(pattern, loc);
3307N/A }
3307N/A
3307N/A @Override
3307N/A public StringBuffer format(Date date,
3307N/A StringBuffer toAppendTo,
3307N/A FieldPosition fieldPosition) {
3307N/A return sdf.format(date, toAppendTo, fieldPosition);
3307N/A }
3307N/A
3307N/A @Override
3307N/A public Date parse(String source, ParsePosition pos) {
3307N/A return sdf.parse(source, pos);
3307N/A }
3307N/A
3307N/A @Override
3307N/A public boolean equals(Object other) {
3307N/A return other instanceof FooDateFormat
3307N/A && sdf.equals(((FooDateFormat)other).sdf);
3307N/A }
3307N/A
3307N/A @Override
3307N/A public int hashCode() {
3307N/A return sdf.hashCode();
3307N/A }
3307N/A}