KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > eval > CodeSnippetConstantPool


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.eval;
12
13 import org.eclipse.jdt.core.compiler.CharOperation;
14 import org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
15 import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
16 import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
17 import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
18 import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
19 import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
20
21 /**
22  * This constant pool is used to manage well known methods and fields related specifically to the
23  * code snippet code generation (java.lang.reflect classes).
24  */

25 public class CodeSnippetConstantPool extends ConstantPool implements TypeConstants {
26
27     // predefined type constant names
28
static final char[][] JAVA_LANG_REFLECT_FIELD = new char[][] {JAVA, LANG, REFLECT, "Field".toCharArray()}; //$NON-NLS-1$
29
static final char[][] JAVA_LANG_REFLECT_ACCESSIBLEOBJECT = new char[][] {JAVA, LANG, REFLECT, "AccessibleObject".toCharArray()}; //$NON-NLS-1$
30
static final char[][] JAVA_LANG_REFLECT_METHOD = new char[][] {JAVA, LANG, REFLECT, "Method".toCharArray()}; //$NON-NLS-1$
31
static final char[][] JAVA_LANG_REFLECT_ARRAY = new char[][] {JAVA, LANG, REFLECT, "Array".toCharArray()}; //$NON-NLS-1$
32

33     // predefined methods constant names
34
static final char[] GETDECLAREDFIELD_NAME = "getDeclaredField".toCharArray(); //$NON-NLS-1$
35
static final char[] GETDECLAREDFIELD_SIGNATURE = "(Ljava/lang/String;)Ljava/lang/reflect/Field;".toCharArray(); //$NON-NLS-1$
36
static final char[] SETACCESSIBLE_NAME = "setAccessible".toCharArray(); //$NON-NLS-1$
37
static final char[] SETACCESSIBLE_SIGNATURE = "(Z)V".toCharArray(); //$NON-NLS-1$
38
static final char[] JAVALANGREFLECTFIELD_CONSTANTPOOLNAME = "java/lang/reflect/Field".toCharArray(); //$NON-NLS-1$
39
static final char[] JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME = "java/lang/reflect/AccessibleObject".toCharArray(); //$NON-NLS-1$
40
static final char[] JAVALANGREFLECTARRAY_CONSTANTPOOLNAME = "java/lang/reflect/Array".toCharArray(); //$NON-NLS-1$
41
static final char[] JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME = "java/lang/reflect/Method".toCharArray(); //$NON-NLS-1$
42
static final char[] GET_INT_METHOD_NAME = "getInt".toCharArray(); //$NON-NLS-1$
43
static final char[] GET_LONG_METHOD_NAME = "getLong".toCharArray(); //$NON-NLS-1$
44
static final char[] GET_DOUBLE_METHOD_NAME = "getDouble".toCharArray(); //$NON-NLS-1$
45
static final char[] GET_FLOAT_METHOD_NAME = "getFloat".toCharArray(); //$NON-NLS-1$
46
static final char[] GET_BYTE_METHOD_NAME = "getByte".toCharArray(); //$NON-NLS-1$
47
static final char[] GET_CHAR_METHOD_NAME = "getChar".toCharArray(); //$NON-NLS-1$
48
static final char[] GET_BOOLEAN_METHOD_NAME = "getBoolean".toCharArray(); //$NON-NLS-1$
49
static final char[] GET_OBJECT_METHOD_NAME = "get".toCharArray(); //$NON-NLS-1$
50
static final char[] GET_SHORT_METHOD_NAME = "getShort".toCharArray(); //$NON-NLS-1$
51
static final char[] ARRAY_NEWINSTANCE_NAME = "newInstance".toCharArray(); //$NON-NLS-1$
52
static final char[] GET_INT_METHOD_SIGNATURE = "(Ljava/lang/Object;)I".toCharArray(); //$NON-NLS-1$
53
static final char[] GET_LONG_METHOD_SIGNATURE = "(Ljava/lang/Object;)J".toCharArray(); //$NON-NLS-1$
54
static final char[] GET_DOUBLE_METHOD_SIGNATURE = "(Ljava/lang/Object;)D".toCharArray(); //$NON-NLS-1$
55
static final char[] GET_FLOAT_METHOD_SIGNATURE = "(Ljava/lang/Object;)F".toCharArray(); //$NON-NLS-1$
56
static final char[] GET_BYTE_METHOD_SIGNATURE = "(Ljava/lang/Object;)B".toCharArray(); //$NON-NLS-1$
57
static final char[] GET_CHAR_METHOD_SIGNATURE = "(Ljava/lang/Object;)C".toCharArray(); //$NON-NLS-1$
58
static final char[] GET_BOOLEAN_METHOD_SIGNATURE = "(Ljava/lang/Object;)Z".toCharArray(); //$NON-NLS-1$
59
static final char[] GET_OBJECT_METHOD_SIGNATURE = "(Ljava/lang/Object;)Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$
60
static final char[] GET_SHORT_METHOD_SIGNATURE = "(Ljava/lang/Object;)S".toCharArray(); //$NON-NLS-1$
61
static final char[] SET_INT_METHOD_NAME = "setInt".toCharArray(); //$NON-NLS-1$
62
static final char[] SET_LONG_METHOD_NAME = "setLong".toCharArray(); //$NON-NLS-1$
63
static final char[] SET_DOUBLE_METHOD_NAME = "setDouble".toCharArray(); //$NON-NLS-1$
64
static final char[] SET_FLOAT_METHOD_NAME = "setFloat".toCharArray(); //$NON-NLS-1$
65
static final char[] SET_BYTE_METHOD_NAME = "setByte".toCharArray(); //$NON-NLS-1$
66
static final char[] SET_CHAR_METHOD_NAME = "setChar".toCharArray(); //$NON-NLS-1$
67
static final char[] SET_BOOLEAN_METHOD_NAME = "setBoolean".toCharArray(); //$NON-NLS-1$
68
static final char[] SET_OBJECT_METHOD_NAME = "set".toCharArray(); //$NON-NLS-1$
69
static final char[] SET_SHORT_METHOD_NAME = "setShort".toCharArray(); //$NON-NLS-1$
70
static final char[] SET_INT_METHOD_SIGNATURE = "(Ljava/lang/Object;I)V".toCharArray(); //$NON-NLS-1$
71
static final char[] SET_LONG_METHOD_SIGNATURE = "(Ljava/lang/Object;J)V".toCharArray(); //$NON-NLS-1$
72
static final char[] SET_DOUBLE_METHOD_SIGNATURE = "(Ljava/lang/Object;D)V".toCharArray(); //$NON-NLS-1$
73
static final char[] SET_FLOAT_METHOD_SIGNATURE = "(Ljava/lang/Object;F)V".toCharArray(); //$NON-NLS-1$
74
static final char[] SET_BYTE_METHOD_SIGNATURE = "(Ljava/lang/Object;B)V".toCharArray(); //$NON-NLS-1$
75
static final char[] SET_CHAR_METHOD_SIGNATURE = "(Ljava/lang/Object;C)V".toCharArray(); //$NON-NLS-1$
76
static final char[] SET_BOOLEAN_METHOD_SIGNATURE = "(Ljava/lang/Object;Z)V".toCharArray(); //$NON-NLS-1$
77
static final char[] SET_OBJECT_METHOD_SIGNATURE = "(Ljava/lang/Object;Ljava/lang/Object;)V".toCharArray(); //$NON-NLS-1$
78
static final char[] SET_SHORT_METHOD_SIGNATURE = "(Ljava/lang/Object;S)V".toCharArray(); //$NON-NLS-1$
79
static final char[] GETDECLAREDMETHOD_NAME = "getDeclaredMethod".toCharArray(); //$NON-NLS-1$
80
static final char[] GETDECLAREDMETHOD_SIGNATURE = "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;".toCharArray(); //$NON-NLS-1$
81
static final char[] ARRAY_NEWINSTANCE_SIGNATURE = "(Ljava/lang/Class;[I)Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$
82
static final char[] INVOKE_METHOD_METHOD_NAME = "invoke".toCharArray(); //$NON-NLS-1$
83
static final char[] INVOKE_METHOD_METHOD_SIGNATURE = "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$
84
static final char[] BYTEVALUE_BYTE_METHOD_NAME = "byteValue".toCharArray(); //$NON-NLS-1$
85
static final char[] BYTEVALUE_BYTE_METHOD_SIGNATURE = "()B".toCharArray(); //$NON-NLS-1$
86
static final char[] SHORTVALUE_SHORT_METHOD_NAME = "shortValue".toCharArray(); //$NON-NLS-1$
87
static final char[] DOUBLEVALUE_DOUBLE_METHOD_NAME = "doubleValue".toCharArray(); //$NON-NLS-1$
88
static final char[] FLOATVALUE_FLOAT_METHOD_NAME = "floatValue".toCharArray(); //$NON-NLS-1$
89
static final char[] INTVALUE_INTEGER_METHOD_NAME = "intValue".toCharArray(); //$NON-NLS-1$
90
static final char[] CHARVALUE_CHARACTER_METHOD_NAME = "charValue".toCharArray(); //$NON-NLS-1$
91
static final char[] BOOLEANVALUE_BOOLEAN_METHOD_NAME = "booleanValue".toCharArray(); //$NON-NLS-1$
92
static final char[] LONGVALUE_LONG_METHOD_NAME = "longValue".toCharArray(); //$NON-NLS-1$
93
static final char[] SHORTVALUE_SHORT_METHOD_SIGNATURE = "()S".toCharArray(); //$NON-NLS-1$
94
static final char[] DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE = "()D".toCharArray(); //$NON-NLS-1$
95
static final char[] FLOATVALUE_FLOAT_METHOD_SIGNATURE = "()F".toCharArray(); //$NON-NLS-1$
96
static final char[] INTVALUE_INTEGER_METHOD_SIGNATURE = "()I".toCharArray(); //$NON-NLS-1$
97
static final char[] CHARVALUE_CHARACTER_METHOD_SIGNATURE = "()C".toCharArray(); //$NON-NLS-1$
98
static final char[] BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE = "()Z".toCharArray(); //$NON-NLS-1$
99
static final char[] LONGVALUE_LONG_METHOD_SIGNATURE = "()J".toCharArray(); //$NON-NLS-1$
100
static final char[] GETDECLAREDCONSTRUCTOR_NAME = "getDeclaredConstructor".toCharArray(); //$NON-NLS-1$
101
static final char[] GETDECLAREDCONSTRUCTOR_SIGNATURE = "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;".toCharArray(); //$NON-NLS-1$
102

103     // predefined constant index for well known types
104
static final int JAVA_LANG_REFLECT_FIELD_TYPE = 0;
105     static final int JAVA_LANG_REFLECT_METHOD_TYPE = 1;
106     static final int JAVA_LANG_REFLECT_ACCESSIBLEOBJECT_TYPE = 2;
107     static final int JAVA_LANG_REFLECT_ARRAY_TYPE = 3;
108
109     // predefined constant index for well known methods
110
static final int GETDECLAREDFIELD_CLASS_METHOD = 0;
111     static final int SETACCESSIBLE_ACCESSIBLEOBJECT_METHOD = 1;
112     static final int GET_INT_METHOD = 2;
113     static final int GET_LONG_METHOD = 3;
114     static final int GET_DOUBLE_METHOD = 4;
115     static final int GET_FLOAT_METHOD = 5;
116     static final int GET_BYTE_METHOD = 6;
117     static final int GET_CHAR_METHOD = 7;
118     static final int GET_BOOLEAN_METHOD = 8;
119     static final int GET_OBJECT_METHOD = 9;
120     static final int GET_SHORT_METHOD = 10;
121     static final int SET_INT_METHOD = 11;
122     static final int SET_LONG_METHOD = 12;
123     static final int SET_DOUBLE_METHOD = 13;
124     static final int SET_FLOAT_METHOD = 14;
125     static final int SET_BYTE_METHOD = 15;
126     static final int SET_CHAR_METHOD = 16;
127     static final int SET_BOOLEAN_METHOD = 17;
128     static final int SET_OBJECT_METHOD = 18;
129     static final int SET_SHORT_METHOD = 19;
130     static final int GETDECLAREDMETHOD_CLASS_METHOD = 20;
131     static final int NEWINSTANCE_ARRAY_METHOD = 21;
132     static final int INVOKE_METHOD_METHOD = 22;
133     static final int BYTEVALUE_BYTE_METHOD = 23;
134     static final int SHORTVALUE_SHORT_METHOD = 24;
135     static final int DOUBLEVALUE_DOUBLE_METHOD = 25;
136     static final int FLOATVALUE_FLOAT_METHOD = 26;
137     static final int INTVALUE_INTEGER_METHOD = 27;
138     static final int CHARVALUE_CHARACTER_METHOD = 28;
139     static final int BOOLEANVALUE_BOOLEAN_METHOD = 29;
140     static final int LONGVALUE_LONG_METHOD = 30;
141     static final int GETDECLAREDCONSTRUCTOR_CLASS_METHOD = 31;
142     
143     // predefined constant index for well known name and type for methods
144
static final int GETDECLAREDFIELD_CLASS_METHOD_NAME_AND_TYPE = 0;
145     static final int SETACCESSIBLE_ACCESSIBLEOBJECT_METHOD_NAME_AND_TYPE = 1;
146     static final int GET_INT_METHOD_NAME_AND_TYPE = 2;
147     static final int GET_LONG_METHOD_NAME_AND_TYPE = 3;
148     static final int GET_DOUBLE_METHOD_NAME_AND_TYPE = 4;
149     static final int GET_FLOAT_METHOD_NAME_AND_TYPE = 5;
150     static final int GET_BYTE_METHOD_NAME_AND_TYPE = 6;
151     static final int GET_CHAR_METHOD_NAME_AND_TYPE = 7;
152     static final int GET_BOOLEAN_METHOD_NAME_AND_TYPE = 8;
153     static final int GET_OBJECT_METHOD_NAME_AND_TYPE = 9;
154     static final int GET_SHORT_METHOD_NAME_AND_TYPE = 10;
155     static final int SET_INT_METHOD_NAME_AND_TYPE = 11;
156     static final int SET_LONG_METHOD_NAME_AND_TYPE = 12;
157     static final int SET_DOUBLE_METHOD_NAME_AND_TYPE = 13;
158     static final int SET_FLOAT_METHOD_NAME_AND_TYPE = 14;
159     static final int SET_BYTE_METHOD_NAME_AND_TYPE = 15;
160     static final int SET_CHAR_METHOD_NAME_AND_TYPE = 16;
161     static final int SET_BOOLEAN_METHOD_NAME_AND_TYPE = 17;
162     static final int SET_OBJECT_METHOD_NAME_AND_TYPE = 18;
163     static final int SET_SHORT_METHOD_NAME_AND_TYPE = 19;
164     static final int GETDECLAREDMETHOD_CLASS_METHOD_NAME_AND_TYPE = 20;
165     static final int ARRAY_NEWINSTANCE_METHOD_NAME_AND_TYPE = 21;
166     static final int INVOKE_METHOD_METHOD_NAME_AND_TYPE = 22;
167     static final int BYTEVALUE_BYTE_METHOD_NAME_AND_TYPE = 23;
168     static final int SHORTVALUE_SHORT_METHOD_NAME_AND_TYPE = 24;
169     static final int DOUBLEVALUE_DOUBLE_METHOD_NAME_AND_TYPE = 25;
170     static final int FLOATVALUE_FLOAT_METHOD_NAME_AND_TYPE = 26;
171     static final int INTVALUE_INTEGER_METHOD_NAME_AND_TYPE = 27;
172     static final int CHARVALUE_CHARACTER_METHOD_NAME_AND_TYPE = 28;
173     static final int BOOLEANVALUE_BOOLEAN_METHOD_NAME_AND_TYPE = 29;
174     static final int LONGVALUE_LONG_METHOD_NAME_AND_TYPE = 30;
175     static final int GETDECLAREDCONSTRUCTOR_CLASS_METHOD_NAME_AND_TYPE = 31;
176     
177     int[] wellKnownTypes = new int[4];
178     int[] wellKnownMethods = new int[32];
179     int[] wellKnownMethodNameAndTypes = new int[32];
180 /**
181  * CodeSnippetConstantPool constructor comment.
182  * @param classFile org.eclipse.jdt.internal.compiler.ClassFile
183  */

184 public CodeSnippetConstantPool(org.eclipse.jdt.internal.compiler.ClassFile classFile) {
185     super(classFile);
186 }
187 /**
188  * Return the index of the @methodBinding.
189  *
190  * Returns -1 if the @methodBinding is not a predefined methodBinding,
191  * the right index otherwise.
192  *
193  * @param methodBinding org.eclipse.jdt.internal.compiler.lookup.MethodBinding
194  * @return <CODE>int</CODE>
195  */

196 public int indexOfWellKnownMethodNameAndType(MethodBinding methodBinding) {
197     int index = super.indexOfWellKnownMethodNameAndType(methodBinding);
198     if (index == -1) {
199         char firstChar = methodBinding.selector[0];
200         switch(firstChar) {
201             case 'g':
202                 if (methodBinding.parameters.length == 1
203                     && methodBinding.parameters[0].id == T_JavaLangString
204                     && CharOperation.equals(methodBinding.selector, GETDECLAREDFIELD_NAME)
205                     && methodBinding.returnType instanceof ReferenceBinding
206                     && CharOperation.equals(((ReferenceBinding) methodBinding.returnType).compoundName,JAVA_LANG_REFLECT_FIELD)) {
207                         return GETDECLAREDFIELD_CLASS_METHOD_NAME_AND_TYPE;
208                 }
209                 if (methodBinding.parameters.length == 2
210                     && methodBinding.parameters[0].id == T_JavaLangString
211                     && methodBinding.parameters[1].isArrayType()
212                     && ((ArrayBinding) methodBinding.parameters[1]).leafComponentType.id == T_JavaLangClass
213                     && CharOperation.equals(methodBinding.selector, GETDECLAREDMETHOD_NAME)
214                     && methodBinding.returnType instanceof ReferenceBinding
215                     && CharOperation.equals(((ReferenceBinding) methodBinding.returnType).compoundName,JAVA_LANG_REFLECT_METHOD)) {
216                         return GETDECLAREDMETHOD_CLASS_METHOD_NAME_AND_TYPE;
217                 }
218                 if (methodBinding.parameters.length == 1
219                     && methodBinding.parameters[0].isArrayType()
220                     && ((ArrayBinding) methodBinding.parameters[0]).leafComponentType.id == T_JavaLangClass
221                     && CharOperation.equals(methodBinding.selector, GETDECLAREDCONSTRUCTOR_NAME)
222                     && methodBinding.returnType instanceof ReferenceBinding
223                     && CharOperation.equals(((ReferenceBinding) methodBinding.returnType).compoundName,JAVA_LANG_REFLECT_CONSTRUCTOR)) {
224                         return GETDECLAREDCONSTRUCTOR_CLASS_METHOD_NAME_AND_TYPE;
225                 }
226                 if (methodBinding.parameters.length == 1
227                     && methodBinding.parameters[0].id == T_Object) {
228                         switch(methodBinding.returnType.id) {
229                             case T_int :
230                                 if (CharOperation.equals(methodBinding.selector, GET_INT_METHOD_NAME)
231                                     && methodBinding.returnType.id == T_int) {
232                                     return GET_INT_METHOD_NAME_AND_TYPE;
233                                 }
234                                 break;
235                             case T_byte :
236                                 if (CharOperation.equals(methodBinding.selector, GET_BYTE_METHOD_NAME)
237                                     && methodBinding.returnType.id == T_byte) {
238                                     return GET_BYTE_METHOD_NAME_AND_TYPE;
239                                 }
240                                 break;
241                             case T_short :
242                                 if (CharOperation.equals(methodBinding.selector, GET_SHORT_METHOD_NAME)
243                                     && methodBinding.returnType.id == T_short) {
244                                     return GET_SHORT_METHOD_NAME_AND_TYPE;
245                                 }
246                                 break;
247                             case T_char :
248                                 if (CharOperation.equals(methodBinding.selector, GET_CHAR_METHOD_NAME)
249                                     && methodBinding.returnType.id == T_char) {
250                                     return GET_CHAR_METHOD_NAME_AND_TYPE;
251                                 }
252                                 break;
253                             case T_double :
254                                 if (CharOperation.equals(methodBinding.selector, GET_DOUBLE_METHOD_NAME)
255                                     && methodBinding.returnType.id == T_double) {
256                                     return GET_DOUBLE_METHOD_NAME_AND_TYPE;
257                                 }
258                                 break;
259                             case T_float :
260                                 if (CharOperation.equals(methodBinding.selector, GET_FLOAT_METHOD_NAME)
261                                     && methodBinding.returnType.id == T_float) {
262                                     return GET_FLOAT_METHOD_NAME_AND_TYPE;
263                                 }
264                                 break;
265                             case T_long :
266                                 if (CharOperation.equals(methodBinding.selector, GET_LONG_METHOD_NAME)
267                                     && methodBinding.returnType.id == T_long) {
268                                     return GET_LONG_METHOD_NAME_AND_TYPE;
269                                 }
270                                 break;
271                             case T_boolean :
272                                 if (CharOperation.equals(methodBinding.selector, GET_BOOLEAN_METHOD_NAME)
273                                     && methodBinding.returnType.id == T_boolean) {
274                                     return GET_BOOLEAN_METHOD_NAME_AND_TYPE;
275                                 }
276                                 break;
277                             case T_Object :
278                                 if (CharOperation.equals(methodBinding.selector, GET_OBJECT_METHOD_NAME)
279                                     && methodBinding.returnType.id == T_JavaLangObject) {
280                                     return GET_OBJECT_METHOD_NAME_AND_TYPE;
281                                 }
282                         }
283                 }
284                 break;
285             case 'i':
286                 if (methodBinding.parameters.length == 0
287                     && CharOperation.equals(methodBinding.selector, INTVALUE_INTEGER_METHOD_NAME)
288                     && methodBinding.returnType.id == T_int) {
289                         return INTVALUE_INTEGER_METHOD_NAME_AND_TYPE;
290                 }
291                 if (methodBinding.parameters.length == 2
292                     && methodBinding.parameters[0].id == T_JavaLangObject
293                     && methodBinding.parameters[1].isArrayType()
294                     && ((ArrayBinding) methodBinding.parameters[1]).leafComponentType.id == T_JavaLangObject
295                     && CharOperation.equals(methodBinding.selector, INVOKE_METHOD_METHOD_NAME)
296                     && methodBinding.returnType.id == T_JavaLangObject) {
297                         return INVOKE_METHOD_METHOD_NAME_AND_TYPE;
298                 }
299                 break;
300             case 's':
301                 if (methodBinding.parameters.length == 0
302                     && CharOperation.equals(methodBinding.selector, SHORTVALUE_SHORT_METHOD_NAME)
303                     && methodBinding.returnType.id == T_short) {
304                         return SHORTVALUE_SHORT_METHOD_NAME_AND_TYPE;
305                 }
306                 if (methodBinding.parameters.length == 1
307                     && methodBinding.parameters[0].id == T_boolean
308                     && methodBinding.selector.length == 13
309                     && CharOperation.equals(methodBinding.selector, SETACCESSIBLE_NAME)
310                     && methodBinding.returnType.id == T_void) {
311                         return SETACCESSIBLE_ACCESSIBLEOBJECT_METHOD_NAME_AND_TYPE;
312                 }
313                 if (methodBinding.returnType.id == T_void
314                     && methodBinding.parameters.length == 2
315                     && methodBinding.parameters[0].id == T_Object) {
316                         switch(methodBinding.returnType.id) {
317                             case T_int :
318                                 if (methodBinding.parameters[1].id == T_int && CharOperation.equals(methodBinding.selector, SET_INT_METHOD_NAME)
319                                     && methodBinding.returnType.id == T_void) {
320                                     return SET_INT_METHOD_NAME_AND_TYPE;
321                                 }
322                                 break;
323                             case T_byte :
324                                 if (methodBinding.parameters[1].id == T_byte && CharOperation.equals(methodBinding.selector, SET_BYTE_METHOD_NAME)
325                                     && methodBinding.returnType.id == T_void) {
326                                     return SET_BYTE_METHOD_NAME_AND_TYPE;
327                                 }
328                                 break;
329                             case T_short :
330                                 if (methodBinding.parameters[1].id == T_short && CharOperation.equals(methodBinding.selector, SET_SHORT_METHOD_NAME)
331                                     && methodBinding.returnType.id == T_void) {
332                                     return SET_SHORT_METHOD_NAME_AND_TYPE;
333                                 }
334                                 break;
335                             case T_char :
336                                 if (methodBinding.parameters[1].id == T_char && CharOperation.equals(methodBinding.selector, SET_CHAR_METHOD_NAME)
337                                     && methodBinding.returnType.id == T_void) {
338                                     return SET_CHAR_METHOD_NAME_AND_TYPE;
339                                 }
340                                 break;
341                             case T_double :
342                                 if (methodBinding.parameters[1].id == T_double && CharOperation.equals(methodBinding.selector, SET_DOUBLE_METHOD_NAME)
343                                     && methodBinding.returnType.id == T_void) {
344                                     return SET_DOUBLE_METHOD_NAME_AND_TYPE;
345                                 }
346                                 break;
347                             case T_float :
348                                 if (methodBinding.parameters[1].id == T_float && CharOperation.equals(methodBinding.selector, SET_FLOAT_METHOD_NAME)
349                                     && methodBinding.returnType.id == T_void) {
350                                     return SET_FLOAT_METHOD_NAME_AND_TYPE;
351                                 }
352                                 break;
353                             case T_long :
354                                 if (methodBinding.parameters[1].id == T_long && CharOperation.equals(methodBinding.selector, SET_LONG_METHOD_NAME)
355                                     && methodBinding.returnType.id == T_void) {
356                                     return SET_LONG_METHOD_NAME_AND_TYPE;
357                                 }
358                                 break;
359                             case T_boolean :
360                                 if (methodBinding.parameters[1].id == T_boolean && CharOperation.equals(methodBinding.selector, SET_BOOLEAN_METHOD_NAME)
361                                     && methodBinding.returnType.id == T_void) {
362                                     return SET_BOOLEAN_METHOD_NAME_AND_TYPE;
363                                 }
364                                 break;
365                             case T_Object :
366                                 if (methodBinding.parameters[1].id == T_Object && CharOperation.equals(methodBinding.selector, SET_OBJECT_METHOD_NAME)
367                                     && methodBinding.returnType.id == T_void) {
368                                     return SET_OBJECT_METHOD_NAME_AND_TYPE;
369                                 }
370                         }
371                 }
372                 break;
373             case 'f':
374                 if (methodBinding.parameters.length == 0
375                     && CharOperation.equals(methodBinding.selector, FLOATVALUE_FLOAT_METHOD_NAME)
376                     && methodBinding.returnType.id == T_float) {
377                         return FLOATVALUE_FLOAT_METHOD_NAME_AND_TYPE;
378                 }
379                 break;
380             case 'd':
381                 if (methodBinding.parameters.length == 0
382                     && CharOperation.equals(methodBinding.selector, DOUBLEVALUE_DOUBLE_METHOD_NAME)
383                     && methodBinding.returnType.id == T_double) {
384                         return DOUBLEVALUE_DOUBLE_METHOD_NAME_AND_TYPE;
385                 }
386                 break;
387             case 'c':
388                 if (methodBinding.parameters.length == 0
389                     && CharOperation.equals(methodBinding.selector, CHARVALUE_CHARACTER_METHOD_NAME)
390                     && methodBinding.returnType.id == T_char) {
391                         return CHARVALUE_CHARACTER_METHOD_NAME_AND_TYPE;
392                 }
393                 break;
394             case 'b':
395                 if (methodBinding.parameters.length == 0
396                     && CharOperation.equals(methodBinding.selector, BOOLEANVALUE_BOOLEAN_METHOD_NAME)
397                     && methodBinding.returnType.id == T_boolean) {
398                         return BOOLEANVALUE_BOOLEAN_METHOD_NAME_AND_TYPE;
399                 }
400                 if (methodBinding.parameters.length == 0
401                     && CharOperation.equals(methodBinding.selector, BYTEVALUE_BYTE_METHOD_NAME)
402                     && methodBinding.returnType.id == T_byte) {
403                         return BYTEVALUE_BYTE_METHOD_NAME_AND_TYPE;
404                 }
405                 break;
406             case 'l':
407                 if (methodBinding.parameters.length == 0
408                     && CharOperation.equals(methodBinding.selector, LONGVALUE_LONG_METHOD_NAME)
409                     && methodBinding.returnType.id == T_long) {
410                         return LONGVALUE_LONG_METHOD_NAME_AND_TYPE;
411                 }
412                 break;
413             case 'n':
414                 if (methodBinding.parameters.length == 2
415                     && methodBinding.parameters[0].id == T_JavaLangClass
416                     && methodBinding.parameters[1].isArrayType()
417                     && ((ArrayBinding) methodBinding.parameters[1]).leafComponentType.id == T_int
418                     && CharOperation.equals(methodBinding.selector, ARRAY_NEWINSTANCE_NAME)
419                     && methodBinding.returnType instanceof ReferenceBinding
420                     && CharOperation.equals(((ReferenceBinding) methodBinding.returnType).compoundName,JAVA_LANG_REFLECT_ARRAY)) {
421                         return ARRAY_NEWINSTANCE_METHOD_NAME_AND_TYPE;
422                 }
423         }
424
425     }
426     return index;
427 }
428 /**
429  * Return the index of the @methodBinding.
430  *
431  * Returns -1 if the @methodBinding is not a predefined methodBinding,
432  * the right index otherwise.
433  *
434  * @param methodBinding org.eclipse.jdt.internal.compiler.lookup.MethodBinding
435  * @return <CODE>int</CODE>
436  */

437 public int indexOfWellKnownMethods(MethodBinding methodBinding) {
438     int index = super.indexOfWellKnownMethods(methodBinding);
439     if (index == -1) {
440         char firstChar = methodBinding.selector[0];
441         switch(firstChar) {
442             case 'g':
443                 if (methodBinding.declaringClass.id == T_JavaLangClass
444                     && methodBinding.parameters.length == 1
445                     && methodBinding.parameters[0].id == T_JavaLangString
446                     && CharOperation.equals(methodBinding.selector, GETDECLAREDFIELD_NAME)) {
447                         return GETDECLAREDFIELD_CLASS_METHOD;
448                 }
449                 if (methodBinding.declaringClass.id == T_JavaLangClass
450                     && methodBinding.parameters.length == 2
451                     && methodBinding.parameters[0].id == T_JavaLangString
452                     && methodBinding.parameters[1].isArrayType()
453                     && ((ArrayBinding) methodBinding.parameters[1]).leafComponentType.id == T_JavaLangClass
454                     && CharOperation.equals(methodBinding.selector, GETDECLAREDMETHOD_NAME)) {
455                         return GETDECLAREDMETHOD_CLASS_METHOD;
456                 }
457                 if (methodBinding.declaringClass.id == T_JavaLangClass
458                     && methodBinding.parameters.length == 1
459                     && methodBinding.parameters[0].isArrayType()
460                     && ((ArrayBinding) methodBinding.parameters[0]).leafComponentType.id == T_JavaLangClass
461                     && CharOperation.equals(methodBinding.selector, GETDECLAREDCONSTRUCTOR_NAME)) {
462                         return GETDECLAREDCONSTRUCTOR_CLASS_METHOD;
463                 }
464                 if (CharOperation.equals(methodBinding.declaringClass.compoundName, JAVA_LANG_REFLECT_FIELD)
465                     && methodBinding.parameters.length == 1
466                     && methodBinding.parameters[0].id == T_Object) {
467                         switch(methodBinding.returnType.id) {
468                             case T_int :
469                                 if (CharOperation.equals(methodBinding.selector, GET_INT_METHOD_NAME)) {
470                                     return GET_INT_METHOD;
471                                 }
472                                 break;
473                             case T_byte :
474                                 if (CharOperation.equals(methodBinding.selector, GET_BYTE_METHOD_NAME)) {
475                                     return GET_BYTE_METHOD;
476                                 }
477                                 break;
478                             case T_short :
479                                 if (CharOperation.equals(methodBinding.selector, GET_SHORT_METHOD_NAME)) {
480                                     return GET_SHORT_METHOD;
481                                 }
482                                 break;
483                             case T_char :
484                                 if (CharOperation.equals(methodBinding.selector, GET_CHAR_METHOD_NAME)) {
485                                     return GET_CHAR_METHOD;
486                                 }
487                                 break;
488                             case T_double :
489                                 if (CharOperation.equals(methodBinding.selector, GET_DOUBLE_METHOD_NAME)) {
490                                     return GET_DOUBLE_METHOD;
491                                 }
492                                 break;
493                             case T_float :
494                                 if (CharOperation.equals(methodBinding.selector, GET_FLOAT_METHOD_NAME)) {
495                                     return GET_FLOAT_METHOD;
496                                 }
497                                 break;
498                             case T_long :
499                                 if (CharOperation.equals(methodBinding.selector, GET_LONG_METHOD_NAME)) {
500                                     return GET_LONG_METHOD;
501                                 }
502                                 break;
503                             case T_boolean :
504                                 if (CharOperation.equals(methodBinding.selector, GET_BOOLEAN_METHOD_NAME)) {
505                                     return GET_BOOLEAN_METHOD;
506                                 }
507                                 break;
508                             case T_Object :
509                                 if (CharOperation.equals(methodBinding.selector, GET_OBJECT_METHOD_NAME)) {
510                                     return GET_OBJECT_METHOD;
511                                 }
512                         }
513                 }
514                 break;
515             case 'i':
516                 if (methodBinding.declaringClass.id == T_JavaLangInteger
517                     && methodBinding.parameters.length == 0
518                     && CharOperation.equals(methodBinding.selector, INTVALUE_INTEGER_METHOD_NAME)) {
519                         return INTVALUE_INTEGER_METHOD;
520                 }
521                 if (CharOperation.equals(methodBinding.declaringClass.compoundName, JAVA_LANG_REFLECT_METHOD)
522                     && methodBinding.parameters.length == 2
523                     && methodBinding.parameters[0].id == T_JavaLangObject
524                     && methodBinding.parameters[1].isArrayType()
525                     && ((ArrayBinding) methodBinding.parameters[1]).leafComponentType.id == T_JavaLangObject
526                     && CharOperation.equals(methodBinding.selector, INVOKE_METHOD_METHOD_NAME)) {
527                         return INVOKE_METHOD_METHOD;
528                 }
529                 break;
530             case 'b':
531                 if (methodBinding.declaringClass.id == T_JavaLangByte
532                     && methodBinding.parameters.length == 0
533                     && CharOperation.equals(methodBinding.selector, BYTEVALUE_BYTE_METHOD_NAME)) {
534                         return BYTEVALUE_BYTE_METHOD;
535                 }
536                 if (methodBinding.declaringClass.id == T_JavaLangBoolean
537                     && methodBinding.parameters.length == 0
538                     && CharOperation.equals(methodBinding.selector, BOOLEANVALUE_BOOLEAN_METHOD_NAME)) {
539                         return BOOLEANVALUE_BOOLEAN_METHOD;
540                 }
541                 break;
542             case 's':
543                 if (methodBinding.declaringClass.id == T_JavaLangShort
544                     && methodBinding.parameters.length == 0
545                     && CharOperation.equals(methodBinding.selector, SHORTVALUE_SHORT_METHOD_NAME)) {
546                         return SHORTVALUE_SHORT_METHOD;
547                 }
548                 if (CharOperation.equals(methodBinding.declaringClass.compoundName, JAVA_LANG_REFLECT_ACCESSIBLEOBJECT)
549                     && methodBinding.parameters.length == 1
550                     && methodBinding.parameters[0].id == T_boolean
551                     && methodBinding.selector.length == 13
552                     && CharOperation.equals(methodBinding.selector, SETACCESSIBLE_NAME)) {
553                         return SETACCESSIBLE_ACCESSIBLEOBJECT_METHOD;
554                 }
555                 if (CharOperation.equals(methodBinding.declaringClass.compoundName, JAVA_LANG_REFLECT_FIELD)
556                     && methodBinding.returnType.id == T_void
557                     && methodBinding.parameters.length == 2
558                     && methodBinding.parameters[0].id == T_Object) {
559                         switch(methodBinding.returnType.id) {
560                             case T_int :
561                                 if (methodBinding.parameters[1].id == T_int && CharOperation.equals(methodBinding.selector, SET_INT_METHOD_NAME)) {
562                                     return SET_INT_METHOD;
563                                 }
564                                 break;
565                             case T_byte :
566                                 if (methodBinding.parameters[1].id == T_byte && CharOperation.equals(methodBinding.selector, SET_BYTE_METHOD_NAME)) {
567                                     return SET_BYTE_METHOD;
568                                 }
569                                 break;
570                             case T_short :
571                                 if (methodBinding.parameters[1].id == T_short && CharOperation.equals(methodBinding.selector, SET_SHORT_METHOD_NAME)) {
572                                     return SET_SHORT_METHOD;
573                                 }
574                                 break;
575                             case T_char :
576                                 if (methodBinding.parameters[1].id == T_char && CharOperation.equals(methodBinding.selector, SET_CHAR_METHOD_NAME)) {
577                                     return SET_CHAR_METHOD;
578                                 }
579                                 break;
580                             case T_double :
581                                 if (methodBinding.parameters[1].id == T_double && CharOperation.equals(methodBinding.selector, SET_DOUBLE_METHOD_NAME)) {
582                                     return SET_DOUBLE_METHOD;
583                                 }
584                                 break;
585                             case T_float :
586                                 if (methodBinding.parameters[1].id == T_float && CharOperation.equals(methodBinding.selector, SET_FLOAT_METHOD_NAME)) {
587                                     return SET_FLOAT_METHOD;
588                                 }
589                                 break;
590                             case T_long :
591                                 if (methodBinding.parameters[1].id == T_long && CharOperation.equals(methodBinding.selector, SET_LONG_METHOD_NAME)) {
592                                     return SET_LONG_METHOD;
593                                 }
594                                 break;
595                             case T_boolean :
596                                 if (methodBinding.parameters[1].id == T_boolean && CharOperation.equals(methodBinding.selector, SET_BOOLEAN_METHOD_NAME)) {
597                                     return SET_BOOLEAN_METHOD;
598                                 }
599                                 break;
600                             case T_Object :
601                                 if (methodBinding.parameters[1].id == T_Object && CharOperation.equals(methodBinding.selector, SET_OBJECT_METHOD_NAME)) {
602                                     return SET_OBJECT_METHOD;
603                                 }
604                         }
605                 }
606                 break;
607             case 'f':
608                 if (methodBinding.declaringClass.id == T_JavaLangFloat
609                     && methodBinding.parameters.length == 0
610                     && CharOperation.equals(methodBinding.selector, FLOATVALUE_FLOAT_METHOD_NAME)) {
611                         return FLOATVALUE_FLOAT_METHOD;
612                 }
613                 break;
614             case 'd':
615                 if (methodBinding.declaringClass.id == T_JavaLangDouble
616                     && methodBinding.parameters.length == 0
617                     && CharOperation.equals(methodBinding.selector, DOUBLEVALUE_DOUBLE_METHOD_NAME)) {
618                         return DOUBLEVALUE_DOUBLE_METHOD;
619                 }
620                 break;
621             case 'c':
622                 if (methodBinding.declaringClass.id == T_JavaLangCharacter
623                     && methodBinding.parameters.length == 0
624                     && CharOperation.equals(methodBinding.selector, CHARVALUE_CHARACTER_METHOD_NAME)) {
625                         return CHARVALUE_CHARACTER_METHOD;
626                 }
627                 break;
628             case 'l':
629                 if (methodBinding.declaringClass.id == T_JavaLangLong
630                     && methodBinding.parameters.length == 0
631                     && CharOperation.equals(methodBinding.selector, LONGVALUE_LONG_METHOD_NAME)) {
632                         return LONGVALUE_LONG_METHOD;
633                 }
634                 break;
635             case 'n':
636                 if (CharOperation.equals(methodBinding.declaringClass.compoundName, JAVA_LANG_REFLECT_ARRAY)
637                     && methodBinding.parameters.length == 2
638                     && methodBinding.parameters[0].id == T_JavaLangClass
639                     && methodBinding.parameters[1].isArrayType()
640                     && ((ArrayBinding) methodBinding.parameters[1]).leafComponentType.id == T_int
641                     && CharOperation.equals(methodBinding.selector, ARRAY_NEWINSTANCE_NAME)) {
642                         return NEWINSTANCE_ARRAY_METHOD;
643                 }
644                 break;
645         }
646     }
647     return index;
648 }
649 /**
650  * Return the index of the @typeBinding
651  *
652  * Returns -1 if the @typeBinding is not a predefined binding, the right index
653  * otherwise.
654  *
655  * @param typeBinding org.eclipse.jdt.internal.compiler.lookup.TypeBinding
656  * @return <CODE>int</CODE>
657  */

658 public int indexOfWellKnownTypes(TypeBinding typeBinding) {
659     int index = super.indexOfWellKnownTypes(typeBinding);
660     if (index == -1) {
661         if (!typeBinding.isBaseType() && !typeBinding.isArrayType()) {
662             ReferenceBinding type = (ReferenceBinding) typeBinding;
663             if (type.compoundName.length == 4) {
664                 if (CharOperation.equals(JAVA_LANG_REFLECT_FIELD, type.compoundName)) {
665                     return JAVA_LANG_REFLECT_FIELD_TYPE;
666                 }
667                 if (CharOperation.equals(JAVA_LANG_REFLECT_METHOD, type.compoundName)) {
668                     return JAVA_LANG_REFLECT_METHOD_TYPE;
669                 }
670                 if (CharOperation.equals(JAVA_LANG_REFLECT_ARRAY, type.compoundName)) {
671                     return JAVA_LANG_REFLECT_ARRAY_TYPE;
672                 }
673                 if (CharOperation.equals(JAVA_LANG_REFLECT_ACCESSIBLEOBJECT, type.compoundName)) {
674                     return JAVA_LANG_REFLECT_ACCESSIBLEOBJECT_TYPE;
675                 }
676             }
677         }
678     }
679     return index;
680 }
681 /**
682  * This method returns the index into the constantPool corresponding to the
683  * method descriptor. It can be either an interface method reference constant
684  * or a method reference constant.
685  *
686  * @param aMethodBinding MethodBinding
687  * @return <CODE>int</CODE>
688  */

689 public int literalIndex(MethodBinding aMethodBinding) {
690     int index;
691     int nameAndTypeIndex;
692     int classIndex;
693     int indexWellKnownMethod;
694     if ((indexWellKnownMethod = super.indexOfWellKnownMethods(aMethodBinding)) == -1) {
695         if ((indexWellKnownMethod = indexOfWellKnownMethods(aMethodBinding)) == -1) {
696             if (aMethodBinding.declaringClass.isInterface()) {
697                 // Lookinf into the interface method ref table
698
if ((index = this.interfaceMethodCache.get(aMethodBinding)) < 0) {
699                     classIndex = literalIndex(aMethodBinding.declaringClass);
700                     nameAndTypeIndex =
701                         literalIndexForMethods(
702                             literalIndex(aMethodBinding.constantPoolName()),
703                             literalIndex(aMethodBinding.signature()),
704                             aMethodBinding);
705                     index = this.interfaceMethodCache.put(aMethodBinding, this.currentIndex++);
706                     // Write the interface method ref constant into the constant pool
707
// First add the tag
708
writeU1(InterfaceMethodRefTag);
709                     // Then write the class index
710
writeU2(classIndex);
711                     // The write the nameAndType index
712
writeU2(nameAndTypeIndex);
713                 }
714             } else {
715                 // Lookinf into the method ref table
716
if ((index = this.methodCache.get(aMethodBinding)) < 0) {
717                     classIndex = literalIndex(aMethodBinding.declaringClass);
718                     nameAndTypeIndex =
719                         literalIndexForMethods(
720                             literalIndex(aMethodBinding.constantPoolName()),
721                             literalIndex(aMethodBinding.signature()),
722                             aMethodBinding);
723                     index = this.methodCache.put(aMethodBinding, this.currentIndex++);
724                     // Write the method ref constant into the constant pool
725
// First add the tag
726
writeU1(MethodRefTag);
727                     // Then write the class index
728
writeU2(classIndex);
729                     // The write the nameAndType index
730
writeU2(nameAndTypeIndex);
731                 }
732             }
733         } else {
734             // This is a well known method
735
if ((index = this.wellKnownMethods[indexWellKnownMethod]) == 0) {
736                 // this methods was not inserted yet
737
if (aMethodBinding.declaringClass.isInterface()) {
738                     // Lookinf into the interface method ref table
739
classIndex = literalIndex(aMethodBinding.declaringClass);
740                     nameAndTypeIndex =
741                         literalIndexForMethods(
742                             literalIndex(aMethodBinding.constantPoolName()),
743                             literalIndex(aMethodBinding.signature()),
744                             aMethodBinding);
745                     index = this.wellKnownMethods[indexWellKnownMethod] = this.currentIndex++;
746                     // Write the interface method ref constant into the constant pool
747
// First add the tag
748
writeU1(InterfaceMethodRefTag);
749                     // Then write the class index
750
writeU2(classIndex);
751                     // The write the nameAndType index
752
writeU2(nameAndTypeIndex);
753                 } else {
754                     // Lookinf into the method ref table
755
classIndex = literalIndex(aMethodBinding.declaringClass);
756                     nameAndTypeIndex =
757                         literalIndexForMethods(
758                             literalIndex(aMethodBinding.constantPoolName()),
759                             literalIndex(aMethodBinding.signature()),
760                             aMethodBinding);
761                     index = this.wellKnownMethods[indexWellKnownMethod] = this.currentIndex++;
762                     // Write the method ref constant into the constant pool
763
// First add the tag
764
writeU1(MethodRefTag);
765                     // Then write the class index
766
writeU2(classIndex);
767                     // The write the nameAndType index
768
writeU2(nameAndTypeIndex);
769                 }
770             }
771         }
772     } else {
773         index = super.literalIndex(aMethodBinding);
774     }
775     return index;
776 }
777 /**
778  * This method returns the index into the constantPool corresponding to the type descriptor.
779  *
780  * @param aTypeBinding TypeBinding
781  * @return <CODE>int</CODE>
782  */

783 public int literalIndex(TypeBinding aTypeBinding) {
784     int index;
785     int nameIndex;
786     int indexWellKnownType;
787     if ((indexWellKnownType = super.indexOfWellKnownTypes(aTypeBinding)) == -1) {
788         if ((indexWellKnownType = indexOfWellKnownTypes(aTypeBinding)) == -1) {
789             if ((index = this.classCache.get(aTypeBinding)) < 0) {
790                 // The entry doesn't exit yet
791
nameIndex = literalIndex(aTypeBinding.constantPoolName());
792                 index = this.classCache.put(aTypeBinding, this.currentIndex++);
793                 writeU1(ClassTag);
794                 // Then add the 8 bytes representing the long
795
writeU2(nameIndex);
796             }
797         } else {
798             if ((index = this.wellKnownTypes[indexWellKnownType]) == 0) {
799                 // Need to insert that binding
800
nameIndex = literalIndex(aTypeBinding.constantPoolName());
801                 index = this.wellKnownTypes[indexWellKnownType] = this.currentIndex++;
802                 writeU1(ClassTag);
803                 // Then add the 8 bytes representing the long
804
writeU2(nameIndex);
805             }
806         }
807     } else {
808         index = super.literalIndex(aTypeBinding);
809     }
810     return index;
811 }
812 /**
813  * This method returns the index into the constantPool corresponding to the
814  * method descriptor. It can be either an interface method reference constant
815  * or a method reference constant.
816  *
817  * @return <CODE>int</CODE>
818  */

819 public int literalIndexForJavaLangBooleanBooleanValue() {
820     int index;
821     int nameAndTypeIndex;
822     int classIndex;
823     // Looking into the method ref table
824
if ((index = this.wellKnownMethods[BOOLEANVALUE_BOOLEAN_METHOD]) == 0) {
825         classIndex = literalIndexForJavaLangBoolean();
826         if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[BOOLEANVALUE_BOOLEAN_METHOD_NAME_AND_TYPE]) == 0) {
827             int nameIndex = literalIndex(BOOLEANVALUE_BOOLEAN_METHOD_NAME);
828             int typeIndex = literalIndex(BOOLEANVALUE_BOOLEAN_METHOD_SIGNATURE);
829             nameAndTypeIndex = this.wellKnownMethodNameAndTypes[BOOLEANVALUE_BOOLEAN_METHOD_NAME_AND_TYPE] = this.currentIndex++;
830             writeU1(NameAndTypeTag);
831             writeU2(nameIndex);
832             writeU2(typeIndex);
833         }
834         index = this.wellKnownMethods[BOOLEANVALUE_BOOLEAN_METHOD_NAME_AND_TYPE] = this.currentIndex++;
835         // Write the method ref constant into the constant pool
836
// First add the tag
837
writeU1(MethodRefTag);
838         // Then write the class index
839
writeU2(classIndex);
840         // The write the nameAndType index
841
writeU2(nameAndTypeIndex);
842     }
843     return index;
844 }
845 /**
846  * This method returns the index into the constantPool corresponding to the
847  * method descriptor. It can be either an interface method reference constant
848  * or a method reference constant.
849  *
850  * @return <CODE>int</CODE>
851  */

