author | weijun |
Thu, 08 Sep 2011 09:04:28 +0800 | |
changeset 10435 | e9df9d264894 |
parent 9014 | 117374ccf1b7 |
child 14342 | 8435a30053c1 |
permissions | -rw-r--r-- |
3861
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
1 |
/* |
7668 | 2 |
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
3861
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
4 |
* |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
8 |
* |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
13 |
* accompanied this code). |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
14 |
* |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
18 |
* |
5506 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
3861
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
22 |
*/ |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
23 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
24 |
/* |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
25 |
* @test |
7026
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
26 |
* @bug 6882376 6985460 |
3861
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
27 |
* @summary Test if java.util.logging.Logger is created before and after |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
28 |
* logging is enabled. Also validate some basic PlatformLogger |
9014
117374ccf1b7
6381464: SimpleFormatter should use one single line format
mchung
parents:
7668
diff
changeset
|
29 |
* operations. othervm mode to make sure java.util.logging |
117374ccf1b7
6381464: SimpleFormatter should use one single line format
mchung
parents:
7668
diff
changeset
|
30 |
* is not initialized. |
3861
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
31 |
* |
4181
12101ac6820d
6896829: test/sun/util/logging/PlatformLoggerTest.java needs @compile tag to be compiled by jtreg
alanb
parents:
3861
diff
changeset
|
32 |
* @compile -XDignore.symbol.file PlatformLoggerTest.java |
9014
117374ccf1b7
6381464: SimpleFormatter should use one single line format
mchung
parents:
7668
diff
changeset
|
33 |
* @run main/othervm PlatformLoggerTest |
3861
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
34 |
*/ |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
35 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
36 |
import java.util.logging.*; |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
37 |
import sun.util.logging.PlatformLogger; |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
38 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
39 |
public class PlatformLoggerTest { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
40 |
private static final int defaultEffectiveLevel = 0; |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
41 |
public static void main(String[] args) throws Exception { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
42 |
final String FOO_PLATFORM_LOGGER = "test.platformlogger.foo"; |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
43 |
final String BAR_PLATFORM_LOGGER = "test.platformlogger.bar"; |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
44 |
final String GOO_PLATFORM_LOGGER = "test.platformlogger.goo"; |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
45 |
final String BAR_LOGGER = "test.logger.bar"; |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
46 |
PlatformLogger goo = PlatformLogger.getLogger(GOO_PLATFORM_LOGGER); |
7026
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
47 |
// test the PlatformLogger methods |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
48 |
testLogMethods(goo); |
3861
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
49 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
50 |
// Create a platform logger using the default |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
51 |
PlatformLogger foo = PlatformLogger.getLogger(FOO_PLATFORM_LOGGER); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
52 |
checkPlatformLogger(foo, FOO_PLATFORM_LOGGER); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
53 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
54 |
// create a java.util.logging.Logger |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
55 |
// now java.util.logging.Logger should be created for each platform logger |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
56 |
Logger logger = Logger.getLogger(BAR_LOGGER); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
57 |
logger.setLevel(Level.WARNING); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
58 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
59 |
PlatformLogger bar = PlatformLogger.getLogger(BAR_PLATFORM_LOGGER); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
60 |
checkPlatformLogger(bar, BAR_PLATFORM_LOGGER); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
61 |
|
7026
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
62 |
// test the PlatformLogger methods |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
63 |
testLogMethods(goo); |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
64 |
testLogMethods(bar); |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
65 |
|
3861
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
66 |
checkLogger(FOO_PLATFORM_LOGGER, Level.FINER); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
67 |
checkLogger(BAR_PLATFORM_LOGGER, Level.FINER); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
68 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
69 |
checkLogger(GOO_PLATFORM_LOGGER, null); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
70 |
checkLogger(BAR_LOGGER, Level.WARNING); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
71 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
72 |
foo.setLevel(PlatformLogger.SEVERE); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
73 |
checkLogger(FOO_PLATFORM_LOGGER, Level.SEVERE); |
7026
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
74 |
|
3861
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
75 |
} |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
76 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
77 |
private static void checkPlatformLogger(PlatformLogger logger, String name) { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
78 |
if (!logger.getName().equals(name)) { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
79 |
throw new RuntimeException("Invalid logger's name " + |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
80 |
logger.getName() + " but expected " + name); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
81 |
} |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
82 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
83 |
if (logger.getLevel() != defaultEffectiveLevel) { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
84 |
throw new RuntimeException("Invalid default level for logger " + |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
85 |
logger.getName()); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
86 |
} |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
87 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
88 |
if (logger.isLoggable(PlatformLogger.FINE) != false) { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
89 |
throw new RuntimeException("isLoggerable(FINE) returns true for logger " + |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
90 |
logger.getName() + " but expected false"); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
91 |
} |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
92 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
93 |
logger.setLevel(PlatformLogger.FINER); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
94 |
if (logger.getLevel() != Level.FINER.intValue()) { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
95 |
throw new RuntimeException("Invalid level for logger " + |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
96 |
logger.getName() + " " + logger.getLevel()); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
97 |
} |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
98 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
99 |
if (logger.isLoggable(PlatformLogger.FINE) != true) { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
100 |
throw new RuntimeException("isLoggerable(FINE) returns false for logger " + |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
101 |
logger.getName() + " but expected true"); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
102 |
} |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
103 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
104 |
logger.info("OK: Testing log message"); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
105 |
} |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
106 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
107 |
private static void checkLogger(String name, Level level) { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
108 |
Logger logger = LogManager.getLogManager().getLogger(name); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
109 |
if (logger == null) { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
110 |
throw new RuntimeException("Logger " + name + |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
111 |
" does not exist"); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
112 |
} |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
113 |
|
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
114 |
if (logger.getLevel() != level) { |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
115 |
throw new RuntimeException("Invalid level for logger " + |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
116 |
logger.getName() + " " + logger.getLevel()); |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
117 |
} |
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
118 |
} |
7026
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
119 |
|
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
120 |
private static void testLogMethods(PlatformLogger logger) { |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
121 |
logger.severe("Test severe(String, Object...) {0} {1}", new Long(1), "string"); |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
122 |
// test Object[] |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
123 |
logger.severe("Test severe(String, Object...) {0}", (Object[]) getPoints()); |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
124 |
logger.warning("Test warning(String, Throwable)", new Throwable("Testing")); |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
125 |
logger.info("Test info(String)"); |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
126 |
} |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
127 |
|
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
128 |
static Point[] getPoints() { |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
129 |
Point[] res = new Point[3]; |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
130 |
res[0] = new Point(0,0); |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
131 |
res[1] = new Point(1,1); |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
132 |
res[2] = new Point(2,2); |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
133 |
return res; |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
134 |
} |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
135 |
|
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
136 |
static class Point { |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
137 |
final int x; |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
138 |
final int y; |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
139 |
public Point(int x, int y) { |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
140 |
this.x = x; |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
141 |
this.y = y; |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
142 |
} |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
143 |
public String toString() { |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
144 |
return "{x="+x + ", y=" + y + "}"; |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
145 |
} |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
146 |
} |
9f2ec5fad124
6985460: PlatformLogger throws ArrayStoreException when j.u.logging is initialized
mchung
parents:
5506
diff
changeset
|
147 |
|
3861
a98a057ec335
6882376: Add internal support for JRE implementation to eliminate the dependency on logging
mchung
parents:
diff
changeset
|
148 |
} |