Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaField.java @ 24130:0386b21ed2b3
added Services.initializeJVMCI (JDK-8177845)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 18 Apr 2017 17:14:58 +0200 |
parents | 30af491f98c5 |
children |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22505
diff
changeset
|
2 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
23 package jdk.vm.ci.meta; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
22569
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22536
diff
changeset
|
25 import java.util.IllegalFormatException; |
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22536
diff
changeset
|
26 import java.util.UnknownFormatConversionException; |
16481
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
27 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
28 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
29 * Represents a reference to a Java field, either resolved or unresolved fields. Fields, like |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
30 * methods and types, are resolved through {@link ConstantPool constant pools}. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
31 */ |
23365
30af491f98c5
Remove TrustedInterface (JDK-8155719).
Roland Schatz <roland.schatz@oracle.com>
parents:
22672
diff
changeset
|
32 public interface JavaField { |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5541
diff
changeset
|
33 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
34 /** |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5541
diff
changeset
|
35 * Returns the name of this field. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
36 */ |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5541
diff
changeset
|
37 String getName(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
38 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
39 /** |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5541
diff
changeset
|
40 * Returns a {@link JavaType} object that identifies the declared type for this field. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
41 */ |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5541
diff
changeset
|
42 JavaType getType(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
43 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
44 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
45 * Returns the kind of this field. This is the same as calling {@link #getType}. |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22505
diff
changeset
|
46 * {@link JavaType#getJavaKind getJavaKind}. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
47 */ |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22505
diff
changeset
|
48 default JavaKind getJavaKind() { |
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22505
diff
changeset
|
49 return getType().getJavaKind(); |
18372
18b19a6f9851
Add default implementation for Kind accessors of Signature and JavaField
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18267
diff
changeset
|
50 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
51 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
52 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
53 * Returns the {@link JavaType} object representing the class or interface that declares this |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
54 * field. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
55 */ |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5541
diff
changeset
|
56 JavaType getDeclaringClass(); |
16481
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
57 |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
58 /** |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
59 * Gets a string for this field formatted according to a given format specification. A format |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
60 * specification is composed of characters that are to be copied verbatim to the result and |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
61 * specifiers that denote an attribute of this field that is to be copied to the result. A |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
62 * specifier is a single character preceded by a '%' character. The accepted specifiers and the |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
63 * field attributes they denote are described below: |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
64 * |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
65 * <pre> |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
66 * Specifier | Description | Example(s) |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
67 * ----------+------------------------------------------------------------------------------------------ |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
68 * 'T' | Qualified type | "int" "java.lang.String" |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
69 * 't' | Unqualified type | "int" "String" |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
70 * 'H' | Qualified holder | "java.util.Map.Entry" |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
71 * 'h' | Unqualified holder | "Entry" |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
72 * 'n' | Field name | "age" |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
73 * 'f' | Indicator if field is unresolved, static or instance | "unresolved" "static" "instance" |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
74 * '%' | A '%' character | "%" |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
75 * </pre> |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
76 * |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
77 * @param format a format specification |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
78 * @return the result of formatting this field according to {@code format} |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
79 * @throws IllegalFormatException if an illegal specifier is encountered in {@code format} |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
80 */ |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
81 default String format(String format) throws IllegalFormatException { |
18163
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
16481
diff
changeset
|
82 StringBuilder sb = new StringBuilder(); |
16481
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
83 int index = 0; |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
84 JavaType type = getType(); |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
85 while (index < format.length()) { |
18163
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
16481
diff
changeset
|
86 char ch = format.charAt(index++); |
16481
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
87 if (ch == '%') { |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
88 if (index >= format.length()) { |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
89 throw new UnknownFormatConversionException("An unquoted '%' character cannot terminate a field format specification"); |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
90 } |
18163
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
16481
diff
changeset
|
91 char specifier = format.charAt(index++); |
16481
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
92 switch (specifier) { |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
93 case 'T': |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
94 case 't': { |
22505
575eb1036ea9
fixed all existing -Xlint warnings
Doug Simon <doug.simon@oracle.com>
parents:
22054
diff
changeset
|
95 sb.append(type.toJavaName(specifier == 'T')); |
16481
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
96 break; |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
97 } |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
98 case 'H': |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
99 case 'h': { |
22505
575eb1036ea9
fixed all existing -Xlint warnings
Doug Simon <doug.simon@oracle.com>
parents:
22054
diff
changeset
|
100 sb.append(getDeclaringClass().toJavaName(specifier == 'H')); |
16481
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
101 break; |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
102 } |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
103 case 'n': { |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
104 sb.append(getName()); |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
105 break; |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
106 } |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
107 case 'f': { |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
108 sb.append(!(this instanceof ResolvedJavaField) ? "unresolved" : ((ResolvedJavaField) this).isStatic() ? "static" : "instance"); |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
109 break; |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
110 } |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
111 case '%': { |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
112 sb.append('%'); |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
113 break; |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
114 } |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
115 default: { |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
116 throw new UnknownFormatConversionException(String.valueOf(specifier)); |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
117 } |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
118 } |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
119 } else { |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
120 sb.append(ch); |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
121 } |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
122 } |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
123 return sb.toString(); |
e7fc65330742
moved format(String format, JavaField field) from MetaUtil to be a default method in JavaField
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
124 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
125 } |