852 public int literalIndexForJavaLangByteByteValue() {
853     int index;
854     int nameAndTypeIndex;
855     int classIndex;
856     // Looking into the method ref table
857
if ((index = this.wellKnownMethods[BYTEVALUE_BYTE_METHOD]) == 0) {
858         classIndex = literalIndexForJavaLangByte();
859         if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[BYTEVALUE_BYTE_METHOD_NAME_AND_TYPE]) == 0) {
860             int nameIndex = literalIndex(BYTEVALUE_BYTE_METHOD_NAME);
861             int typeIndex = literalIndex(BYTEVALUE_BYTE_METHOD_SIGNATURE);
862             nameAndTypeIndex = this.wellKnownMethodNameAndTypes[BYTEVALUE_BYTE_METHOD_NAME_AND_TYPE] = this.currentIndex++;
863             writeU1(NameAndTypeTag);
864             writeU2(nameIndex);
865             writeU2(typeIndex);
866         }
867         index = this.wellKnownMethods[BYTEVALUE_BYTE_METHOD] = this.currentIndex++;
868         // Write the method ref constant into the constant pool
869
// First add the tag
870
writeU1(MethodRefTag);
871         // Then write the class index
872
writeU2(classIndex);
873         // The write the nameAndType index
874
writeU2(nameAndTypeIndex);
875     }
876     return index;
877 }
878 /**
879  * This method returns the index into the constantPool corresponding to the
880  * method descriptor. It can be either an interface method reference constant
881  * or a method reference constant.
882  *
883  * @return <CODE>int</CODE>
884  */

