jdk/src/share/classes/sun/instrument/TransformerManager.java
author ohair
Tue, 25 May 2010 15:58:33 -0700
changeset 5506 202f599c92aa
parent 2 90ce3da70b43
child 11125 99b115114fa3
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.instrument;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.lang.instrument.Instrumentation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.lang.instrument.ClassFileTransformer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.security.ProtectionDomain;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * Copyright 2003 Wily Technology, Inc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * Support class for the InstrumentationImpl. Manages the list of registered transformers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * Keeps everything in the right order, deals with sync of the list,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * and actually does the calling of the transformers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
public class TransformerManager
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    private class TransformerInfo {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        final ClassFileTransformer  mTransformer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        String                      mPrefix;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        TransformerInfo(ClassFileTransformer transformer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
            mTransformer = transformer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
            mPrefix = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        ClassFileTransformer transformer() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
            return  mTransformer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        String getPrefix() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
            return mPrefix;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        void setPrefix(String prefix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
            mPrefix = prefix;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * a given instance of this list is treated as immutable to simplify sync;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * we pay copying overhead whenever the list is changed rather than every time
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * the list is referenced.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * The array is kept in the order the transformers are added via addTransformer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * (first added is 0, last added is length-1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * Use an array, not a List or other Collection. This keeps the set of classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * used by this code to a minimum. We want as few dependencies as possible in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * code, since it is used inside the class definition system. Any class referenced here
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * cannot be transformed by Java code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    private TransformerInfo[]  mTransformerList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    /***
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * Is this TransformerManager for transformers capable of retransformation?
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    private boolean            mIsRetransformable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    TransformerManager(boolean isRetransformable) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        mTransformerList    = new TransformerInfo[0];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        mIsRetransformable  = isRetransformable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    boolean isRetransformable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        return mIsRetransformable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    public synchronized void
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    addTransformer( ClassFileTransformer    transformer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        TransformerInfo[] oldList = mTransformerList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        TransformerInfo[] newList = new TransformerInfo[oldList.length + 1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        System.arraycopy(   oldList,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
                            0,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                            newList,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                            0,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
                            oldList.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        newList[oldList.length] = new TransformerInfo(transformer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        mTransformerList = newList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    public synchronized boolean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    removeTransformer(ClassFileTransformer  transformer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        boolean                 found           = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        TransformerInfo[]       oldList         = mTransformerList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        int                     oldLength       = oldList.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        int                     newLength       = oldLength - 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        // look for it in the list, starting at the last added, and remember
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        // where it was if we found it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        int matchingIndex   = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        for ( int x = oldLength - 1; x >= 0; x-- ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            if ( oldList[x].transformer() == transformer ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                found           = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                matchingIndex   = x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        // make a copy of the array without the matching element
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        if ( found ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            TransformerInfo[]  newList = new TransformerInfo[newLength];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            // copy up to but not including the match
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            if ( matchingIndex > 0 ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                System.arraycopy(   oldList,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                                    0,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                                    newList,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                                    0,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                                    matchingIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
            // if there is anything after the match, copy it as well
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            if ( matchingIndex < (newLength) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                System.arraycopy(   oldList,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                                    matchingIndex + 1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                                    newList,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                                    matchingIndex,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                                    (newLength) - matchingIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            mTransformerList = newList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        return found;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    synchronized boolean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    includesTransformer(ClassFileTransformer transformer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        for (TransformerInfo info : mTransformerList) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            if ( info.transformer() == transformer ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
                return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    // This function doesn't actually snapshot anything, but should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    // used to set a local variable, which will snapshot the transformer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    // list because of the copying semantics of mTransformerList (see
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    // the comment for mTransformerList).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    private TransformerInfo[]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    getSnapshotTransformerList() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        return mTransformerList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    public byte[]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    transform(  ClassLoader         loader,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                String              classname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                Class               classBeingRedefined,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                ProtectionDomain    protectionDomain,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                byte[]              classfileBuffer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        boolean someoneTouchedTheBytecode = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        TransformerInfo[]  transformerList = getSnapshotTransformerList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        byte[]  bufferToUse = classfileBuffer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        // order matters, gotta run 'em in the order they were added
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        for ( int x = 0; x < transformerList.length; x++ ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            TransformerInfo         transformerInfo = transformerList[x];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            ClassFileTransformer    transformer = transformerInfo.transformer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
            byte[]                  transformedBytes = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                transformedBytes = transformer.transform(   loader,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                                                            classname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                                                            classBeingRedefined,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                                                            protectionDomain,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                                                            bufferToUse);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            catch (Throwable t) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                // don't let any one transformer mess it up for the others.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                // This is where we need to put some logging. What should go here? FIXME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            if ( transformedBytes != null ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                someoneTouchedTheBytecode = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                bufferToUse = transformedBytes;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        // if someone modified it, return the modified buffer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        // otherwise return null to mean "no transforms occurred"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        byte [] result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        if ( someoneTouchedTheBytecode ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            result = bufferToUse;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            result = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        return result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    getTransformerCount() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        TransformerInfo[]  transformerList = getSnapshotTransformerList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        return transformerList.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    boolean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    setNativeMethodPrefix(ClassFileTransformer transformer, String prefix) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        TransformerInfo[]  transformerList = getSnapshotTransformerList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        for ( int x = 0; x < transformerList.length; x++ ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
            TransformerInfo         transformerInfo = transformerList[x];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
            ClassFileTransformer    aTransformer = transformerInfo.transformer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
            if ( aTransformer == transformer ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                transformerInfo.setPrefix(prefix);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    String[]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    getNativeMethodPrefixes() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        TransformerInfo[]  transformerList = getSnapshotTransformerList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        String[] prefixes                  = new String[transformerList.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
        for ( int x = 0; x < transformerList.length; x++ ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
            TransformerInfo         transformerInfo = transformerList[x];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
            prefixes[x] = transformerInfo.getPrefix();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        return prefixes;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
}