Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/make/src/classes/build/tools/cldrconverter/CopyrightHeaders.java
32287 views
/*1* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package build.tools.cldrconverter;2627import java.util.Calendar;28import java.util.GregorianCalendar;29import java.util.Locale;30import java.util.TimeZone;3132class CopyrightHeaders {33private static final String ORACLE2012 =34"/*\n" +35" * Copyright (c) %d, Oracle and/or its affiliates. All rights reserved.\n" +36" */\n";3738private static final String ORACLE_AFTER2012 =39"/*\n" +40" * Copyright (c) 2012, %d, Oracle and/or its affiliates. All rights reserved.\n" +41" */\n";4243private static final String UNICODE =44"/*\n" +45" * COPYRIGHT AND PERMISSION NOTICE\n" +46" *\n" +47" * Copyright (C) 1991-2012 Unicode, Inc. All rights reserved. Distributed under\n" +48" * the Terms of Use in http://www.unicode.org/copyright.html.\n" +49" *\n" +50" * Permission is hereby granted, free of charge, to any person obtaining a copy\n" +51" * of the Unicode data files and any associated documentation (the \"Data\n" +52" * Files\") or Unicode software and any associated documentation (the\n" +53" * \"Software\") to deal in the Data Files or Software without restriction,\n" +54" * including without limitation the rights to use, copy, modify, merge,\n" +55" * publish, distribute, and/or sell copies of the Data Files or Software, and\n" +56" * to permit persons to whom the Data Files or Software are furnished to do so,\n" +57" * provided that (a) the above copyright notice(s) and this permission notice\n" +58" * appear with all copies of the Data Files or Software, (b) both the above\n" +59" * copyright notice(s) and this permission notice appear in associated\n" +60" * documentation, and (c) there is clear notice in each modified Data File or\n" +61" * in the Software as well as in the documentation associated with the Data\n" +62" * File(s) or Software that the data or software has been modified.\n" +63" *\n" +64" * THE DATA FILES AND SOFTWARE ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n" +65" * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n" +66" * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +67" * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS\n" +68" * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR\n" +69" * CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,\n" +70" * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n" +71" * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\n" +72" * OF THE DATA FILES OR SOFTWARE.\n" +73" *\n" +74" * Except as contained in this notice, the name of a copyright holder shall not\n" +75" * be used in advertising or otherwise to promote the sale, use or other\n" +76" * dealings in these Data Files or Software without prior written authorization\n" +77" * of the copyright holder.\n" +78" */\n";7980private static String OPENJDK2012 =81"/*\n" +82" * Copyright (c) %d, Oracle and/or its affiliates. All rights reserved.\n" +83" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n" +84" *\n" +85" * This code is free software; you can redistribute it and/or modify it\n" +86" * under the terms of the GNU General Public License version 2 only, as\n" +87" * published by the Free Software Foundation. Oracle designates this\n" +88" * particular file as subject to the \"Classpath\" exception as provided\n" +89" * by Oracle in the LICENSE file that accompanied this code.\n" +90" *\n" +91" * This code is distributed in the hope that it will be useful, but WITHOUT\n" +92" * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n" +93" * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n" +94" * version 2 for more details (a copy is included in the LICENSE file that\n" +95" * accompanied this code).\n" +96" *\n" +97" * You should have received a copy of the GNU General Public License version\n" +98" * 2 along with this work; if not, write to the Free Software Foundation,\n" +99" * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n" +100" *\n" +101" * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n" +102" * or visit www.oracle.com if you need additional information or have any\n" +103" * questions.\n" +104" */\n";105106private static String OPENJDK_AFTER2012 =107"/*\n" +108" * Copyright (c) 2012, %d, Oracle and/or its affiliates. All rights reserved.\n" +109" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n" +110" *\n" +111" * This code is free software; you can redistribute it and/or modify it\n" +112" * under the terms of the GNU General Public License version 2 only, as\n" +113" * published by the Free Software Foundation. Oracle designates this\n" +114" * particular file as subject to the \"Classpath\" exception as provided\n" +115" * by Oracle in the LICENSE file that accompanied this code.\n" +116" *\n" +117" * This code is distributed in the hope that it will be useful, but WITHOUT\n" +118" * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n" +119" * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n" +120" * version 2 for more details (a copy is included in the LICENSE file that\n" +121" * accompanied this code).\n" +122" *\n" +123" * You should have received a copy of the GNU General Public License version\n" +124" * 2 along with this work; if not, write to the Free Software Foundation,\n" +125" * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n" +126" *\n" +127" * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n" +128" * or visit www.oracle.com if you need additional information or have any\n" +129" * questions.\n" +130" */\n";131132static String getOracleCopyright() {133int year = getYear();134return String.format(year > 2012 ? ORACLE_AFTER2012 : ORACLE2012, year);135}136137static String getUnicodeCopyright() {138return UNICODE;139}140141static String getOpenJDKCopyright() {142int year = getYear();143return String.format(year > 2012 ? OPENJDK_AFTER2012 : OPENJDK2012, year);144}145146private static int getYear() {147return new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"),148Locale.US).get(Calendar.YEAR);149}150151// no instantiation152private CopyrightHeaders() {153}154}155156157158