885 public int literalIndexForJavaLangCharacterCharValue() {
886     int index;
887     int nameAndTypeIndex;
888     int classIndex;
889     // Looking into the method ref table
890
if ((index = this.wellKnownMethods[CHARVALUE_CHARACTER_METHOD]) == 0) {
891         classIndex = literalIndexForJavaLangCharacter();
892         if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[CHARVALUE_CHARACTER_METHOD_NAME_AND_TYPE]) == 0) {
893             int nameIndex = literalIndex(CHARVALUE_CHARACTER_METHOD_NAME);
894             int typeIndex = literalIndex(CHARVALUE_CHARACTER_METHOD_SIGNATURE);
895             nameAndTypeIndex = this.wellKnownMethodNameAndTypes[CHARVALUE_CHARACTER_METHOD_NAME_AND_TYPE] = this.currentIndex++;
896             writeU1(NameAndTypeTag);
897             writeU2(nameIndex);
898             writeU2(typeIndex);
899         }
900         index = this.wellKnownMethods[CHARVALUE_CHARACTER_METHOD] = this.currentIndex++;
901         // Write the method ref constant into the constant pool
902
// First add the tag
903
writeU1(MethodRefTag);
904         // Then write the class index
905
writeU2(classIndex);
906         // The write the nameAndType index
907
writeU2(nameAndTypeIndex);
908     }
909     return index;
910 }
911 /**
912  * This method returns the index into the constantPool corresponding to the
913  * method descriptor. It can be either an interface method reference constant
914  * or a method reference constant.
915  *
916  * @return <CODE>int</CODE>
917  */

918 public int literalIndexForJavaLangClassGetDeclaredConstructor() {
919     int index;
920     int nameAndTypeIndex;
921     int classIndex;
922     // Looking into the method ref table
923
if ((index = this.wellKnownMethods[GETDECLAREDCONSTRUCTOR_CLASS_METHOD]) == 0) {
924         classIndex = literalIndexForJavaLangClass();
925         if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[GETDECLAREDCONSTRUCTOR_CLASS_METHOD_NAME_AND_TYPE]) == 0) {
926             int nameIndex = literalIndex(GETDECLAREDCONSTRUCTOR_NAME);
927             int typeIndex = literalIndex(GETDECLAREDCONSTRUCTOR_SIGNATURE);
928             nameAndTypeIndex = this.wellKnownMethodNameAndTypes[GETDECLAREDCONSTRUCTOR_CLASS_METHOD_NAME_AND_TYPE] = this.currentIndex++;
929             writeU1(NameAndTypeTag);
930             writeU2(nameIndex);
931             writeU2(typeIndex);
932         }
933         index = this.wellKnownMethods[GETDECLAREDCONSTRUCTOR_CLASS_METHOD] = this.currentIndex++;
934         // Write the method ref constant into the constant pool
935
// First add the tag
936
writeU1(MethodRefTag);
937         // Then write the class index
938
writeU2(classIndex);
939         // The write the nameAndType index
940
writeU2(nameAndTypeIndex);
941     }
942     return index;
943 }
944 /**
945  * This method returns the index into the constantPool corresponding to the
946  * method descriptor. It can be either an interface method reference constant
947  * or a method reference constant.
948  *
949  * @return <CODE>int</CODE>
950  */

951 public int literalIndexForJavaLangClassGetDeclaredField() {
952     int index;
953     int nameAndTypeIndex;
954     int classIndex;
955     // Looking into the method ref table
956
if ((index = this.wellKnownMethods[GETDECLAREDFIELD_CLASS_METHOD]) == 0) {
957         classIndex = literalIndexForJavaLangClass();
958         if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[GETDECLAREDFIELD_CLASS_METHOD_NAME_AND_TYPE]) == 0) {
959             int nameIndex = literalIndex(GETDECLAREDFIELD_NAME);
960             int typeIndex = literalIndex(GETDECLAREDFIELD_SIGNATURE);
961             nameAndTypeIndex = this.wellKnownMethodNameAndTypes[GETDECLAREDFIELD_CLASS_METHOD_NAME_AND_TYPE] = this.currentIndex++;
962             writeU1(NameAndTypeTag);
963             writeU2(nameIndex);
964             writeU2(typeIndex);
965         }
966         index = this.wellKnownMethods[GETDECLAREDFIELD_CLASS_METHOD] = this.currentIndex++;
967         // Write the method ref constant into the constant pool
968
// First add the tag
969
writeU1(MethodRefTag);
970         // Then write the class index
971
writeU2(classIndex);
972         // The write the nameAndType index
973
writeU2(nameAndTypeIndex);
974     }
975     return index;
976 }
977 /**
978  * This method returns the index into the constantPool corresponding to the
979  * method descriptor. It can be either an interface method reference constant
980  * or a method reference constant.
981  *
982  * @return <CODE>int</CODE>
983  */

984 public int literalIndexForJavaLangClassGetDeclaredMethod() {
985     int index;
986     int nameAndTypeIndex;
987     int classIndex;
988     // Looking into the method ref table
989
if ((index = this.wellKnownMethods[GETDECLAREDMETHOD_CLASS_METHOD]) == 0) {
990         classIndex = literalIndexForJavaLangClass();
991         if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[GETDECLAREDMETHOD_CLASS_METHOD_NAME_AND_TYPE]) == 0) {
992             int nameIndex = literalIndex(GETDECLAREDMETHOD_NAME);
993             int typeIndex = literalIndex(GETDECLAREDMETHOD_SIGNATURE);
994             nameAndTypeIndex = this.wellKnownMethodNameAndTypes[GETDECLAREDMETHOD_CLASS_METHOD_NAME_AND_TYPE] = this.currentIndex++;
995             writeU1(NameAndTypeTag);
996             writeU2(nameIndex);
997             writeU2(typeIndex);
998         }
999         index = this.wellKnownMethods[GETDECLAREDMETHOD_CLASS_METHOD] = this.currentIndex++;
1000        // Write the method ref constant into the constant pool
1001
// First add the tag
1002
writeU1(MethodRefTag);
1003        // Then write the class index
1004
writeU2(classIndex);
1005        // The write the nameAndType index
1006
writeU2(nameAndTypeIndex);
1007    }
1008    return index;
1009}
1010/**
1011 * This method returns the index into the constantPool corresponding to the
1012 * method descriptor. It can be either an interface method reference constant
1013 * or a method reference constant.
1014 *
1015 * @return <CODE>int</CODE>
1016 */

1017public int literalIndexForJavaLangDoubleDoubleValue() {
1018    int index;
1019    int nameAndTypeIndex;
1020    int classIndex;
1021    // Looking into the method ref table
1022
if ((index = this.wellKnownMethods[DOUBLEVALUE_DOUBLE_METHOD]) == 0) {
1023        classIndex = literalIndexForJavaLangDouble();
1024        if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[DOUBLEVALUE_DOUBLE_METHOD_NAME_AND_TYPE]) == 0) {
1025            int nameIndex = literalIndex(DOUBLEVALUE_DOUBLE_METHOD_NAME);
1026            int typeIndex = literalIndex(DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE);
1027            nameAndTypeIndex = this.wellKnownMethodNameAndTypes[DOUBLEVALUE_DOUBLE_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1028            writeU1(NameAndTypeTag);
1029            writeU2(nameIndex);
1030            writeU2(typeIndex);
1031        }
1032        index = this.wellKnownMethods[DOUBLEVALUE_DOUBLE_METHOD] = this.currentIndex++;
1033        // Write the method ref constant into the constant pool
1034
// First add the tag
1035
writeU1(MethodRefTag);
1036        // Then write the class index
1037
writeU2(classIndex);
1038        // The write the nameAndType index
1039
writeU2(nameAndTypeIndex);
1040    }
1041    return index;
1042}
1043/**
1044 * This method returns the index into the constantPool corresponding to the
1045 * method descriptor. It can be either an interface method reference constant
1046 * or a method reference constant.
1047 *
1048 * @return <CODE>int</CODE>
1049 */

1050public int literalIndexForJavaLangFloatFloatValue() {
1051    int index;
1052    int nameAndTypeIndex;
1053    int classIndex;
1054    // Looking into the method ref table
1055
if ((index = this.wellKnownMethods[FLOATVALUE_FLOAT_METHOD]) == 0) {
1056        classIndex = literalIndexForJavaLangFloat();
1057        if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[FLOATVALUE_FLOAT_METHOD_NAME_AND_TYPE]) == 0) {
1058            int nameIndex = literalIndex(FLOATVALUE_FLOAT_METHOD_NAME);
1059            int typeIndex = literalIndex(FLOATVALUE_FLOAT_METHOD_SIGNATURE);
1060            nameAndTypeIndex = this.wellKnownMethodNameAndTypes[FLOATVALUE_FLOAT_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1061            writeU1(NameAndTypeTag);
1062            writeU2(nameIndex);
1063            writeU2(typeIndex);
1064        }
1065        index = this.wellKnownMethods[FLOATVALUE_FLOAT_METHOD] = this.currentIndex++;
1066        // Write the method ref constant into the constant pool
1067
// First add the tag
1068
writeU1(MethodRefTag);
1069        // Then write the class index
1070
writeU2(classIndex);
1071        // The write the nameAndType index
1072
writeU2(nameAndTypeIndex);
1073    }
1074    return index;
1075}
1076/**
1077 * This method returns the index into the constantPool corresponding to the
1078 * method descriptor. It can be either an interface method reference constant
1079 * or a method reference constant.
1080 *
1081 * @return <CODE>int</CODE>
1082 */

1083public int literalIndexForJavaLangIntegerIntValue() {
1084    int index;
1085    int nameAndTypeIndex;
1086    int classIndex;
1087    // Looking into the method ref table
1088
if ((index = this.wellKnownMethods[INTVALUE_INTEGER_METHOD]) == 0) {
1089        classIndex = literalIndexForJavaLangInteger();
1090        if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[INTVALUE_INTEGER_METHOD_NAME_AND_TYPE]) == 0) {
1091            int nameIndex = literalIndex(INTVALUE_INTEGER_METHOD_NAME);
1092            int typeIndex = literalIndex(INTVALUE_INTEGER_METHOD_SIGNATURE);
1093            nameAndTypeIndex = this.wellKnownMethodNameAndTypes[INTVALUE_INTEGER_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1094            writeU1(NameAndTypeTag);
1095            writeU2(nameIndex);
1096            writeU2(typeIndex);
1097        }
1098        index = this.wellKnownMethods[INTVALUE_INTEGER_METHOD] = this.currentIndex++;
1099        // Write the method ref constant into the constant pool
1100
// First add the tag
1101
writeU1(MethodRefTag);
1102        // Then write the class index
1103
writeU2(classIndex);
1104        // The write the nameAndType index
1105
writeU2(nameAndTypeIndex);
1106    }
1107    return index;
1108}
1109/**
1110 * This method returns the index into the constantPool corresponding to the
1111 * method descriptor. It can be either an interface method reference constant
1112 * or a method reference constant.
1113 *
1114 * @return <CODE>int</CODE>
1115 */

1116public int literalIndexForJavaLangLongLongValue() {
1117    int index;
1118    int nameAndTypeIndex;
1119    int classIndex;
1120    // Looking into the method ref table
1121
if ((index = this.wellKnownMethods[LONGVALUE_LONG_METHOD]) == 0) {
1122        classIndex = literalIndexForJavaLangLong();
1123        if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[LONGVALUE_LONG_METHOD_NAME_AND_TYPE]) == 0) {
1124            int nameIndex = literalIndex(LONGVALUE_LONG_METHOD_NAME);
1125            int typeIndex = literalIndex(LONGVALUE_LONG_METHOD_SIGNATURE);
1126            nameAndTypeIndex = this.wellKnownMethodNameAndTypes[LONGVALUE_LONG_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1127            writeU1(NameAndTypeTag);
1128            writeU2(nameIndex);
1129            writeU2(typeIndex);
1130        }
1131        index = this.wellKnownMethods[LONGVALUE_LONG_METHOD] = this.currentIndex++;
1132        // Write the method ref constant into the constant pool
1133
// First add the tag
1134
writeU1(MethodRefTag);
1135        // Then write the class index
1136
writeU2(classIndex);
1137        // The write the nameAndType index
1138
writeU2(nameAndTypeIndex);
1139    }
1140    return index;
1141}
1142/**
1143 * This method returns the index into the constantPool corresponding to the
1144 * method descriptor. It can be either an interface method reference constant
1145 * or a method reference constant.
1146 *
1147 * @return <CODE>int</CODE>
1148 */

1149public int literalIndexForJavaLangReflectAccessibleObject() {
1150    int index;
1151    if ((index = this.wellKnownTypes[JAVA_LANG_REFLECT_ACCESSIBLEOBJECT_TYPE]) == 0) {
1152        int nameIndex;
1153        // The entry doesn't exit yet
1154
nameIndex = literalIndex(JAVALANGREFLECTACCESSIBLEOBJECT_CONSTANTPOOLNAME);
1155        index = this.wellKnownTypes[JAVA_LANG_REFLECT_ACCESSIBLEOBJECT_TYPE] = this.currentIndex++;
1156        writeU1(ClassTag);
1157        // Then add the 8 bytes representing the long
1158
writeU2(nameIndex);
1159    }
1160    return index;
1161}
1162/**
1163 * This method returns the index into the constantPool corresponding to the
1164 * method descriptor. It can be either an interface method reference constant
1165 * or a method reference constant.
1166 *
1167 * @return <CODE>int</CODE>
1168 */

1169public int literalIndexForJavaLangReflectAccessibleObjectSetAccessible() {
1170    int index;
1171    int nameAndTypeIndex;
1172    int classIndex;
1173    // Looking into the method ref table
1174
if ((index = this.wellKnownMethods[SETACCESSIBLE_ACCESSIBLEOBJECT_METHOD]) == 0) {
1175        classIndex = literalIndexForJavaLangReflectAccessibleObject();
1176        if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[SETACCESSIBLE_ACCESSIBLEOBJECT_METHOD_NAME_AND_TYPE]) == 0) {
1177            int nameIndex = literalIndex(SETACCESSIBLE_NAME);
1178            int typeIndex = literalIndex(SETACCESSIBLE_SIGNATURE);
1179            nameAndTypeIndex = this.wellKnownMethodNameAndTypes[SETACCESSIBLE_ACCESSIBLEOBJECT_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1180            writeU1(NameAndTypeTag);
1181            writeU2(nameIndex);
1182            writeU2(typeIndex);
1183        }
1184        index = this.wellKnownMethods[SETACCESSIBLE_ACCESSIBLEOBJECT_METHOD] = this.currentIndex++;
1185        // Write the method ref constant into the constant pool
1186
// First add the tag
1187
writeU1(MethodRefTag);
1188        // Then write the class index
1189
writeU2(classIndex);
1190        // The write the nameAndType index
1191
writeU2(nameAndTypeIndex);
1192    }
1193    return index;
1194}
1195/**
1196 * This method returns the index into the constantPool corresponding to the
1197 * method descriptor. It can be either an interface method reference constant
1198 * or a method reference constant.
1199 *
1200 * @return <CODE>int</CODE>
1201 */

1202public int literalIndexForJavaLangReflectArray() {
1203    int index;
1204    if ((index = this.wellKnownTypes[JAVA_LANG_REFLECT_ARRAY_TYPE]) == 0) {
1205        int nameIndex;
1206        // The entry doesn't exit yet
1207
nameIndex = literalIndex(JAVALANGREFLECTARRAY_CONSTANTPOOLNAME);
1208        index = this.wellKnownTypes[JAVA_LANG_REFLECT_ARRAY_TYPE] = this.currentIndex++;
1209        writeU1(ClassTag);
1210        // Then add the 8 bytes representing the long
1211
writeU2(nameIndex);
1212    }
1213    return index;
1214}
1215/**
1216 * This method returns the index into the constantPool corresponding to the
1217 * method descriptor. It can be either an interface method reference constant
1218 * or a method reference constant.
1219 *
1220 * @return <CODE>int</CODE>
1221 */

1222public int literalIndexForJavaLangReflectArrayNewInstance() {
1223    int index;
1224    int nameAndTypeIndex;
1225    int classIndex;
1226    // Looking into the method ref table
1227
if ((index = this.wellKnownMethods[NEWINSTANCE_ARRAY_METHOD]) == 0) {
1228        classIndex = literalIndexForJavaLangReflectArray();
1229        if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[ARRAY_NEWINSTANCE_METHOD_NAME_AND_TYPE]) == 0) {
1230            int nameIndex = literalIndex(ARRAY_NEWINSTANCE_NAME);
1231            int typeIndex = literalIndex(ARRAY_NEWINSTANCE_SIGNATURE);
1232            nameAndTypeIndex = this.wellKnownMethodNameAndTypes[ARRAY_NEWINSTANCE_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1233            writeU1(NameAndTypeTag);
1234            writeU2(nameIndex);
1235            writeU2(typeIndex);
1236        }
1237        index = this.wellKnownMethods[NEWINSTANCE_ARRAY_METHOD] = this.currentIndex++;
1238        // Write the method ref constant into the constant pool
1239
// First add the tag
1240
writeU1(MethodRefTag);
1241        // Then write the class index
1242
writeU2(classIndex);
1243        // The write the nameAndType index
1244
writeU2(nameAndTypeIndex);
1245    }
1246    return index;
1247}
1248/**
1249 * This method returns the index into the constantPool corresponding to the
1250 * method descriptor. It can be either an interface method reference constant
1251 * or a method reference constant.
1252 *
1253 * @return <CODE>int</CODE>
1254 */

1255public int literalIndexForJavaLangReflectField() {
1256    int index;
1257    if ((index = this.wellKnownTypes[JAVA_LANG_REFLECT_FIELD_TYPE]) == 0) {
1258        int nameIndex;
1259        // The entry doesn't exit yet
1260
nameIndex = literalIndex(JAVALANGREFLECTFIELD_CONSTANTPOOLNAME);
1261        index = this.wellKnownTypes[JAVA_LANG_REFLECT_FIELD_TYPE] = this.currentIndex++;
1262        writeU1(ClassTag);
1263        // Then add the 8 bytes representing the long
1264
writeU2(nameIndex);
1265    }
1266    return index;
1267}
1268/**
1269 * This method returns the index into the constantPool corresponding to the
1270 * method descriptor. It can be either an interface method reference constant
1271 * or a method reference constant.
1272 *
1273 * @return <CODE>int</CODE>
1274 */

1275public int literalIndexForJavaLangReflectMethod() {
1276    int index;
1277    if ((index = this.wellKnownTypes[JAVA_LANG_REFLECT_METHOD_TYPE]) == 0) {
1278        int nameIndex;
1279        // The entry doesn't exit yet
1280
nameIndex = literalIndex(JAVALANGREFLECTMETHOD_CONSTANTPOOLNAME);
1281        index = this.wellKnownTypes[JAVA_LANG_REFLECT_METHOD_TYPE] = this.currentIndex++;
1282        writeU1(ClassTag);
1283        // Then add the 8 bytes representing the long
1284
writeU2(nameIndex);
1285    }
1286    return index;
1287}
1288/**
1289 * This method returns the index into the constantPool corresponding to the
1290 * method descriptor. It can be either an interface method reference constant
1291 * or a method reference constant.
1292 *
1293 * @return <CODE>int</CODE>
1294 */

1295public int literalIndexForJavaLangReflectMethodInvoke() {
1296    int index;
1297    int nameAndTypeIndex;
1298    int classIndex;
1299    // Looking into the method ref table
1300
if ((index = this.wellKnownMethods[INVOKE_METHOD_METHOD]) == 0) {
1301        classIndex = literalIndexForJavaLangReflectMethod();
1302        if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[INVOKE_METHOD_METHOD_NAME_AND_TYPE]) == 0) {
1303            int nameIndex = literalIndex(INVOKE_METHOD_METHOD_NAME);
1304            int typeIndex = literalIndex(INVOKE_METHOD_METHOD_SIGNATURE);
1305            nameAndTypeIndex = this.wellKnownMethodNameAndTypes[INVOKE_METHOD_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1306            writeU1(NameAndTypeTag);
1307            writeU2(nameIndex);
1308            writeU2(typeIndex);
1309        }
1310        index = this.wellKnownMethods[INVOKE_METHOD_METHOD] = this.currentIndex++;
1311        // Write the method ref constant into the constant pool
1312
// First add the tag
1313
writeU1(MethodRefTag);
1314        // Then write the class index
1315
writeU2(classIndex);
1316        // The write the nameAndType index
1317
writeU2(nameAndTypeIndex);
1318    }
1319    return index;
1320}
1321/**
1322 * This method returns the index into the constantPool corresponding to the
1323 * method descriptor. It can be either an interface method reference constant
1324 * or a method reference constant.
1325 *
1326 * @return <CODE>int</CODE>
1327 */

1328public int literalIndexForJavaLangShortShortValue() {
1329    int index;
1330    int nameAndTypeIndex;
1331    int classIndex;
1332    // Looking into the method ref table
1333
if ((index = this.wellKnownMethods[SHORTVALUE_SHORT_METHOD]) == 0) {
1334        classIndex = literalIndexForJavaLangShort();
1335        if ((nameAndTypeIndex = this.wellKnownMethodNameAndTypes[SHORTVALUE_SHORT_METHOD_NAME_AND_TYPE]) == 0) {
1336            int nameIndex = literalIndex(SHORTVALUE_SHORT_METHOD_NAME);
1337            int typeIndex = literalIndex(SHORTVALUE_SHORT_METHOD_SIGNATURE);
1338            nameAndTypeIndex = this.wellKnownMethodNameAndTypes[SHORTVALUE_SHORT_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1339            writeU1(NameAndTypeTag);
1340            writeU2(nameIndex);
1341            writeU2(typeIndex);
1342        }
1343        index = this.wellKnownMethods[SHORTVALUE_SHORT_METHOD] = this.currentIndex++;
1344        // Write the method ref constant into the constant pool
1345
// First add the tag
1346
writeU1(MethodRefTag);
1347        // Then write the class index
1348
writeU2(classIndex);
1349        // The write the nameAndType index
1350
writeU2(nameAndTypeIndex);
1351    }
1352    return index;
1353}
1354/**
1355 * This method returns the index into the constantPool corresponding
1356 * nameAndType constant with nameIndex, typeIndex.
1357 *
1358 * @param nameIndex int
1359 * @param typeIndex int
1360 * @param key org.eclipse.jdt.internal.compiler.lookup.MethodBinding
1361 * @return <CODE>int</CODE>
1362 */

1363public int literalIndexForMethods(int nameIndex, int typeIndex, MethodBinding key) {
1364    int index;
1365    int indexOfWellKnownMethodNameAndType;
1366    if ((indexOfWellKnownMethodNameAndType = super.indexOfWellKnownMethodNameAndType(key)) == -1) {
1367        if ((indexOfWellKnownMethodNameAndType = indexOfWellKnownMethodNameAndType(key)) == -1) {
1368            // check if the entry exists
1369
if ((index = this.nameAndTypeCacheForMethods.get(key)) == -1) {
1370                // The entry doesn't exit yet
1371
index = this.nameAndTypeCacheForMethods.put(key, this.currentIndex++);
1372                writeU1(NameAndTypeTag);
1373                writeU2(nameIndex);
1374                writeU2(typeIndex);
1375            }
1376        } else {
1377            if ((index = this.wellKnownMethodNameAndTypes[indexOfWellKnownMethodNameAndType]) == 0) {
1378                index = this.wellKnownMethodNameAndTypes[indexOfWellKnownMethodNameAndType] = this.currentIndex++;
1379                writeU1(NameAndTypeTag);
1380                writeU2(nameIndex);
1381                writeU2(typeIndex);
1382            }
1383        }
1384    } else {
1385        index = super.literalIndexForMethods(nameIndex,typeIndex,key);
1386    }
1387    return index;
1388}
1389/**
1390 * This method returns the index into the constantPool corresponding to the
1391 * method descriptor. It can be either an interface method reference constant
1392 * or a method reference constant.
1393 *
1394 * @return <CODE>int</CODE>
1395 */

1396public int literalIndexJavaLangReflectFieldGetter(int typeID) {
1397    int index = 0;
1398    int nameAndTypeIndex = 0;
1399    int classIndex = 0;
1400    switch (typeID) {
1401        case T_int :
1402            if ((index = this.wellKnownMethods[GET_INT_METHOD]) == 0) {
1403                classIndex = literalIndexForJavaLangReflectField();
1404                if ((nameAndTypeIndex =
1405                    this.wellKnownMethodNameAndTypes[GET_INT_METHOD_NAME_AND_TYPE])
1406                    == 0) {
1407                    int nameIndex = literalIndex(GET_INT_METHOD_NAME);
1408                    int typeIndex = literalIndex(GET_INT_METHOD_SIGNATURE);
1409                    nameAndTypeIndex =
1410                        this.wellKnownMethodNameAndTypes[GET_INT_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1411                    writeU1(NameAndTypeTag);
1412                    writeU2(nameIndex);
1413                    writeU2(typeIndex);
1414                }
1415                index = this.wellKnownMethods[GET_INT_METHOD] = this.currentIndex++;
1416                // Write the method ref constant into the constant pool
1417
// First add the tag
1418
writeU1(MethodRefTag);
1419                // Then write the class index
1420
writeU2(classIndex);
1421                // The write the nameAndType index
1422
writeU2(nameAndTypeIndex);
1423            }
1424            break;
1425        case T_byte :
1426            if ((index = this.wellKnownMethods[GET_BYTE_METHOD]) == 0) {
1427                classIndex = literalIndexForJavaLangReflectField();
1428                if ((nameAndTypeIndex =
1429                    this.wellKnownMethodNameAndTypes[GET_BYTE_METHOD_NAME_AND_TYPE])
1430                    == 0) {
1431                    int nameIndex = literalIndex(GET_BYTE_METHOD_NAME);
1432                    int typeIndex = literalIndex(GET_BYTE_METHOD_SIGNATURE);
1433                    nameAndTypeIndex =
1434                        this.wellKnownMethodNameAndTypes[GET_BYTE_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1435                    writeU1(NameAndTypeTag);
1436                    writeU2(nameIndex);
1437                    writeU2(typeIndex);
1438                }
1439                index = this.wellKnownMethods[GET_BYTE_METHOD] = this.currentIndex++;
1440                // Write the method ref constant into the constant pool
1441
// First add the tag
1442
writeU1(MethodRefTag);
1443                // Then write the class index
1444
writeU2(classIndex);
1445                // The write the nameAndType index
1446
writeU2(nameAndTypeIndex);
1447            }
1448            break;
1449        case T_short :
1450            if ((index = this.wellKnownMethods[GET_SHORT_METHOD]) == 0) {
1451                classIndex = literalIndexForJavaLangReflectField();
1452                if ((nameAndTypeIndex =
1453                    this.wellKnownMethodNameAndTypes[GET_SHORT_METHOD_NAME_AND_TYPE])
1454                    == 0) {
1455                    int nameIndex = literalIndex(GET_SHORT_METHOD_NAME);
1456                    int typeIndex = literalIndex(GET_SHORT_METHOD_SIGNATURE);
1457                    nameAndTypeIndex =
1458                        this.wellKnownMethodNameAndTypes[GET_SHORT_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1459                    writeU1(NameAndTypeTag);
1460                    writeU2(nameIndex);
1461                    writeU2(typeIndex);
1462                }
1463                index = this.wellKnownMethods[GET_SHORT_METHOD] = this.currentIndex++;
1464                // Write the method ref constant into the constant pool
1465
// First add the tag
1466
writeU1(MethodRefTag);
1467                // Then write the class index
1468
writeU2(classIndex);
1469                // The write the nameAndType index
1470
writeU2(nameAndTypeIndex);
1471            }
1472            break;
1473        case T_long :
1474            if ((index = this.wellKnownMethods[GET_LONG_METHOD]) == 0) {
1475                classIndex = literalIndexForJavaLangReflectField();
1476                if ((nameAndTypeIndex =
1477                    this.wellKnownMethodNameAndTypes[GET_LONG_METHOD_NAME_AND_TYPE])
1478                    == 0) {
1479                    int nameIndex = literalIndex(GET_LONG_METHOD_NAME);
1480                    int typeIndex = literalIndex(GET_LONG_METHOD_SIGNATURE);
1481                    nameAndTypeIndex =
1482                        this.wellKnownMethodNameAndTypes[GET_LONG_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1483                    writeU1(NameAndTypeTag);
1484                    writeU2(nameIndex);
1485                    writeU2(typeIndex);
1486                }
1487                index = this.wellKnownMethods[GET_LONG_METHOD] = this.currentIndex++;
1488                // Write the method ref constant into the constant pool
1489
// First add the tag
1490
writeU1(MethodRefTag);
1491                // Then write the class index
1492
writeU2(classIndex);
1493                // The write the nameAndType index
1494
writeU2(nameAndTypeIndex);
1495            }
1496            break;
1497        case T_float :
1498            if ((index = this.wellKnownMethods[GET_FLOAT_METHOD]) == 0) {
1499                classIndex = literalIndexForJavaLangReflectField();
1500                if ((nameAndTypeIndex =
1501                    this.wellKnownMethodNameAndTypes[GET_FLOAT_METHOD_NAME_AND_TYPE])
1502                    == 0) {
1503                    int nameIndex = literalIndex(GET_FLOAT_METHOD_NAME);
1504                    int typeIndex = literalIndex(GET_FLOAT_METHOD_SIGNATURE);
1505                    nameAndTypeIndex =
1506                        this.wellKnownMethodNameAndTypes[GET_FLOAT_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1507                    writeU1(NameAndTypeTag);
1508                    writeU2(nameIndex);
1509                    writeU2(typeIndex);
1510                }
1511                index = this.wellKnownMethods[GET_FLOAT_METHOD] = this.currentIndex++;
1512                // Write the method ref constant into the constant pool
1513
// First add the tag
1514
writeU1(MethodRefTag);
1515                // Then write the class index
1516
writeU2(classIndex);
1517                // The write the nameAndType index
1518
writeU2(nameAndTypeIndex);
1519            }
1520            break;
1521        case T_double :
1522            if ((index = this.wellKnownMethods[GET_DOUBLE_METHOD]) == 0) {
1523                classIndex = literalIndexForJavaLangReflectField();
1524                if ((nameAndTypeIndex =
1525                    this.wellKnownMethodNameAndTypes[GET_DOUBLE_METHOD_NAME_AND_TYPE])
1526                    == 0) {
1527                    int nameIndex = literalIndex(GET_DOUBLE_METHOD_NAME);
1528                    int typeIndex = literalIndex(GET_DOUBLE_METHOD_SIGNATURE);
1529                    nameAndTypeIndex =
1530                        this.wellKnownMethodNameAndTypes[GET_DOUBLE_METHOD_NAME_AND_TYPE] =
1531                            this.currentIndex++;
1532                    writeU1(NameAndTypeTag);
1533                    writeU2(nameIndex);
1534                    writeU2(typeIndex);
1535                }
1536                index = this.wellKnownMethods[GET_DOUBLE_METHOD] = this.currentIndex++;
1537                // Write the method ref constant into the constant pool
1538
// First add the tag
1539
writeU1(MethodRefTag);
1540                // Then write the class index
1541
writeU2(classIndex);
1542                // The write the nameAndType index
1543
writeU2(nameAndTypeIndex);
1544            }
1545            break;
1546        case T_char :
1547            if ((index = this.wellKnownMethods[GET_CHAR_METHOD]) == 0) {
1548                classIndex = literalIndexForJavaLangReflectField();
1549                if ((nameAndTypeIndex =
1550                    this.wellKnownMethodNameAndTypes[GET_CHAR_METHOD_NAME_AND_TYPE])
1551                    == 0) {
1552                    int nameIndex = literalIndex(GET_CHAR_METHOD_NAME);
1553                    int typeIndex = literalIndex(GET_CHAR_METHOD_SIGNATURE);
1554                    nameAndTypeIndex =
1555                        this.wellKnownMethodNameAndTypes[GET_CHAR_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1556                    writeU1(NameAndTypeTag);
1557                    writeU2(nameIndex);
1558                    writeU2(typeIndex);
1559                }
1560                index = this.wellKnownMethods[GET_CHAR_METHOD] = this.currentIndex++;
1561                // Write the method ref constant into the constant pool
1562
// First add the tag
1563
writeU1(MethodRefTag);
1564                // Then write the class index
1565
writeU2(classIndex);
1566                // The write the nameAndType index
1567
writeU2(nameAndTypeIndex);
1568            }
1569            break;
1570        case T_boolean :
1571            if ((index = this.wellKnownMethods[GET_BOOLEAN_METHOD]) == 0) {
1572                classIndex = literalIndexForJavaLangReflectField();
1573                if ((nameAndTypeIndex =
1574                    this.wellKnownMethodNameAndTypes[GET_BOOLEAN_METHOD_NAME_AND_TYPE])
1575                    == 0) {
1576                    int nameIndex = literalIndex(GET_BOOLEAN_METHOD_NAME);
1577                    int typeIndex = literalIndex(GET_BOOLEAN_METHOD_SIGNATURE);
1578                    nameAndTypeIndex =
1579                        this.wellKnownMethodNameAndTypes[GET_BOOLEAN_METHOD_NAME_AND_TYPE] =
1580                            this.currentIndex++;
1581                    writeU1(NameAndTypeTag);
1582                    writeU2(nameIndex);
1583                    writeU2(typeIndex);
1584                }
1585                index = this.wellKnownMethods[GET_BOOLEAN_METHOD] = this.currentIndex++;
1586                // Write the method ref constant into the constant pool
1587
// First add the tag
1588
writeU1(MethodRefTag);
1589                // Then write the class index
1590
writeU2(classIndex);
1591                // The write the nameAndType index
1592
writeU2(nameAndTypeIndex);
1593            }
1594            break;
1595        default :
1596            if ((index = this.wellKnownMethods[GET_OBJECT_METHOD]) == 0) {
1597                classIndex = literalIndexForJavaLangReflectField();
1598                if ((nameAndTypeIndex =
1599                    this.wellKnownMethodNameAndTypes[GET_OBJECT_METHOD_NAME_AND_TYPE])
1600                    == 0) {
1601                    int nameIndex = literalIndex(GET_OBJECT_METHOD_NAME);
1602                    int typeIndex = literalIndex(GET_OBJECT_METHOD_SIGNATURE);
1603                    nameAndTypeIndex =
1604                        this.wellKnownMethodNameAndTypes[GET_OBJECT_METHOD_NAME_AND_TYPE] =
1605                            this.currentIndex++;
1606                    writeU1(NameAndTypeTag);
1607                    writeU2(nameIndex);
1608                    writeU2(typeIndex);
1609                }
1610                index = this.wellKnownMethods[GET_OBJECT_METHOD] = this.currentIndex++;
1611                // Write the method ref constant into the constant pool
1612
// First add the tag
1613
writeU1(MethodRefTag);
1614                // Then write the class index
1615
writeU2(classIndex);
1616                // The write the nameAndType index
1617
writeU2(nameAndTypeIndex);
1618            }
1619        }
1620    return index;
1621}
1622/**
1623 * This method returns the index into the constantPool corresponding to the
1624 * method descriptor. It can be either an interface method reference constant
1625 * or a method reference constant.
1626 *
1627 * @return <CODE>int</CODE>
1628 */

1629public int literalIndexJavaLangReflectFieldSetter(int typeID) {
1630    int index = 0;
1631    int nameAndTypeIndex = 0;
1632    int classIndex = 0;
1633    switch (typeID) {
1634        case T_int :
1635            if ((index = this.wellKnownMethods[SET_INT_METHOD]) == 0) {
1636                classIndex = literalIndexForJavaLangReflectField();
1637                if ((nameAndTypeIndex =
1638                    this.wellKnownMethodNameAndTypes[SET_INT_METHOD_NAME_AND_TYPE])
1639                    == 0) {
1640                    int nameIndex = literalIndex(SET_INT_METHOD_NAME);
1641                    int typeIndex = literalIndex(SET_INT_METHOD_SIGNATURE);
1642                    nameAndTypeIndex =
1643                        this.wellKnownMethodNameAndTypes[SET_INT_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1644                    writeU1(NameAndTypeTag);
1645                    writeU2(nameIndex);
1646                    writeU2(typeIndex);
1647                }
1648                index = this.wellKnownMethods[SET_INT_METHOD] = this.currentIndex++;
1649                // Write the method ref constant into the constant pool
1650
// First add the tag
1651
writeU1(MethodRefTag);
1652                // Then write the class index
1653
writeU2(classIndex);
1654                // The write the nameAndType index
1655
writeU2(nameAndTypeIndex);
1656            }
1657            break;
1658        case T_byte :
1659            if ((index = this.wellKnownMethods[SET_BYTE_METHOD]) == 0) {
1660                classIndex = literalIndexForJavaLangReflectField();
1661                if ((nameAndTypeIndex =
1662                    this.wellKnownMethodNameAndTypes[SET_BYTE_METHOD_NAME_AND_TYPE])
1663                    == 0) {
1664                    int nameIndex = literalIndex(SET_BYTE_METHOD_NAME);
1665                    int typeIndex = literalIndex(SET_BYTE_METHOD_SIGNATURE);
1666                    nameAndTypeIndex =
1667                        this.wellKnownMethodNameAndTypes[SET_BYTE_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1668                    writeU1(NameAndTypeTag);
1669                    writeU2(nameIndex);
1670                    writeU2(typeIndex);
1671                }
1672                index = this.wellKnownMethods[SET_BYTE_METHOD] = this.currentIndex++;
1673                // Write the method ref constant into the constant pool
1674
// First add the tag
1675
writeU1(MethodRefTag);
1676                // Then write the class index
1677
writeU2(classIndex);
1678                // The write the nameAndType index
1679
writeU2(nameAndTypeIndex);
1680            }
1681            break;
1682        case T_short :
1683            if ((index = this.wellKnownMethods[SET_SHORT_METHOD]) == 0) {
1684                classIndex = literalIndexForJavaLangReflectField();
1685                if ((nameAndTypeIndex =
1686                    this.wellKnownMethodNameAndTypes[SET_SHORT_METHOD_NAME_AND_TYPE])
1687                    == 0) {
1688                    int nameIndex = literalIndex(SET_SHORT_METHOD_NAME);
1689                    int typeIndex = literalIndex(SET_SHORT_METHOD_SIGNATURE);
1690                    nameAndTypeIndex =
1691                        this.wellKnownMethodNameAndTypes[SET_SHORT_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1692                    writeU1(NameAndTypeTag);
1693                    writeU2(nameIndex);
1694                    writeU2(typeIndex);
1695                }
1696                index = this.wellKnownMethods[SET_SHORT_METHOD] = this.currentIndex++;
1697                // Write the method ref constant into the constant pool
1698
// First add the tag
1699
writeU1(MethodRefTag);
1700                // Then write the class index
1701
writeU2(classIndex);
1702                // The write the nameAndType index
1703
writeU2(nameAndTypeIndex);
1704            }
1705            break;
1706        case T_long :
1707            if ((index = this.wellKnownMethods[SET_LONG_METHOD]) == 0) {
1708                classIndex = literalIndexForJavaLangReflectField();
1709                if ((nameAndTypeIndex =
1710                    this.wellKnownMethodNameAndTypes[SET_LONG_METHOD_NAME_AND_TYPE])
1711                    == 0) {
1712                    int nameIndex = literalIndex(SET_LONG_METHOD_NAME);
1713                    int typeIndex = literalIndex(SET_LONG_METHOD_SIGNATURE);
1714                    nameAndTypeIndex =
1715                        this.wellKnownMethodNameAndTypes[SET_LONG_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1716                    writeU1(NameAndTypeTag);
1717                    writeU2(nameIndex);
1718                    writeU2(typeIndex);
1719                }
1720                index = this.wellKnownMethods[SET_LONG_METHOD] = this.currentIndex++;
1721                // Write the method ref constant into the constant pool
1722
// First add the tag
1723
writeU1(MethodRefTag);
1724                // Then write the class index
1725
writeU2(classIndex);
1726                // The write the nameAndType index
1727
writeU2(nameAndTypeIndex);
1728            }
1729            break;
1730        case T_float :
1731            if ((index = this.wellKnownMethods[SET_FLOAT_METHOD]) == 0) {
1732                classIndex = literalIndexForJavaLangReflectField();
1733                if ((nameAndTypeIndex =
1734                    this.wellKnownMethodNameAndTypes[SET_FLOAT_METHOD_NAME_AND_TYPE])
1735                    == 0) {
1736                    int nameIndex = literalIndex(SET_FLOAT_METHOD_NAME);
1737                    int typeIndex = literalIndex(SET_FLOAT_METHOD_SIGNATURE);
1738                    nameAndTypeIndex =
1739                        this.wellKnownMethodNameAndTypes[SET_FLOAT_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1740                    writeU1(NameAndTypeTag);
1741                    writeU2(nameIndex);
1742                    writeU2(typeIndex);
1743                }
1744                index = this.wellKnownMethods[SET_FLOAT_METHOD] = this.currentIndex++;
1745                // Write the method ref constant into the constant pool
1746
// First add the tag
1747
writeU1(MethodRefTag);
1748                // Then write the class index
1749
writeU2(classIndex);
1750                // The write the nameAndType index
1751
writeU2(nameAndTypeIndex);
1752            }
1753            break;
1754        case T_double :
1755            if ((index = this.wellKnownMethods[SET_DOUBLE_METHOD]) == 0) {
1756                classIndex = literalIndexForJavaLangReflectField();
1757                if ((nameAndTypeIndex =
1758                    this.wellKnownMethodNameAndTypes[SET_DOUBLE_METHOD_NAME_AND_TYPE])
1759                    == 0) {
1760                    int nameIndex = literalIndex(SET_DOUBLE_METHOD_NAME);
1761                    int typeIndex = literalIndex(SET_DOUBLE_METHOD_SIGNATURE);
1762                    nameAndTypeIndex =
1763                        this.wellKnownMethodNameAndTypes[SET_DOUBLE_METHOD_NAME_AND_TYPE] =
1764                            this.currentIndex++;
1765                    writeU1(NameAndTypeTag);
1766                    writeU2(nameIndex);
1767                    writeU2(typeIndex);
1768                }
1769                index = this.wellKnownMethods[SET_DOUBLE_METHOD] = this.currentIndex++;
1770                // Write the method ref constant into the constant pool
1771
// First add the tag
1772
writeU1(MethodRefTag);
1773                // Then write the class index
1774
writeU2(classIndex);
1775                // The write the nameAndType index
1776
writeU2(nameAndTypeIndex);
1777            }
1778            break;
1779        case T_char :
1780            if ((index = this.wellKnownMethods[SET_CHAR_METHOD]) == 0) {
1781                classIndex = literalIndexForJavaLangReflectField();
1782                if ((nameAndTypeIndex =
1783                    this.wellKnownMethodNameAndTypes[SET_CHAR_METHOD_NAME_AND_TYPE])
1784                    == 0) {
1785                    int nameIndex = literalIndex(SET_CHAR_METHOD_NAME);
1786                    int typeIndex = literalIndex(SET_CHAR_METHOD_SIGNATURE);
1787                    nameAndTypeIndex =
1788                        this.wellKnownMethodNameAndTypes[SET_CHAR_METHOD_NAME_AND_TYPE] = this.currentIndex++;
1789                    writeU1(NameAndTypeTag);
1790                    writeU2(nameIndex);
1791                    writeU2(typeIndex);
1792                }
1793                index = this.wellKnownMethods[SET_CHAR_METHOD] = this.currentIndex++;
1794                // Write the method ref constant into the constant pool
1795
// First add the tag
1796
writeU1(MethodRefTag);
1797                // Then write the class index
1798
writeU2(classIndex);
1799                // The write the nameAndType index
1800
writeU2(nameAndTypeIndex);
1801            }
1802            break;
1803        case T_boolean :
1804            if ((index = this.wellKnownMethods[SET_BOOLEAN_METHOD]) == 0) {
1805                classIndex = literalIndexForJavaLangReflectField();
1806                if ((nameAndTypeIndex =
1807                    this.wellKnownMethodNameAndTypes[SET_BOOLEAN_METHOD_NAME_AND_TYPE])
1808                    == 0) {
1809                    int nameIndex = literalIndex(SET_BOOLEAN_METHOD_NAME);
1810                    int typeIndex = literalIndex(SET_BOOLEAN_METHOD_SIGNATURE);
1811                    nameAndTypeIndex =
1812                        this.wellKnownMethodNameAndTypes[SET_BOOLEAN_METHOD_NAME_AND_TYPE] =
1813                            this.currentIndex++;
1814                    writeU1(NameAndTypeTag);
1815                    writeU2(nameIndex);
1816                    writeU2(typeIndex);
1817                }
1818                index = this.wellKnownMethods[SET_BOOLEAN_METHOD] = this.currentIndex++;
1819                // Write the method ref constant into the constant pool
1820
// First add the tag
1821
writeU1(MethodRefTag);
1822                // Then write the class index
1823
writeU2(classIndex);
1824                // The write the nameAndType index
1825
writeU2(nameAndTypeIndex);
1826            }
1827            break;
1828        default :
1829            if ((index = this.wellKnownMethods[SET_OBJECT_METHOD]) == 0) {
1830                classIndex = literalIndexForJavaLangReflectField();
1831                if ((nameAndTypeIndex =
1832                    this.wellKnownMethodNameAndTypes[SET_OBJECT_METHOD_NAME_AND_TYPE])
1833                    == 0) {
1834                    int nameIndex = literalIndex(SET_OBJECT_METHOD_NAME);
1835                    int typeIndex = literalIndex(SET_OBJECT_METHOD_SIGNATURE);
1836                    nameAndTypeIndex =
1837                        this.wellKnownMethodNameAndTypes[SET_OBJECT_METHOD_NAME_AND_TYPE] =
1838                            this.currentIndex++;
1839                    writeU1(NameAndTypeTag);
1840                    writeU2(nameIndex);
1841                    writeU2(typeIndex);
1842                }
1843                index = this.wellKnownMethods[SET_OBJECT_METHOD] = this.currentIndex++;
1844                // Write the method ref constant into the constant pool
1845
// First add the tag
1846
writeU1(MethodRefTag);
1847                // Then write the class index
1848
writeU2(classIndex);
1849                // The write the nameAndType index
1850
writeU2(nameAndTypeIndex);
1851            }
1852        }
1853    return index;
1854}
1855}
1856
Popular Tags